CustomSeekBar: fix progressbar glitch with custom min-max values
when CustomSeekBar is called, it does: mSeekBar.setMax(mMax - mMin); assuming mMin=0 and mMax=100 if they are not set with settings:min or max through the related menu xml. So if we set one of those values in the related menu java class with the available public voids (setMax(value) and setMin(value)) the seekbar doesn't get the new min and max thus the user can't slide it to the max position. To reply: - set settings:max (or android:max according to your customseekbar implementation) to the wanted value, e.g. 255; - set the min value through your menu java class with CustomSeekBarPreference.setMin(value); - try to move the progressbar thumb to the max position, it won't reach it. Signed-off-by: xyyx <xyyx@mail.ru>
This commit is contained in:
@@ -139,10 +139,12 @@ public class CustomSeekBarPreference extends Preference implements SeekBar.OnSee
|
||||
|
||||
public void setMax(int max) {
|
||||
mMax = max;
|
||||
mSeekBar.setMax(mMax - mMin);
|
||||
}
|
||||
|
||||
public void setMin(int min) {
|
||||
mMin = min;
|
||||
mSeekBar.setMax(mMax - mMin);
|
||||
}
|
||||
|
||||
public void setIntervalValue(int value) {
|
||||
|
||||
Reference in New Issue
Block a user