summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2018-02-24 14:21:21 +0100
committercyBerta <cyberta@riseup.net>2018-02-24 14:21:21 +0100
commit0ab7afb26280510f6097fe403a280a5ede3f40f7 (patch)
treef3016dcbc69f128a780567e6dd9577ffb50769b4
parent3f37c6891621d913d034409cad69cd9f8feb6675 (diff)
#8754 ignore initial onCheckedChanged callback during ui setup
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java b/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java
index 3651cd05..111c02f5 100644
--- a/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java
+++ b/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java
@@ -277,7 +277,6 @@ public class NavigationDrawerFragment extends Fragment {
private void restoreFromSavedInstance(Bundle savedInstanceState) {
if (savedInstanceState != null && savedInstanceState.containsKey(KEY_SHOW_ENABLE_EXPERIMENTAL_FEATURE)) {
- showEnableExperimentalFeature = true;
showExperimentalFeatureAlert();
}
}
@@ -373,6 +372,10 @@ public class NavigationDrawerFragment extends Fragment {
private void onSwitchItemSelected(int elementType, boolean newStateIsChecked) {
switch (elementType) {
case BATTERY_SAVER:
+ if (ConfigHelper.getSaveBattery(getContext()) == newStateIsChecked) {
+ //initial ui setup, ignore
+ return;
+ }
if (newStateIsChecked) {
showExperimentalFeatureAlert();
} else {