April 2019
Beginner to intermediate
698 pages
15h 15m
English
Let's take a look at the code and the different stages that are required to get drawing, then we can quickly move on to drawing something, for real, with the Canvas demo app.
The first step is to turn the classes that we need into usable instances.
First, we declare all the instances that we require. We can't initialize the instances right away, but we can make sure that we initialize them before they are used, so we use lateinit in the same way we did in the Animation demo app:
// Here are all the objects(instances) // of classes that we need to do some drawing lateinit var myImageView: ImageView lateinit var myBlankBitmap: Bitmap lateinit var myCanvas: Canvas lateinit var myPaint: ...
Read now
Unlock full access