account: add ring account status in settings

The account status and toggle should be in the setting screen.
It makes more sense for the user to go in the account to disable it.

Change-Id: I4633eb1a96f9aae6bc03335897e6ef4e5f2fa30a
Tuleap: #1218
diff --git a/ring-android/app/src/main/res/drawable/static_rounded_background.xml b/ring-android/app/src/main/res/drawable/static_rounded_background.xml
new file mode 100644
index 0000000..82bbb14
--- /dev/null
+++ b/ring-android/app/src/main/res/drawable/static_rounded_background.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <stroke
+        android:width="0dp"
+        android:color="@android:color/transparent" />
+
+    <padding
+        android:bottom="5dp"
+        android:left="5dp"
+        android:right="5dp"
+        android:top="5dp" />
+
+    <corners android:radius="5dp" />
+
+</shape>
\ No newline at end of file
diff --git a/ring-android/app/src/main/res/layout/frag_device_list.xml b/ring-android/app/src/main/res/layout/frag_device_list.xml
index 3417505..43473ed 100644
--- a/ring-android/app/src/main/res/layout/frag_device_list.xml
+++ b/ring-android/app/src/main/res/layout/frag_device_list.xml
@@ -16,41 +16,75 @@
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
-
     <cx.ring.views.BoundedScrollView
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_gravity="center_horizontal"
-        app:bounded_width="360dp">
+        android:layout_marginBottom="50dp"
+        android:layout_gravity="center_horizontal">
 
-        <android.support.v7.widget.CardView
+        <RelativeLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginBottom="16dp"
-            android:layout_marginEnd="8dp"
-            android:layout_marginStart="8dp"
-            android:layout_marginTop="16dp">
+            android:layout_height="match_parent"
+            android:orientation="vertical">
+
+            <RelativeLayout
+                android:id="@+id/ring_account_status_container"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:paddingBottom="8dp"
+                android:paddingEnd="16dp"
+                android:paddingStart="16dp"
+                android:paddingTop="24dp">
+
+                <TextView
+                    android:id="@+id/account_alias_txt"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toLeftOf="@+id/account_switch"
+                    android:layout_toStartOf="@+id/account_switch"
+                    android:paddingBottom="8dp"
+                    android:textAppearance="@style/Base.TextAppearance.AppCompat.Large"
+                    tools:text="@string/ring_account" />
+
+                <TextView
+                    android:id="@+id/account_status"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_below="@id/account_alias_txt"
+                    android:textStyle="bold"
+                    android:textAppearance="@style/Base.TextAppearance.AppCompat.Small.Inverse"
+                    android:textColor="@color/white"
+                    tools:text="Registered" />
+
+
+                <android.support.v7.widget.SwitchCompat
+                    android:id="@+id/account_switch"
+                    android:layout_width="50dp"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentEnd="true"
+                    android:layout_alignParentRight="true" />
+
+            </RelativeLayout>
 
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
-                android:orientation="vertical">
+                android:layout_below="@+id/ring_account_status_container"
+                android:orientation="vertical"
+                android:paddingBottom="8dp"
+                android:paddingEnd="16dp"
+                android:paddingStart="16dp"
+                android:paddingTop="24dp">
 
                 <TextView
-                    android:id="@+id/account_alias_txt"
+                    android:id="@+id/account_identity_label"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_weight="1"
-                    android:paddingBottom="8dp"
-                    android:paddingEnd="16dp"
-                    android:paddingStart="16dp"
-                    android:paddingTop="24dp"
-                    android:text="@string/ring_account"
+                    android:text="@string/ring_account_identity"
                     android:textAppearance="@style/Base.TextAppearance.AppCompat.Large" />
 
                 <TextView
@@ -58,13 +92,14 @@
                     style="@style/Subheader"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:ellipsize="middle"
+                    android:ellipsize="end"
                     android:gravity="center_vertical"
                     android:lines="1"
                     android:paddingBottom="8dp"
                     android:paddingLeft="16dp"
                     android:paddingRight="16dp"
