January 2014
Intermediate to advanced
736 pages
70h 43m
English
Figure 7.24 defines methods clear (lines 75–81), setDrawingColor (lines 84–87), getDrawingColor (lines 90–93), setLineWidth (lines 96–99) and getLineWidth (lines 102–105), which are called from the DoodleFragment. Method clear, which we use in the EraseImageDialogFragment, empties the pathMap and previousPointMap, erases the Bitmap by setting all of its pixels to white, then calls the inherited View method invalidate to indicate that the View needs to be redrawn. Then, the system automatically determines when the View’s onDraw method should be called. Method setDrawingColor changes the current drawing color by setting the color of the Paint object paintLine ...
Read now
Unlock full access