diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-03-15 21:28:30 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-03-15 21:28:30 +0100 |
commit | 4d5754ac5ddbe0f02f8afd8b5b9a0bae4bfc633d (patch) | |
tree | faabd510a99a684fa46db9302ec4045fd97d05ef /src/main/res/layout | |
parent | 1bfaacc66fd3ba1640a5d09a9b27a47df89bc99d (diff) |
Change ShowHidePasswordEditText to TextInputEditText.
change the input fields in the AccountActivity to use the TextInputLayout.
Diffstat (limited to '')
-rw-r--r-- | src/main/res/layout/activity_change_password.xml | 86 | ||||
-rw-r--r-- | src/main/res/layout/activity_edit_account.xml | 114 |
2 files changed, 91 insertions, 109 deletions
diff --git a/src/main/res/layout/activity_change_password.xml b/src/main/res/layout/activity_change_password.xml index 8808227e3..de1ad216d 100644 --- a/src/main/res/layout/activity_change_password.xml +++ b/src/main/res/layout/activity_change_password.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/grey200"> @@ -12,67 +13,54 @@ <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/activity_vertical_margin" android:layout_marginLeft="@dimen/activity_horizontal_margin" android:layout_marginRight="@dimen/activity_horizontal_margin" android:layout_marginTop="@dimen/activity_vertical_margin" - android:layout_marginBottom="@dimen/activity_vertical_margin" android:background="@drawable/infocard_border" - android:padding="@dimen/infocard_padding" - android:orientation="vertical"> + android:orientation="vertical" + android:padding="@dimen/infocard_padding"> - <TextView - android:id="@+id/current_password_label" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/current_password" - android:textColor="@color/black87" - android:textSize="?attr/TextSizeBody" /> - - <EditText - android:id="@+id/current_password" + <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:hint="@string/password" - android:inputType="textPassword" - android:textColor="@color/black87" - android:textColorHint="@color/black54" - android:textSize="?attr/TextSizeBody" /> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/new_password" - android:textColor="@color/black87" - android:textSize="?attr/TextSizeBody" /> + app:passwordToggleDrawable="@drawable/visibility_toggle_drawable" + app:passwordToggleEnabled="true" + app:passwordToggleTint="?attr/color_text_secondary"> - <EditText - android:id="@+id/new_password" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:hint="@string/password" - android:inputType="textPassword" - android:textColor="@color/black87" - android:textColorHint="@color/black54" - android:textSize="?attr/TextSizeBody" /> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/account_settings_confirm_password" - android:textColor="@color/black87" - android:textSize="?attr/TextSizeBody" /> + <android.support.design.widget.TextInputEditText + android:id="@+id/current_password" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_marginBottom="8dp" + android:hint="@string/current_password" + android:inputType="textPassword" + android:textColor="?attr/color_text_primary" + android:textColorHint="?attr/color_text_secondary" + android:textSize="?attr/TextSizeBody" /> + </android.support.design.widget.TextInputLayout> - <EditText - android:id="@+id/new_password_confirm" + <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/password" - android:inputType="textPassword" - android:textColor="@color/black87" - android:textColorHint="@color/black54" - android:textSize="?attr/TextSizeBody" /> + app:passwordToggleDrawable="@drawable/visibility_toggle_drawable" + app:passwordToggleEnabled="true" + app:passwordToggleTint="?attr/color_text_secondary"> + + <android.support.design.widget.TextInputEditText + android:id="@+id/new_password" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_marginBottom="8dp" + android:hint="@string/new_password" + android:inputType="textPassword" + android:textColor="?attr/color_text_primary" + android:textColorHint="?attr/color_text_secondary" + android:textSize="?attr/TextSizeBody" /> + </android.support.design.widget.TextInputLayout> </LinearLayout> </ScrollView> diff --git a/src/main/res/layout/activity_edit_account.xml b/src/main/res/layout/activity_edit_account.xml index 7b60b7a64..9b9611e99 100644 --- a/src/main/res/layout/activity_edit_account.xml +++ b/src/main/res/layout/activity_edit_account.xml @@ -51,42 +51,40 @@ android:layout_below="@+id/avater" android:orientation="vertical"> - <TextView - android:id="@+id/account_jid_label" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/account_settings_jabber_id" - android:textColor="@color/black87" - android:textSize="?attr/TextSizeBody" /> - - <AutoCompleteTextView - android:id="@+id/account_jid" + <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/account_settings_example_jabber_id" - android:inputType="textEmailAddress" - android:imeOptions="actionNext" - android:textColor="@color/black87" - android:textColorHint="@color/black54" - android:textSize="?attr/TextSizeBody" /> + android:hint="@string/account_settings_jabber_id"> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="8dp" - android:text="@string/account_settings_password" - android:textColor="@color/black87" - android:textSize="?attr/TextSizeBody" /> + <AutoCompleteTextView + android:id="@+id/account_jid" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:imeOptions="actionNext" + android:inputType="textEmailAddress" + android:textColor="?attr/color_text_primary" + android:textColorHint="?attr/color_text_secondary" + android:textSize="?attr/TextSizeBody" /> + </android.support.design.widget.TextInputLayout> - <EditText - android:id="@+id/account_password" + <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/password" - android:inputType="textPassword" - android:textColor="@color/black87" - android:textColorHint="@color/black54" - android:textSize="?attr/TextSizeBody" /> + android:id="@+id/text_input_password_toggle" + app:passwordToggleDrawable="@drawable/visibility_toggle_drawable" + app:passwordToggleEnabled="true" + app:passwordToggleTint="?attr/color_text_secondary"> + + <android.support.design.widget.TextInputEditText + android:id="@+id/account_password" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/password" + android:inputType="textPassword" + android:textColor="@color/black87" + android:textColorHint="@color/black54" + android:textSize="?attr/TextSizeBody" /> + </android.support.design.widget.TextInputLayout> <LinearLayout android:id="@+id/name_port" @@ -102,23 +100,20 @@ android:layout_weight="0.8" android:orientation="vertical"> - <TextView - android:id="@+id/textView" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/account_settings_hostname" - android:textColor="@color/black87" - android:textSize="?attr/TextSizeBody" /> - - <EditText - android:id="@+id/hostname" - android:layout_width="fill_parent" + <android.support.design.widget.TextInputLayout + android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/hostname_or_onion" - android:inputType="textNoSuggestions" - android:textColor="@color/black87" - android:textColorHint="@color/black54" - android:textSize="?attr/TextSizeBody" /> + android:hint="@string/account_settings_hostname"> + + <EditText + android:id="@+id/hostname" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:inputType="textNoSuggestions" + android:textColor="?attr/color_text_primary" + android:textColorHint="?attr/color_text_secondary" + android:textSize="?attr/TextSizeBody" /> + </android.support.design.widget.TextInputLayout> </LinearLayout> <LinearLayout @@ -127,22 +122,21 @@ android:layout_weight="0.2" android:orientation="vertical"> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/account_settings_port" - android:textColor="@color/black87" - android:textSize="?attr/TextSizeBody" /> - - <EditText - android:id="@+id/port" + <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="match_parent" - android:inputType="number" - android:maxLength="5" - android:textColor="@color/black87" - android:textColorHint="@color/black54" - android:textSize="?attr/TextSizeBody" /> + android:hint="@string/account_settings_port"> + + <EditText + android:id="@+id/port" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:inputType="number" + android:maxLength="5" + android:textColor="?attr/color_text_primary" + android:textColorHint="?attr/color_text_secondary" + android:textSize="?attr/TextSizeBody" /> + </android.support.design.widget.TextInputLayout> </LinearLayout> </LinearLayout> |