Created
August 8, 2017 09:46
-
-
Save TakuSemba/8cc2af8ab515e75e160ecab72353f27f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CanvasView extends View { | |
private Paint paint = new Paint(); | |
public CanvasView(Context context) { | |
super(context); | |
} | |
public CanvasView(Context context, @Nullable AttributeSet attrs) { | |
super(context, attrs); | |
} | |
public CanvasView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { | |
super(context, attrs, defStyleAttr); | |
} | |
@Override | |
public void draw(Canvas canvas) { | |
super.draw(canvas); | |
paint.setStyle(Paint.Style.FILL); | |
canvas.drawCircle(getRootView().getWidth() / 2, getRootView().getHeight() / 2, 50, paint); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment