Last active
July 23, 2020 17:33
-
-
Save TheDancerCodes/6cafca8291e24b717c3a6d5607001c5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tipSeekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { | |
override fun onProgressChanged(p0: SeekBar?, progress: Int, p2: Boolean) { | |
// 2. Print out the int value of progress that is coming through. | |
Log.i(TAG, "onProgressChanged $progress") | |
// 3. Update value of the tip as we interact with the SeekBar | |
// Kotlin - replace this with the actual integer progress and append % | |
// Convert the progress value to a string and concatenate a % symbol after the value | |
tvTipPercent.text = "$progress%" | |
// 9. Call method for SeekBar functionality to work | |
computeTipAndTotal() | |
} | |
override fun onStartTrackingTouch(p0: SeekBar?) {} | |
override fun onStopTrackingTouch(p0: SeekBar?) {} | |
}) | |
override fun onStopTrackingTouch(p0: SeekBar?) {} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment