summaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2015-04-29 12:25:24 +0200
committerParménides GV <parmegv@sdf.org>2015-04-29 12:26:23 +0200
commitf008b5ec8e1c74968e4a605d2de5423edf91b854 (patch)
treea6e8906aa5d09c24a48f533f6a057a84ee16265e /app/src/main/res
parent6cc1443a27a4be762e4b53deb464d15a99d698ac (diff)
Creating a user session fragment.
I've separated the user session management to it, and encapsulated ProviderAPICommand into its own class. Putting the fragment statically in dashboard.xml isn't working, Android complains about it being duplicated, so I'm going to add it dynamically.
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/layout/dashboard.xml28
-rw-r--r--app/src/main/res/layout/fragment_user_session.xml37
-rw-r--r--app/src/main/res/values-es/strings.xml2
-rw-r--r--app/src/main/res/values/strings.xml2
4 files changed, 45 insertions, 24 deletions
diff --git a/app/src/main/res/layout/dashboard.xml b/app/src/main/res/layout/dashboard.xml
index d76ccbec..30074b6a 100644
--- a/app/src/main/res/layout/dashboard.xml
+++ b/app/src/main/res/layout/dashboard.xml
@@ -18,29 +18,13 @@
android:singleLine="true"
android:text="@string/provider_label_none"
android:textAppearance="?android:attr/textAppearanceMedium" />
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <ProgressBar
- android:id="@+id/user_session_status_progress"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:indeterminate="true"
- android:visibility="gone"/>
- <TextView
- android:id="@+id/user_session_status"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textSize="18sp"
- android:layout_marginLeft="10dp"
- android:layout_marginStart="10dp"
- android:ellipsize="marquee"
- android:singleLine="true"
- android:textAppearance="?android:attr/textAppearanceMedium"
- />
- </LinearLayout>
+ <fragment android:name="se.leap.bitmaskclient.userstatus.UserSessionFragment"
+ android:id="@+id/user_session_fragment"
+ android:tag="user_session_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+
<LinearLayout
android:id="@+id/servicesCollection"
android:layout_width="match_parent"
diff --git a/app/src/main/res/layout/fragment_user_session.xml b/app/src/main/res/layout/fragment_user_session.xml
new file mode 100644
index 00000000..3b7b23c6
--- /dev/null
+++ b/app/src/main/res/layout/fragment_user_session.xml
@@ -0,0 +1,37 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ tools:context="se.leap.bitmaskclient.userstatus.UserSessionFragment">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <ProgressBar
+ android:id="@+id/user_session_status_progress"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:indeterminate="true"
+ android:visibility="gone"/>
+
+ <TextView
+ android:id="@+id/user_session_status"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="18sp"
+ android:layout_marginLeft="10dp"
+ android:layout_marginStart="10dp"
+ android:ellipsize="marquee"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ </LinearLayout>
+
+ <Button
+ android:id="@+id/user_session_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ />
+</LinearLayout>
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index acf002bc..c125b8bc 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -69,7 +69,7 @@
<string name="eip_state_connected">Conexión protegida.</string>
<string name="provider_problem">Parece que hay un problema con el proveedor.</string>
<string name="try_another_provider">Prueba con otro proveedor, o contacta con este.</string>
- <string name="default_user"></string>
+ <string name="default_user">Anónimo</string>
<string name="logged_in_user_status">inició sesión.</string>
<string name="logged_out_user_status">cerró la sesión.</string>
<string name="didnt_log_out_user_status">no cerró la sesión.</string>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 6856b713..06670aee 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -67,7 +67,7 @@
<string name="eip_state_connected">Connection Secure.</string>
<string name="provider_problem">It seems there is a problem with the provider.</string>
<string name="try_another_provider">Please try another provider, or contact yours.</string>
- <string name="default_user">You</string>
+ <string name="default_user">Anonymous</string>
<string name="logged_in_user_status">is logged in.</string>
<string name="logged_out_user_status">logged out.</string>
<string name="didnt_log_out_user_status">didn\'t log out. Try later, it may be a problem in the network or in the provider. If the problem persists, then wipe Bitmask data from the Android settings</string>