diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/se/leap/leapclient/Dashboard.java | 9 | ||||
-rw-r--r-- | src/se/leap/leapclient/Provider.java | 12 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/se/leap/leapclient/Dashboard.java b/src/se/leap/leapclient/Dashboard.java index 4cd517a9..4c9c28dd 100644 --- a/src/se/leap/leapclient/Dashboard.java +++ b/src/se/leap/leapclient/Dashboard.java @@ -56,8 +56,6 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf super.onCreate(savedInstanceState); app = this; - - setContentView(R.layout.client_dashboard); ConfigHelper.setSharedPreferences(getSharedPreferences(ConfigHelper.PREFERENCES_KEY, MODE_PRIVATE)); preferences = ConfigHelper.shared_preferences; @@ -108,7 +106,8 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf prefsEdit.remove(ConfigHelper.PROVIDER_KEY).commit(); finish(); } - }); + }) + .show(); } /** @@ -119,8 +118,10 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf provider = Provider.getInstance(); provider.init( this ); + setContentView(R.layout.client_dashboard); + providerNameTV = (TextView) findViewById(R.id.providerName); - providerNameTV.setText(provider.getName()); + providerNameTV.setText(provider.getDomain()); providerNameTV.setTextSize(28); FragmentManager fragMan = getFragmentManager(); diff --git a/src/se/leap/leapclient/Provider.java b/src/se/leap/leapclient/Provider.java index 189c3a84..72184eb0 100644 --- a/src/se/leap/leapclient/Provider.java +++ b/src/se/leap/leapclient/Provider.java @@ -36,6 +36,7 @@ public final class Provider implements Serializable { // Some API pieces we want to know about private static final String API_TERM_SERVICES = "services"; private static final String API_TERM_NAME = "name"; + private static final String API_TERM_DOMAIN = "domain"; private static final String API_TERM_DEFAULT_LANGUAGE = "default_language"; protected static final String[] API_EIP_TYPES = {"openvpn"}; @@ -79,6 +80,17 @@ public final class Provider implements Serializable { } } + protected String getDomain(){ + String domain = "Null"; + try { + domain = definition.getString(API_TERM_DOMAIN); + } catch (JSONException e) { + domain = "Null"; + e.printStackTrace(); + } + return domain; + } + protected String getName(){ // Should we pass the locale in, or query the system here? String lang = Locale.getDefault().getLanguage(); |