diff options
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/drawer')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java | 19 |
1 files changed, 11 insertions, 8 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 be4bdf99..6e9879dd 100644 --- a/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java @@ -50,7 +50,7 @@ import android.widget.ArrayAdapter; import android.widget.CompoundButton; import android.widget.ListView; -import se.leap.bitmaskclient.ConfigHelper; +import se.leap.bitmaskclient.utils.ConfigHelper; import se.leap.bitmaskclient.DrawerSettingsAdapter; import se.leap.bitmaskclient.DrawerSettingsAdapter.DrawerSettingsItem; import se.leap.bitmaskclient.EipFragment; @@ -64,8 +64,6 @@ import se.leap.bitmaskclient.fragments.LogFragment; import static android.content.Context.MODE_PRIVATE; import static se.leap.bitmaskclient.BitmaskApp.getRefWatcher; -import static se.leap.bitmaskclient.ConfigHelper.getSaveBattery; -import static se.leap.bitmaskclient.ConfigHelper.getShowAlwaysOnDialog; import static se.leap.bitmaskclient.Constants.PROVIDER_KEY; import static se.leap.bitmaskclient.Constants.REQUEST_CODE_SWITCH_PROVIDER; import static se.leap.bitmaskclient.Constants.SHARED_PREFERENCES; @@ -82,6 +80,11 @@ import static se.leap.bitmaskclient.DrawerSettingsAdapter.SWITCH_PROVIDER; import static se.leap.bitmaskclient.R.string.about_fragment_title; import static se.leap.bitmaskclient.R.string.log_fragment_title; import static se.leap.bitmaskclient.R.string.switch_provider_menu_option; +import static se.leap.bitmaskclient.utils.PreferenceHelper.getProviderName; +import static se.leap.bitmaskclient.utils.PreferenceHelper.getSaveBattery; +import static se.leap.bitmaskclient.utils.PreferenceHelper.getSavedProviderFromSharedPreferences; +import static se.leap.bitmaskclient.utils.PreferenceHelper.getShowAlwaysOnDialog; +import static se.leap.bitmaskclient.utils.PreferenceHelper.saveBattery; import static se.leap.bitmaskclient.R.string.donate_title; /** @@ -383,7 +386,7 @@ public class NavigationDrawerFragment extends Fragment { DrawerSettingsItem item = settingsListAdapter.getDrawerItem(BATTERY_SAVER); item.setChecked(true); settingsListAdapter.notifyDataSetChanged(); - ConfigHelper.saveBattery(getContext(), item.isChecked()); + saveBattery(getContext(), item.isChecked()); } }) .setNegativeButton(activity.getString(android.R.string.no), new DialogInterface.OnClickListener() { @@ -467,14 +470,14 @@ public class NavigationDrawerFragment extends Fragment { private void onSwitchItemSelected(int elementType, boolean newStateIsChecked) { switch (elementType) { case BATTERY_SAVER: - if (ConfigHelper.getSaveBattery(getContext()) == newStateIsChecked) { + if (getSaveBattery(getContext()) == newStateIsChecked) { //initial ui setup, ignore return; } if (newStateIsChecked) { showExperimentalFeatureAlert(); } else { - ConfigHelper.saveBattery(this.getContext(), false); + saveBattery(this.getContext(), false); disableSwitch(BATTERY_SAVER); } break; @@ -500,7 +503,7 @@ public class NavigationDrawerFragment extends Fragment { fragment = new EipFragment(); fragmentTag = EipFragment.TAG; Bundle arguments = new Bundle(); - Provider currentProvider = ConfigHelper.getSavedProviderFromSharedPreferences(preferences); + Provider currentProvider = getSavedProviderFromSharedPreferences(preferences); arguments.putParcelable(PROVIDER_KEY, currentProvider); fragment.setArguments(arguments); } else { @@ -562,7 +565,7 @@ public class NavigationDrawerFragment extends Fragment { private void refreshAccountListAdapter() { accountListAdapter.clear(); - String providerName = ConfigHelper.getProviderName(preferences); + String providerName = getProviderName(preferences); if (providerName == null) { //TODO: ADD A header to the ListView containing a useful message. //TODO 2: disable switchProvider |