From 9b6f5499e6d5e9efd0b7b372c28b5c71d940e785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Sun, 3 Aug 2014 05:27:24 +0200 Subject: Just a small glitch after cancelling a disconnect. I don't use the eip status receiver because it wasn't reliable on timing: updated messages were arriving before the receiver was notifying a new state. Current and last ConnectionStatus is now managed at EIP. More refactoring on the eip fragment, now there are separate methods for setting up the UI depending on the message received. --- app/src/main/java/se/leap/bitmaskclient/Dashboard.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'app/src/main/java/se/leap/bitmaskclient/Dashboard.java') diff --git a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java index 8aa09de5..851cd3c4 100644 --- a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java +++ b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java @@ -66,11 +66,12 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf final public static String ON_BOOT = "dashboard on boot"; public static final String APP_VERSION = "bitmask version"; - + + private EipServiceFragment eipFragment; private ProgressBar mProgressBar; private TextView eipStatus; private static Context app; - private static SharedPreferences preferences; + protected static SharedPreferences preferences; private static Provider provider; private TextView providerNameTV; @@ -86,9 +87,6 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf app = this; PRNGFixes.apply(); - // mProgressBar = (ProgressBar) findViewById(R.id.progressbar_dashboard); - // mProgressBar = (ProgressBar) findViewById(R.id.eipProgress); - // eipStatus = (TextView) findViewById(R.id.eipStatus); mProgressBar = (ProgressBar) findViewById(R.id.eipProgress); @@ -109,7 +107,6 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf if(lastDetectedVersion == 0) // New install getSharedPreferences(Dashboard.SHARED_PREFERENCES, MODE_PRIVATE).edit().putInt(APP_VERSION, versionCode); else if(lastDetectedVersion < versionCode) { - preferences.edit().remove(EIP.STATUS).commit(); } } catch (NameNotFoundException e) { } @@ -193,7 +190,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf FragmentManager fragMan = getFragmentManager(); if ( provider.hasEIP()){ - EipServiceFragment eipFragment = new EipServiceFragment(); + eipFragment = new EipServiceFragment(); if (hide_and_turn_on_eip) { getSharedPreferences(Dashboard.SHARED_PREFERENCES, MODE_PRIVATE).edit().remove(Dashboard.START_ON_BOOT).commit(); Bundle arguments = new Bundle(); @@ -596,10 +593,4 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf mProgressBar = (ProgressBar) findViewById(R.id.eipProgress); mProgressBar.setVisibility(visibility); } - - protected void setEipStatus(int status) { - if(eipStatus == null) - eipStatus = (TextView) findViewById(R.id.eipStatus); - eipStatus.setText(status); - } } -- cgit v1.2.3