January 2014
Intermediate to advanced
736 pages
70h 43m
English
Figure 7.38 defines an anonymous inner class that implements interface OnSeekBarChangeListener to respond to events when the user adjusts the SeekBars in the Choose Color Dialog. This was registered as the SeekBars’ event handler in Fig. 7.35 (lines 53–56). Method onProgressChanged (lines 115–123) is called when the position of a SeekBar’s thumb changes. If the user moved a SeekBar’s thumb (line 118), lines 119–121 store the new color. Class Color’s static method argb combines the SeekBars’ values into a Color and returns the appropriate color as an int. We then use class View’s setBackgroundColor method ...
Read now
Unlock full access