0

I want to draw a view like the picture above,but I'm stuck in how to draw the outline, I can only draw a circle, I cannot add two ears ,so someone can help me, I also want to draw a progress.

Rüdiger Herrmann
  • 20,512
  • 11
  • 62
  • 79

1 Answers1

1

Draw line it just

   @Override
    public void onDraw(Canvas canvas) {
            //canvas.drawLine(sx, sy, fx, fy, paint);
            canvas.drawLine(20, 0, 0, 20, paint);
    }

If you are asking how to draw an arc, then you really need to use the Path. or this code:

    canvas.drawColor(Color.CYAN);
    Paint p = new Paint();
    p.setAntiAlias(true);
    p.setColor(Color.RED);
    p.setStyle(Paint.Style.STROKE); 
    p.setStrokeWidth(5);

    RectF rectF = new RectF(50, 20, 100, 80);
    canvas.drawOval(rectF, p);
    p.setColor(Color.BLACK);
    canvas.drawArc (rectF, 90, 45, true, p);
Community
  • 1
  • 1
user2413972
  • 1,355
  • 2
  • 9
  • 25