I need help to create a seekbar with multiple thumbs.
Currently, I have a seekbar going from 1-100 KM. I am able to move the thumb in a fixed interval 1,2,3,4,5,6,7,8,9 etc.
I need help to move the thumb in flexible intervals etc 1,2,5,10,20,50,100.
Currently, I have the following:
seekLocation.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
txtDistanceIncrease.setText(UnitConverter.getSeekbarDistanceByType(prefUtils, progress));
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
you can try snapping your seekbar to the nearest interval when the user moves the progressbar. (e.g. 10 to 15 snaps to 10; 15 to 30 snaps to 20, etc...) kinda like the following.
then at the seekbar onProgressChanged listener