diff options
author | Parménides GV <parmegv@sdf.org> | 2013-07-20 10:55:50 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2013-07-20 10:55:50 +0200 |
commit | a5928718b99e207ceb8dbce4609662ecef1a26cf (patch) | |
tree | ecb52c38518a83faa03c2708a0e8f22bae57b87d | |
parent | 3d652a20b5c28b0a424d516161034b23b2523d95 (diff) | |
parent | 5edc2af535d177edaeda97523a04c6f73fad26a4 (diff) |
Merge branch 'feature/dashboard-ux' into develop
-rw-r--r-- | res/layout/eip_service_fragment.xml | 15 | ||||
-rwxr-xr-x | res/values/strings.xml | 3 | ||||
-rw-r--r-- | src/se/leap/leapclient/Dashboard.java | 9 | ||||
-rw-r--r-- | src/se/leap/leapclient/Provider.java | 12 |
4 files changed, 19 insertions, 20 deletions
diff --git a/res/layout/eip_service_fragment.xml b/res/layout/eip_service_fragment.xml index 885c78a..e67f565 100644 --- a/res/layout/eip_service_fragment.xml +++ b/res/layout/eip_service_fragment.xml @@ -15,19 +15,6 @@ android:clickable="true" android:text="@string/eip_service_label" android:textAppearance="?android:attr/textAppearanceLarge" /> - - <TextView - android:id="@+id/eipType" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignBaseline="@+id/eipLabel" - android:layout_marginLeft="10dp" - android:layout_marginBottom="10dp" - android:layout_toRightOf="@+id/eipLabel" - android:clickable="true" - android:onClick="toggleEipOverview" - android:text="@string/eip_type_active" - android:textAppearance="?android:attr/textAppearanceMedium" /> <Switch android:id="@+id/eipSwitch" @@ -54,7 +41,7 @@ android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" - android:layout_below="@+id/eipType" + android:layout_below="@+id/eipLabel" android:paddingBottom="10dp" android:paddingLeft="10dp" android:paddingRight="10dp" diff --git a/res/values/strings.xml b/res/values/strings.xml index cef7de1..532d237 100755 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -261,8 +261,7 @@ <string name="provider_label_none">No provider configured</string> <string name="eip_settings_button_description">Access EIP connection settings</string> <string name="eip_status">Status unknown</string> - <string name="eip_service_label">EIP:</string> - <string name="eip_type_active">EIP</string> + <string name="eip_service_label">Encrypted Internet</string> <string name="title_activity_configuration_wizard">Configure LEAP</string> <string name="new_provider_button">Select new Provider</string> <string name="introduce_new_provider">Introduce new provider</string> diff --git a/src/se/leap/leapclient/Dashboard.java b/src/se/leap/leapclient/Dashboard.java index 4cd517a..4c9c28d 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 189c3a8..72184eb 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(); |