techery / progresshint

ProgressBar/SeekBar delegate to show floating progress with style
Apache License 2.0
374 stars 59 forks source link

Set Min Max value #6

Closed rajtrada closed 8 years ago

rajtrada commented 8 years ago

How I can set one slider with range from 100 to 900 and another with 1 to 5.

kalpesh-lakhani commented 8 years ago

I am facing same issue. anyone has the solution for the same ? Thanks in advance.

almozavr commented 8 years ago

@rajtrada do you mean floating hint value? 2 ways:

seekBar.getHintDelegate()
    .setHintAdapter(new SeekBarHintAdapter() {
      @Override public String getHint(android.widget.SeekBar seekBar, int progress) {
        return String.valueOf(progress*multiplexor);
      }
    }); 
rajtrada commented 8 years ago

@@It is not working for me because I want to set progress from 0 to 900, if I set like this I am getting each value in multiple of 9 like 0, 9, 18....900 but I want all value between 0 to 900 like 0,1,2,3...900

almozavr commented 8 years ago

Again, it's up to SeekBar to define progress rules. https://developer.android.com/reference/android/widget/ProgressBar.html#setMax(int)

rajtrada commented 8 years ago

Thanks