From 7da04dc635505c0bcfdcc2c86d186a7a6f0535f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 9 Dec 2014 12:08:40 +0100 Subject: Release flavor updated, back button works. --- .../se/leap/bitmaskclient/ConfigurationWizard.java | 27 ++++++++-------------- 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'app/src/debug') diff --git a/app/src/debug/java/se/leap/bitmaskclient/ConfigurationWizard.java b/app/src/debug/java/se/leap/bitmaskclient/ConfigurationWizard.java index dfca91ba..20545473 100644 --- a/app/src/debug/java/se/leap/bitmaskclient/ConfigurationWizard.java +++ b/app/src/debug/java/se/leap/bitmaskclient/ConfigurationWizard.java @@ -258,9 +258,10 @@ implements NewProviderDialogInterface, ProviderDetailFragmentInterface, Download @Override public void onBackPressed() { if(setting_up_provider) { - stopSettingUpProvider(); + stopSettingUpProvider(); } else { - usualBackButton(); + askDashboardToQuitApp(); + super.onBackPressed(); } } @@ -270,18 +271,13 @@ implements NewProviderDialogInterface, ProviderDetailFragmentInterface, Download mProgressBar.setProgress(0); progressbar_description.setVisibility(TextView.GONE); - preferences.edit().remove(Provider.KEY).apply(); - setting_up_provider = false; - showAllProviders(); + cancelSettingUpProvider(); } - - private void usualBackButton() { - if(preferences.getString(Provider.KEY, "").isEmpty()) { - askDashboardToQuitApp(); - } else { - setResult(RESULT_OK); - } - super.onBackPressed(); + + public void cancelSettingUpProvider() { + showAllProviders(); + setting_up_provider = false; + preferences.edit().remove(Provider.KEY).remove(ProviderItem.DANGER_ON).remove(Constants.ALLOWED_ANON).remove(Constants.KEY).commit(); } private void askDashboardToQuitApp() { @@ -457,11 +453,6 @@ n * @param provider_main_url public void showAllProviders() { adapter.showAllProviders(); } - - public void cancelSettingUpProvider() { - showAllProviders(); - preferences.edit().remove(Provider.KEY).remove(ProviderItem.DANGER_ON).remove(Constants.ALLOWED_ANON).remove(Constants.KEY).apply(); - } @Override public void login() { -- cgit v1.2.3