Method updateCustom of Class MainActivity
Method updateCustom
(Fig. 3.14) updates the custom tip and total TextView
s based on the tip percentage the user selected with the customTipSeekBar
. Line 86 sets the percentCustomTextView
’s text to the customPercent
value formatted as a percentage. Lines 89–90 calculate the customTip
and customTotal
. Then, lines 93–94 display the amounts in currency format.
Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.