use TextInputLayout-s in the profile editor
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 19 Jan 2019 19:35:54 +0000 (19:35 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 19 Jan 2019 19:35:54 +0000 (19:35 +0000)
app/src/main/res/layout/profile_detail.xml

index 952d7a6..dfecf9d 100644 (file)
     android:textIsSelectable="true"
     tools:context=".ui.profiles.ProfileDetailFragment">
 
-    <LinearLayout
+    <android.support.design.widget.TextInputLayout
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginBottom="16dp"
-        android:orientation="vertical">
-
-        <TextView
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/profile_name_label" />
+        android:layout_height="wrap_content">
 
-        <EditText
+        <android.support.design.widget.TextInputEditText
             android:id="@+id/profile_name"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:ems="10"
+            android:hint="@string/profile_name_label"
             android:inputType="textPersonName"
             android:text="Name"
             tools:ignore="HardcodedText" />
-    </LinearLayout>
+    </android.support.design.widget.TextInputLayout>
 
-    <LinearLayout
+    <android.support.design.widget.TextInputLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginBottom="16dp"
         android:orientation="vertical">
 
-        <TextView
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/url_label" />
-
-        <EditText
+        <android.support.design.widget.TextInputEditText
             android:id="@+id/url"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:ems="10"
+            android:hint="@string/url_label"
             android:inputType="textUri"
             android:text="@string/pref_default_backend_url" />
-    </LinearLayout>
+    </android.support.design.widget.TextInputLayout>
 
     <LinearLayout
         android:layout_width="match_parent"
             android:orientation="vertical"
             android:paddingStart="8dp">
 
-            <LinearLayout
+            <android.support.design.widget.TextInputLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_marginBottom="16dp"
                 android:orientation="vertical">
 
-                <TextView
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:text="@string/pref_title_backend_auth_user" />
-
-                <EditText
+                <android.support.design.widget.TextInputEditText
                     android:id="@+id/auth_user_name"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:ems="10"
+                    android:hint="@string/pref_title_backend_auth_user"
                     android:inputType="textPersonName"
                     android:text="Name" />
-            </LinearLayout>
+            </android.support.design.widget.TextInputLayout>
 
-            <LinearLayout
+            <android.support.design.widget.TextInputLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:orientation="vertical">
 
-                <TextView
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:text="@string/pref_title_backend_auth_password" />
-
-                <EditText
+                <android.support.design.widget.TextInputEditText
                     android:id="@+id/password"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:ems="10"
+                    android:hint="@string/pref_title_backend_auth_password"
                     android:inputType="textPassword" />
 
-            </LinearLayout>
+            </android.support.design.widget.TextInputLayout>
         </LinearLayout>