First explain: Canvas,Paint , Rect.
Canvas drawing has three main points (you can completely open the brain hole):
1.Canvas Canvas, just like the paper we use for drawing. The graphic is drawn on top of the canvas canvas.
2.paint brush, like a real brush, you can set the color, font, transparency and so on.
3.rect painting path for drawing different shapes such as rectangles, ellipses, etc.
This is mainly about the OnDraw in the view of the canvas parameters, as for the artboard and the like.
The parent class is often overridden in a custom control OnDraw to change the view's properties.
The OnDraw method in view source code is as follows:
protected void OnDraw (canvas canvas) { }
The OnDraw method in View.java source code is protected, which is obviously used for subclass rewrite.
The comments in the official documentation for this method are:
Implement this to do your drawing (here for drawing view)
the comments for canvas canvas are: the canvas on which the background'll be drawn (the canvas of the current view)
The summary is to draw the current view in this method and canvas for the current view
Android Canvas Drawing series (i)