-                    android:paddingTop="4dp"
+                    android:paddingTop="8dp"
+                    android:textStyle="bold"
                     android:textIsSelectable="false"
                     tools:text="ring:8F29045378ACA68F2ACA2346078ACA68F2ACA290" />
 
@@ -84,7 +119,8 @@
                         android:gravity="center_vertical"
                         android:paddingBottom="8dp"
                         android:paddingTop="8dp"
-                        android:text="@string/no_registered_name_for_account" />
+                        android:text="@string/no_registered_name_for_account"
+                        android:textAlignment="center" />
 
                     <Button
                         android:id="@+id/register_name_btn"
@@ -154,6 +190,7 @@
                         android:paddingTop="4dp"
                         android:textAlignment="viewStart"
                         tools:text="blockchain_name" />
+
                 </LinearLayout>
 
                 <TextView
@@ -200,7 +237,7 @@
                 </FrameLayout>
 
             </LinearLayout>
-        </android.support.v7.widget.CardView>
+        </RelativeLayout>
     </cx.ring.views.BoundedScrollView>
 
     <include
diff --git a/ring-android/app/src/main/res/values/colors.xml b/ring-android/app/src/main/res/values/colors.xml
index 34bfb4d..ccaaf7a 100644
--- a/ring-android/app/src/main/res/values/colors.xml
+++ b/ring-android/app/src/main/res/values/colors.xml
@@ -22,16 +22,25 @@
     <color name="transparent_light">#AAFFFFFF</color>
 
     <!-- A light Holo shade of blue -->
+    <color name="holo_blue_light">#ff33b5e5</color>
     <!-- A light Holo shade of green -->
+    <color name="holo_green_light">#ff99cc00</color>
     <!-- A light Holo shade of red -->
     <color name="holo_red_light">#ffff4444</color>
     <!-- A dark Holo shade of blue -->
+    <color name="holo_blue_dark">#ff0099cc</color>
     <!-- A dark Holo shade of green -->
+    <color name="holo_green_dark">#ff669900</color>
     <!-- A dark Holo shade of red -->
+    <color name="holo_red_dark">#ffcc0000</color>
     <!-- A Holo shade of purple -->
+    <color name="holo_purple">#ffaa66cc</color>
     <!-- A light Holo shade of orange -->
+    <color name="holo_orange_light">#ffffbb33</color>
     <!-- A dark Holo shade of orange -->
+    <color name="holo_orange_dark">#ffff8800</color>
     <!-- A really bright Holo shade of blue -->
+    <color name="holo_blue_bright">#ff00ddff</color>
 
     <color name="transparent_grey">#AACCCCCC</color>
 
diff --git a/ring-android/app/src/main/res/values/strings_account.xml b/ring-android/app/src/main/res/values/strings_account.xml
index 2f05858..0f5ac8d 100644
--- a/ring-android/app/src/main/res/values/strings_account.xml
+++ b/ring-android/app/src/main/res/values/strings_account.xml
@@ -156,6 +156,7 @@
     <string name="update_account">Update account</string>
     <string name="account_migration">Your Ring account can now be shared between all your devices. All you need to do is provide a password.</string>
     <string name="ring_account">Ring account</string>
+    <string name="ring_account_identity">Identity</string>
     <string name="account_migration_title_dialog">Account migration</string>
     <string name="account_migration_message_dialog">In order to be usable on multiple devices, your accounts need to be updated. Do you want to go the Account management screen to perform this operation ?</string>
     <string name="account_update_needed">Update needed</string>
@@ -194,5 +195,10 @@
     <string name="username_already_taken">Username already taken</string>
     <string name="invalid_username">Invalid username</string>
     <string name="looking_for_username_availability">Looking for username availability ...</string>
+    <string name="account_status_connecting">Connecting</string>
+    <string name="account_status_connection_error">Connection error</string>
+    <string name="account_status_online">Online</string>
+    <string name="account_status_unknown">Unknown</string>
+    <string name="account_status_offline">Offline</string>
 
 </resources>