Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package test.test;
- import android.content.Context;
- import android.graphics.Canvas;
- import android.graphics.Paint;
- import android.graphics.RectF;
- import android.view.View;
- public class Doll extends View
- {
- private final Head head;
- public Doll(Context context, Head head)
- {
- super(context);
- this.head = head;
- }
- @Override
- protected void onDraw(Canvas canvas)
- {
- super.onDraw(canvas);
- canvas.drawCircle(head.x, head.y, head.radius, head.paint);
- }
- }
- class Head
- {
- protected float x;
- protected float y;
- protected int radius;
- protected Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
- public Head(float x, float y, int radius)
- {
- paint.setColor(0xFF0077BD);
- this.x = x;
- this.y = y;
- this.radius = radius;
- }
- }
Add Comment
Please, Sign In to add comment