O'Reilly logo

Android™ How to Program, Second Edition by Abbey Deitel, Harvey Deitel, Paul Deitel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.8. LineWidthDialogFragment Class

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; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required