android: Move hint from TextInputEditText to TextInputLayout

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
This commit is contained in:
Tobias Brunner 2018-07-04 11:43:40 +02:00
parent 485d202adc
commit b2363b3678
2 changed files with 30 additions and 30 deletions

View 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>
@ -72,15 +72,15 @@
<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>
@ -161,6 +161,7 @@
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
@ -169,8 +170,7 @@
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>
@ -199,6 +199,7 @@
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
@ -207,8 +208,7 @@
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>
@ -216,6 +216,7 @@
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
@ -223,8 +224,7 @@
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>
@ -232,6 +232,7 @@
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
@ -239,8 +240,7 @@
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>
@ -248,6 +248,7 @@
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
@ -255,8 +256,7 @@
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>
@ -368,6 +368,7 @@
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
@ -375,8 +376,7 @@
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>
@ -384,6 +384,7 @@
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
@ -391,8 +392,7 @@
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>
@ -454,6 +454,7 @@
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
@ -461,8 +462,7 @@
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>
@ -470,6 +470,7 @@
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
@ -477,8 +478,7 @@
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>

View File

@ -119,15 +119,15 @@
<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>
@ -136,6 +136,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
@ -143,8 +144,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>