January 2014
Intermediate to advanced
736 pages
70h 43m
English
Section 7.2 discussed the key new classes and interfaces that class DoodleFragment uses. We’ve highlighted these classes and interfaces in Fig. 7.12. DoodleView variable doodleView (line 22) represents the drawing area. The float variables declared in lines 23–25 are used to calculate changes in the device’s acceleration to determine when a shake event occurs (so we can ask whether the user would like to erase the drawing), and the constant in line 29 is used to ensure that small movements are not interpreted as shakes—we picked this constant via trial and error by shaking the app on several devices. Line 26 defines a boolean variable with the default value false that will be used throughout this ...
Read now
Unlock full access