Open Winghin2517 opened 8 years ago
I have the same problem in my implementation.
I tried to use the minimum value for the XML (app:dsb_min) but without success.
I also tried that myself but doesn't help at all.
Well, I work around this problem by setting the initial values before any listener be set.
seek.setMin(min); seek.setMax(max); seek.setProgress(max); seek.setProgress(min);
I also did the same thing but i said:
discreteSeekBarRange = (DiscreteSeekBar) findViewById(R.id.discreteseekbar_range); discreteSeekBarRange.setMin(20); discreteSeekBarRange.setMax(50); discreteSeekBarRange.setProgress(sharedPreferences.getInt(getString(R.string.range_int),20));
Still doesn't work.
On Thu, Feb 25, 2016 at 8:55 PM, Samir Rolemberg notifications@github.com wrote:
Well, I work around this problem by setting the initial values before any listener be set.
seek.setMin(min); seek.setMax(max); seek.setProgress(max); seek.setProgress(min);
— Reply to this email directly or view it on GitHub https://github.com/AnderWeb/discreteSeekBar/issues/67#issuecomment-188928830 .
Try to set the progress value twice as I did. Between the maximum and minimum. And in your case try a third value to its initial value.
seek.setMin(min); seek.setMax(max); seek.setProgress(max); seek.setProgress(min); seek.setProgress(mValue);
The component has a "problem" with the initial value. If the initial value is equal to the value of the progress it does not update. If what I did was force the update after I force at minimum.
Thanks - this actually solved it for me.
discreteSeekBarRange = (DiscreteSeekBar) findViewById(R.id.discreteseekbar_range); discreteSeekBarRange.setMin(20); discreteSeekBarRange.setMax(50); discreteSeekBarRange.setProgress(50); discreteSeekBarRange.setProgress(20); discreteSeekBarRange.setProgress(sharedPreferences.getInt(getString(R.string.range_int),20));
On Sat, Feb 27, 2016 at 12:06 AM, Samir Rolemberg notifications@github.com wrote:
The component has a "problem" with the initial value. If the initial value is equal to the value of the progress it does not update. If what I did was force the update after I force at minimum.
— Reply to this email directly or view it on GitHub https://github.com/AnderWeb/discreteSeekBar/issues/67#issuecomment-189503498 .
After @Winghin2517 solution, issue still persists, need this solution from library update.
This is the setup for my discreteSeekBar.
When I navigate to the minimum value in the seekbar, it reacts correctly and displays 20.
However, when I exit my activity and come back to it, the seekbar is displaying the negative max value.
If I move the seekbar up a little, it reflects the correct value again, in my case, it reflects the value 21.
If I navigate to the min value, it displays 20 again.
I think this is a bug - I downloaded my sharedpreferences as well, the value inside there is 20.
How do I fix this?