January 2014
Intermediate to advanced
736 pages
70h 43m
English
Class LineWidthDialogFragment (Fig. 7.39) extends DialogFragment to create an AlertDialog for setting the line width. The class is similar to class ColorDialogFragment, so we discuss only the key differences here. The class’s only instance variable is an ImageView (line 22) in which we draw a line showing the current line-width setting.
1 // LineWidthDialogFragment.java 2 // Allows user to set the drawing color on the DoodleView 3 package com.deitel.doodlz; 4 5 import android.app.Activity; 6 import android.app.AlertDialog; 7 import android.app.Dialog; 8 import android.app.DialogFragment; 9 import android.content.DialogInterface;10 import android.graphics.Bitmap; ...
Read now
Unlock full access