7.1. Introduction

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.

Image

Fig. 7.1 | Doodlz app with a finished drawing.

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 SeekBars (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 SeekBars. 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.]

Image

a) Choose Color dialog

Image

b) Choose Line Width dialog

Fig. 7.2 | Choose Color and Choose Line Width dialogs for the Doodlz app.

Image

Fig. 7.3 | Doodlz app additional menu options as displayed on an Android 4.4 phone.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset