From ad086ab192b9094278b27f94120566a7ca21dccc Mon Sep 17 00:00:00 2001 From: cyBerta Date: Fri, 23 Feb 2018 02:34:55 +0100 Subject: #8754 fix dialog cancellation handling and change dialog title --- .../leap/bitmaskclient/drawer/NavigationDrawerFragment.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'app/src/main/java/se') 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 ebe5783a..25ef9161 100644 --- a/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java @@ -290,8 +290,8 @@ public class NavigationDrawerFragment extends Fragment { AlertDialog.Builder alertBuilder = new AlertDialog.Builder(getActivity()); showEnableExperimentalFeature = true; - alertDialog = alertBuilder.setTitle(activity.getString(R.string.experimental_feature_title)) - .setMessage(activity.getString(R.string.experimental_feature_message)) + alertDialog = alertBuilder.setTitle(activity.getString(R.string.save_battery)) + .setMessage(activity.getString(R.string.save_battery_message)) .setPositiveButton((android.R.string.yes), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { @@ -311,7 +311,13 @@ public class NavigationDrawerFragment extends Fragment { public void onDismiss(DialogInterface dialog) { showEnableExperimentalFeature = false; } - }).show(); + }).setOnCancelListener(new DialogInterface.OnCancelListener() { + @Override + public void onCancel(DialogInterface dialog) { + disableSwitch(BATTERY_SAVER); + } + }) + .show(); } @Override -- cgit v1.2.3