Profile dialog is now scrollable

Allows to use dialog on landscape mode on small screens

Change-Id: Ia6af8bcaced6138085e3c5f2d90111b33f51e5ed
Reviewed-by: Philippe Gorley <philippe.gorley@savoirfairelinux.com>
diff --git a/ring-android/app/src/main/java/cx/ring/navigation/RingNavigationFragment.java b/ring-android/app/src/main/java/cx/ring/navigation/RingNavigationFragment.java
index 5d0b1b9..0974ee6 100644
--- a/ring-android/app/src/main/java/cx/ring/navigation/RingNavigationFragment.java
+++ b/ring-android/app/src/main/java/cx/ring/navigation/RingNavigationFragment.java
@@ -306,12 +306,12 @@
         LayoutInflater inflater = LayoutInflater.from(getActivity());
         ViewGroup view = (ViewGroup) inflater.inflate(R.layout.dialog_profile, null);
 
-        final EditText editText = (EditText) view.findViewById(R.id.user_name);
+        final EditText editText = view.findViewById(R.id.user_name);
         editText.setText(presenter.getAlias(mSelectedAccount));
-        mProfilePhoto = (ImageView) view.findViewById(R.id.profile_photo);
+        mProfilePhoto = view.findViewById(R.id.profile_photo);
         mProfilePhoto.setImageDrawable(mUserImage.getDrawable());
 
-        ImageButton cameraView = (ImageButton) view.findViewById(R.id.camera);
+        ImageButton cameraView = view.findViewById(R.id.camera);
         cameraView.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -319,7 +319,7 @@
             }
         });
 
-        ImageButton gallery = (ImageButton) view.findViewById(R.id.gallery);
+        ImageButton gallery = view.findViewById(R.id.gallery);
         gallery.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
diff --git a/ring-android/app/src/main/res/layout/dialog_profile.xml b/ring-android/app/src/main/res/layout/dialog_profile.xml
index f495f69..a19fe9e 100644
--- a/ring-android/app/src/main/res/layout/dialog_profile.xml
+++ b/ring-android/app/src/main/res/layout/dialog_profile.xml
@@ -1,75 +1,83 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<ScrollView 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:id="@+id/profile_scrollview"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:layout_gravity="center"
-    android:orientation="vertical"
-    android:padding="20dp">
+    android:layout_height="wrap_content">
 
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center"
-        android:text="@string/profile_message_warning" />
-
-    <RelativeLayout
-        android:id="@+id/profile_container"
-        android:layout_width="150dp"
-        android:layout_height="180dp"
-        android:layout_gravity="center">
-
-        <ImageView
-            android:id="@+id/profile_photo"
-            android:layout_width="120dp"
-            android:layout_height="120dp"
-            android:layout_alignParentTop="true"
-            android:layout_centerHorizontal="true"
-            android:layout_margin="10dp"
-            android:scaleType="fitCenter"
-            tools:src="@drawable/ic_contact_picture" />
-
-        <android.support.design.widget.FloatingActionButton
-            android:id="@+id/camera"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignTop="@+id/anchor"
-            android:layout_toEndOf="@+id/anchor"
-            android:contentDescription="@string/take_a_photo"
-            app:srcCompat="@drawable/ic_photo_camera"
-            android:text="@string/take_a_photo"
-            app:backgroundTint="@color/light"
-            app:rippleColor="@android:color/white" />
-
-        <View
-            android:id="@+id/anchor"
-            android:layout_width="20dp"
-            android:layout_height="20dp"
-            android:layout_alignBottom="@+id/profile_photo"
-            android:layout_centerHorizontal="true" />
-
-        <android.support.design.widget.FloatingActionButton
-            android:id="@+id/gallery"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignTop="@+id/anchor"
-            android:layout_toStartOf="@+id/anchor"
-            android:contentDescription="@string/open_the_gallery"
-            app:srcCompat="@drawable/ic_insert_photo"
-            android:text="@string/open_the_gallery"
-            app:backgroundTint="@color/light"
-            app:rippleColor="@android:color/white" />
-
-    </RelativeLayout>
-
-    <EditText
-        android:id="@+id/user_name"
+    <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:inputType="textCapWords"
-        android:maxLines="1"
-        android:textAlignment="center"
-        android:hint="@string/profile_name_hint" />
+        android:layout_gravity="center"
+        android:orientation="vertical"
+        android:paddingBottom="10dp"
+        android:paddingEnd="20dp"
+        android:paddingStart="20dp">
 
