The Doodlz app (Fig. 7.1) enables you to paint by dragging one or more fingers across the screen. The app uses Android 4.4’s immersive mode so that you can draw on the entire screen—the device’s system bars and action bar toggle between displayed and hidden when you tap the screen.
The app’s options enable you to set the drawing color and line width. The Choose Color dialog (Fig. 7.2(a)) provides alpha (transparency), red, green and blue SeekBar
s (i.e., sliders) that allow you to select the ARGB color (introduced in Section 1.9). As you move each SeekBar
’s thumb, the updated color is displayed below the SeekBar
s. The Choose Line Width dialog (Fig. 7.2(b)) provides a single SeekBar
that controls the thickness of the line that you’ll draw. Additional menu items (Fig. 7.3) in the app’s options menu allow you to turn your finger into an eraser (Eraser), to clear the screen (Clear), to save the current drawing into your device’s Gallery (Save) and, on Android 4.4 devices, to print the current drawing. Depending on your device’s screen size, some or all of the app’s menu items are displayed directly on the action bar—any that do not fit are displayed in the options menu. At any point, you can shake the device to clear the entire drawing from the screen. You test-drove this app in Section 1.9, so we do not present a test drive in this chapter. Though this app works in AVDs, the capabilities are more fluid on actual devices. [Note: Due to a Gallery app bug at the time of this writing, on some devices you might need to take a picture with the device’s camera app before you’ll be able to save properly from the Doodlz app.]