Android Open Source - PocketLantern My View






From Project

Back to project page PocketLantern.

License

The source code is released under:

GNU General Public License

If you think the Android project PocketLantern listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package cc.co.techzealous.pl.utils;
/*from  www. j  a v  a  2 s.  c om*/
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;

public class MyView extends View{

  private int posX;
  private int posY;
  private int size;
  private Paint myPaint;
  
  public MyView(Context context) {
    super(context);
    myInit();
  }
  
  public MyView(Context context, AttributeSet attrs) {
    super(context, attrs);
    myInit();
  }
  
  public MyView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    myInit();
  }

  @Override
  protected void onDraw(Canvas canvas) {
    canvas.drawCircle(posX, posY, size, myPaint);
  }
  
  private void myInit() {
    posX = 10;
    posY = 10;
    size = 10;
    myPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    myPaint.setColor(Color.TRANSPARENT);
  }
  
  public void setPosX(int aX) {
    posX = aX;
  }
  public void setPosY(int aY) {
    posY = aY;
  }
  public void setSize(int aSize) {
    size = aSize;
  }
  public void setLightPaint(Paint aPaint) {
    myPaint = aPaint;
  }
}




Java Source Code List

cc.co.techzealous.pl.MainActivity.java
cc.co.techzealous.pl.PLEulaActivity.java
cc.co.techzealous.pl.PLPreferenceActivity.java
cc.co.techzealous.pl.PLSizeActivity.java
cc.co.techzealous.pl.utils.MyView.java
cc.co.techzealous.pl.utils.PLConstants.java