]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Move hint from TextInputEditText to TextInputLayout
authorTobias Brunner <tobias@strongswan.org>
Wed, 4 Jul 2018 09:43:40 +0000 (11:43 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 4 Jul 2018 09:52:32 +0000 (11:52 +0200)
This avoids a NullPointerException on Android 8 related to the optional
Autofill functionality.  The bug has been fixed in Android 8.1 [1] but there
is no fix for Android 8.

[1] https://issuetracker.google.com/issues/67675432

src/frontends/android/app/src/main/res/layout/profile_detail_view.xml
src/frontends/android/app/src/main/res/layout/profile_import_view.xml

index 49a918f12ed30dce0faa59e719ed1e931aafa73e..3cf0b552d427a7196c6ede0edcb7615d7425b0ca 100644 (file)
@@ -32,6 +32,7 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginTop="6dp"
+            android:hint="@string/profile_gateway_label"
             app:helper_text="@string/profile_gateway_hint" >
 
             <android.support.design.widget.TextInputEditText
@@ -39,8 +40,7 @@
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:singleLine="true"
-                android:inputType="textNoSuggestions"
-                android:hint="@string/profile_gateway_label" />
+                android:inputType="textNoSuggestions" />
 
         </org.strongswan.android.ui.widget.TextInputLayoutHelper>
 
             <org.strongswan.android.ui.widget.TextInputLayoutHelper
                 android:id="@+id/username_wrap"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content" >
+                android:layout_height="wrap_content"
+                android:hint="@string/profile_username_label" >
 
                 <android.support.design.widget.TextInputEditText
                     android:id="@+id/username"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
-                    android:inputType="textNoSuggestions"
-                    android:hint="@string/profile_username_label" />
+                    android:inputType="textNoSuggestions" />
 
             </org.strongswan.android.ui.widget.TextInputLayoutHelper>
 
@@ -89,6 +89,7 @@
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_marginTop="4dp"
+                android:hint="@string/profile_password_label"
                 app:helper_text="@string/profile_password_hint" >
 
                 <android.support.design.widget.TextInputEditText
@@ -96,8 +97,7 @@
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
-                    android:inputType="textPassword|textNoSuggestions"
-                    android:hint="@string/profile_password_label" />
+                    android:inputType="textPassword|textNoSuggestions" />
 
             </org.strongswan.android.ui.widget.TextInputLayoutHelper>
 
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginTop="8dp"
+            android:hint="@string/profile_name_label"
             app:helper_text="@string/profile_name_hint" >
 
             <MultiAutoCompleteTextView
                 android:layout_height="wrap_content"
                 android:singleLine="true"
                 android:inputType="textNoSuggestions"
-                android:completionThreshold="1"
-                android:hint="@string/profile_name_label" />
+                android:completionThreshold="1" />
 
         </org.strongswan.android.ui.widget.TextInputLayoutHelper>
 
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_marginTop="10dp"
+                android:hint="@string/profile_remote_id_label"
                 app:helper_text="@string/profile_remote_id_hint" >
 
                 <MultiAutoCompleteTextView
                     android:layout_height="wrap_content"
                     android:singleLine="true"
                     android:inputType="textNoSuggestions"
-                    android:completionThreshold="1"
-                    android:hint="@string/profile_remote_id_label" />
+                    android:completionThreshold="1" />
 
             </org.strongswan.android.ui.widget.TextInputLayoutHelper>
 
                 android:id="@+id/mtu_wrap"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:hint="@string/profile_mtu_label"
                 app:helper_text="@string/profile_mtu_hint" >
 
                 <android.support.design.widget.TextInputEditText
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
-                    android:inputType="number|textNoSuggestions"
-                    android:hint="@string/profile_mtu_label" />
+                    android:inputType="number|textNoSuggestions" />
 
             </org.strongswan.android.ui.widget.TextInputLayoutHelper>
 
                 android:id="@+id/port_wrap"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:hint="@string/profile_port_label"
                 app:helper_text="@string/profile_port_hint" >
 
                 <android.support.design.widget.TextInputEditText
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
-                    android:inputType="number|textNoSuggestions"
-                    android:hint="@string/profile_port_label" />
+                    android:inputType="number|textNoSuggestions" />
 
             </org.strongswan.android.ui.widget.TextInputLayoutHelper>
 
                 android:id="@+id/nat_keepalive_wrap"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:hint="@string/profile_nat_keepalive_label"
                 app:helper_text="@string/profile_nat_keepalive_hint" >
 
                 <android.support.design.widget.TextInputEditText
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
-                    android:inputType="number|textNoSuggestions"
-                    android:hint="@string/profile_nat_keepalive_label" />
+                    android:inputType="number|textNoSuggestions" />
 
             </org.strongswan.android.ui.widget.TextInputLayoutHelper>
 
                 android:id="@+id/included_subnets_wrap"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:hint="@string/profile_included_subnets_label"
                 app:helper_text="@string/profile_included_subnets_hint" >
 
                 <android.support.design.widget.TextInputEditText
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
-                    android:inputType="textNoSuggestions"
-                    android:hint="@string/profile_included_subnets_label" />
+                    android:inputType="textNoSuggestions" />
 
             </org.strongswan.android.ui.widget.TextInputLayoutHelper>
 
                 android:id="@+id/excluded_subnets_wrap"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:hint="@string/profile_excluded_subnets_label"
                 app:helper_text="@string/profile_excluded_subnets_hint" >
 
                 <android.support.design.widget.TextInputEditText
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
-                    android:inputType="textNoSuggestions"
-                    android:hint="@string/profile_excluded_subnets_label" />
+                    android:inputType="textNoSuggestions" />
 
             </org.strongswan.android.ui.widget.TextInputLayoutHelper>
 
                 android:id="@+id/ike_proposal_wrap"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:hint="@string/profile_proposals_ike_label"
                 app:helper_text="@string/profile_proposals_ike_hint" >
 
                 <android.support.design.widget.TextInputEditText
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
-                    android:inputType="textNoSuggestions"
-                    android:hint="@string/profile_proposals_ike_label" />
+                    android:inputType="textNoSuggestions" />
 
             </org.strongswan.android.ui.widget.TextInputLayoutHelper>
 
                 android:id="@+id/esp_proposal_wrap"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:hint="@string/profile_proposals_esp_label"
                 app:helper_text="@string/profile_proposals_esp_hint" >
 
                 <android.support.design.widget.TextInputEditText
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
-                    android:inputType="textNoSuggestions"
-                    android:hint="@string/profile_proposals_esp_label" />
+                    android:inputType="textNoSuggestions" />
 
             </org.strongswan.android.ui.widget.TextInputLayoutHelper>
 
index cabfd2944deb7f79392b3762fa9b0d9a41a222f9..8fba69f3ff67903245cf11fe016b9aff0857ea26 100644 (file)
             <org.strongswan.android.ui.widget.TextInputLayoutHelper
                 android:id="@+id/username_wrap"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content" >
+                android:layout_height="wrap_content"
+                android:hint="@string/profile_username_label" >
 
                 <android.support.design.widget.TextInputEditText
                     android:id="@+id/username"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
-                    android:inputType="textNoSuggestions"
-                    android:hint="@string/profile_username_label" />
+                    android:inputType="textNoSuggestions" />
 
             </org.strongswan.android.ui.widget.TextInputLayoutHelper>
 
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_marginTop="4dp"
+                android:hint="@string/profile_password_label"
                 app:helper_text="@string/profile_password_hint" >
 
                 <android.support.design.widget.TextInputEditText
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
-                    android:inputType="textPassword|textNoSuggestions"
-                    android:hint="@string/profile_password_label" />
+                    android:inputType="textPassword|textNoSuggestions" />
 
             </org.strongswan.android.ui.widget.TextInputLayoutHelper>