Android 绘制自定义形状

Android Draw Custom Shape

我是 android 的新手,能否请您指导我如何在 android 中绘制以下形状?我将不胜感激任何帮助。谢谢

public class CustomView extends View{

   public onDraw(Canvas canvas){
     // Take paint object
      Paint fillBackgroundPaint = new Paint();
      fillBackgroundPaint.setColor(ContextCompat.getColor(context, R.color.black));

      // Draw lines and Rectangles by using the below methods on canvas
      canvas.drawLine()
      canvas.drawRect()

     }
   }