AnderWeb / discreteSeekBar

Apache License 2.0
2.11k stars 400 forks source link

How to set Interval between values in Discrete SeekBar ? #63

Closed achinverma closed 8 years ago

achinverma commented 8 years ago

Hi, i am using your library in my project and how do i set interval while moving means I have a seekbar, while moving it I want to change values from 0 to 200 on Marker(bubble). I have a TextView, where I display those values while moving the seekbar. But I don't want to have every value from that interval(0,1,2,3,4,5...), but to have 10, 20, 30...so on. So when I move the seekbar, I want to display 10,20,30,40....to 200. Can somebody give me a hint or how to do this?

ignaciogs commented 8 years ago

You can use the setNumericTransformer method:

myDiscreteSeekBar.setNumericTransformer(new DiscreteSeekBar.NumericTransformer() {
            @Override
            public int transform(int value) {
                return value * 10;
            }
        });
Hiren3535 commented 6 years ago

what if i want 0.25 intervals between values.?