DoodleView static and Instance Variables
Class DoodleView
’s static
and instance variables (Fig. 7.21, lines 30–43) are used to manage the data for the set of lines that the user is currently drawing and to draw those lines. Line 38 creates the pathMap
, which maps each finger ID (known as a pointer) to a corresponding Path
object for the lines currently being drawn. Lines 39–40 create the previousPointMap
, which maintains the last point for each finger—as each finger moves, we draw a line from its current point to its previous point. We discuss the other fields as we use them in class DoodleView
.
26 // the main screen that is painted27 public class DoodleView extends View28 {29 // used to determine whether ...
Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.