-</LinearLayout>
\ No newline at end of file
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:paddingTop="50dp"
+            android:text="@string/profile_message_warning"
+            android:textAlignment="center" />
+
+        <RelativeLayout
+            android:id="@+id/profile_container"
+            android:layout_width="match_parent"
+            android:layout_height="180dp"
+            android:layout_gravity="center">
+
+            <ImageView
+                android:id="@+id/profile_photo"
+                android:layout_width="120dp"
+                android:layout_height="120dp"
+                android:layout_centerHorizontal="true"
+                android:layout_margin="15dp"
+                android:scaleType="fitCenter"
+                app:srcCompat="@drawable/ic_contact_picture" />
+
+            <android.support.design.widget.FloatingActionButton
+                android:id="@+id/gallery"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignTop="@+id/anchor"
+                android:layout_toStartOf="@+id/anchor"
+                android:contentDescription="@string/open_the_gallery"
+                android:text="@string/open_the_gallery"
+                app:backgroundTint="@color/light"
+                app:rippleColor="@android:color/white"
+                app:srcCompat="@drawable/ic_insert_photo" />
+
+            <View
+                android:id="@+id/anchor"
+                android:layout_width="20dp"
+                android:layout_height="20dp"
+                android:layout_alignBottom="@+id/profile_photo"
+                android:layout_centerHorizontal="true" />
+
+            <android.support.design.widget.FloatingActionButton
+                android:id="@+id/camera"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignTop="@+id/anchor"
+                android:layout_toEndOf="@+id/anchor"
+                android:contentDescription="@string/take_a_photo"
+                android:text="@string/take_a_photo"
+                app:backgroundTint="@color/light"
+                app:rippleColor="@android:color/white"
+                app:srcCompat="@drawable/ic_photo_camera" />
+
+        </RelativeLayout>
+
+        <EditText
+            android:id="@+id/user_name"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:hint="@string/profile_name_hint"
+            android:inputType="textCapWords"
+            android:maxLines="1"
+            android:textAlignment="center" />
+
+    </LinearLayout>
+</ScrollView>
\ No newline at end of file
diff --git a/ring-android/app/src/main/res/values-fr-rFR/strings.xml b/ring-android/app/src/main/res/values-fr-rFR/strings.xml
index d714827..3370783 100644
--- a/ring-android/app/src/main/res/values-fr-rFR/strings.xml
+++ b/ring-android/app/src/main/res/values-fr-rFR/strings.xml
@@ -98,7 +98,7 @@
   <string name="account_create_title">Créer un compte Ring</string>
   <string name="prompt_new_username">Saisir un nouveau nom d\'utilisateur</string>
   <string name="help_password_choose">Saisir un mot de passe sécuritaire facile à retenir pour protéger votre compte Ring</string>
-  <string name="help_password_enter">Entrer votre mot de passe pour votre compte Ring principal</string>
+  <string name="help_password_enter">Entrer votre mot de passe pour votre compte Ring principal.</string>
   <string name="help_pin_enter">Entrer votre PIN (numéro d\'identification personnel) configuré sur un autre compte Ring. Utiliser la fonction \"exporter un compte dans Ring\" pour obtenir votre numéro d\'identification personnel.</string>
   <string name="wizard_next">Suivant</string>
   <string name="wizard_back">Retour</string>