diff options
| author | ArenaL5 | 2022-03-20 13:33:58 +0000 |
|---|---|---|
| committer | Jules Aguillon | 2022-03-21 00:39:40 +0100 |
| commit | 47f9043096c245fa56aaa9afd13034cf8f52d1f4 (patch) | |
| tree | 76d3136633b9bc3c1cac4bfc4b9a3b6e1a150cdd /srcs/juloo.common/SlideBarPreference.java | |
| parent | a516246e52e5830f4b7a94691fe02108e6523943 (diff) | |
| download | unexpected-keyboard-47f9043096c245fa56aaa9afd13034cf8f52d1f4.tar.gz unexpected-keyboard-47f9043096c245fa56aaa9afd13034cf8f52d1f4.zip | |
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.
Diffstat (limited to 'srcs/juloo.common/SlideBarPreference.java')
| -rw-r--r-- | srcs/juloo.common/SlideBarPreference.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/srcs/juloo.common/SlideBarPreference.java b/srcs/juloo.common/SlideBarPreference.java index 99759de..b41448b 100644 --- a/srcs/juloo.common/SlideBarPreference.java +++ b/srcs/juloo.common/SlideBarPreference.java @@ -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() |
