tankery / CircularSeekBar

Custom circular SeekBar (Circle, Semi-circle, and Ellipse) for Android
Apache License 2.0
376 stars 60 forks source link

Is it possible to set the minimum value of SeekBar? #41

Closed srknskr closed 2 years ago

srknskr commented 3 years ago

I need to set the min and max values of SeekBar programmatically within the application. I can set the max value but I didn't know how to set the min value.

tankery commented 2 years ago

This not could be achieve by some small tricks without changing the library.

Say you are planing to have a SeekBar with min = 30 and max = 80. Then you could set the SeekBar with max = 50, and add an 30 offset when read the value from SeekBar.

code-n-roll commented 2 years ago

@srknskr Quick solution, not perfect because of there is movement of thumb from 0 till min. https://github.com/code-n-roll/MusicPlayer/blob/master/app/src/main/java/com/romankaranchuk/musicplayer/utils/widgets/CircularSeekBar.kt#L1062