forked from extern/Unexpected-Keyboard
Correct displayed value when cancelling settings modification
When changing any numeric setting and cancelling this change, the change would not be persisted, but the summary in the setting screen would show the last position of the slider instead of the correct unchanged value. This commit fixes this on the most simple way by resetting the slider position to the persisted value.
This commit is contained in:
parent
a516246e52
commit
47f9043096
@ -95,6 +95,10 @@ public class IntSlideBarPreference extends DialogPreference
|
||||
{
|
||||
if (positiveResult)
|
||||
persistInt(_seekBar.getProgress() + _min);
|
||||
else
|
||||
_seekBar.setProgress(getPersistedInt(_min) - _min);
|
||||
|
||||
updateText();
|
||||
}
|
||||
|
||||
protected View onCreateDialogView()
|
||||
|
@ -99,6 +99,10 @@ public class SlideBarPreference extends DialogPreference
|
||||
{
|
||||
if (positiveResult)
|
||||
persistFloat(_value);
|
||||
else
|
||||
_seekBar.setProgress((int)((getPersistedFloat(_min) - _min) * STEPS / (_max - _min)));
|
||||
|
||||
updateText();
|
||||
}
|
||||
|
||||
protected View onCreateDialogView()
|
||||
|
Loading…
Reference in New Issue
Block a user