Kotlin Android SeekBarAndroid SeekBar is a kind of ProgressBar with a draggable thumb. The end user can drag the thumb left and right to move the progress of the song, file download etc. The SeekBar.OnSeekBarChangeListener interface provides methods to perform even handling for seek bar. We can create two types of SeekBar in Android
The discrete progress point of SeekBar is created using attribute style="@style/Widget.AppCompat.SeekBar.Discrete" and specify the maximum point using attribute max. Kotlin Android SeekBar ExampleIn this example, we will create the SeekBar with smooth progress and SeekBar with discrete progress point. activity_main.xmlAdd the SeekBar in the activity_main.xml layout. MainActivity.ktIn this class, we call the SeekBar.OnSeekBarChangeListener interface and override its methods. Output:
Next Topic#
|