Login: add contentDescription to password reveal

Signed-off-by: Peter Vágner <pvdeejay@gmail.com>
This commit is contained in:
Peter Vágner 2019-09-28 20:59:41 +02:00 committed by Peter Vágner
parent d4be68191c
commit 53543453b3
3 changed files with 5 additions and 1 deletions

View File

@ -143,6 +143,7 @@ class LoginFragment : VectorBaseFragment() {
passwordField.showPassword(passwordShown) passwordField.showPassword(passwordShown)
passwordReveal.setImageResource(if (passwordShown) R.drawable.ic_eye_closed_black else R.drawable.ic_eye_black) passwordReveal.setImageResource(if (passwordShown) R.drawable.ic_eye_closed_black else R.drawable.ic_eye_black)
passwordReveal.setContentDescription(if (passwordShown) getString(R.string.a11y_hide_password) else getString(R.string.a11y_show_password))
} }
override fun invalidate() = withState(viewModel) { state -> override fun invalidate() = withState(viewModel) { state ->

View File

@ -87,6 +87,7 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:scaleType="center" android:scaleType="center"
android:contentDescription="@string/a11y_show_password"
android:src="@drawable/ic_eye_black" android:src="@drawable/ic_eye_black"
android:tint="?attr/colorAccent" /> android:tint="?attr/colorAccent" />

View File

@ -21,6 +21,8 @@
<string name="a11y_create_direct_message">Create a new direct conversation</string> <string name="a11y_create_direct_message">Create a new direct conversation</string>
<string name="a11y_create_room">Create a new room</string> <string name="a11y_create_room">Create a new room</string>
<string name="a11y_close_keys_backup_banner">Close keys backup banner</string> <string name="a11y_close_keys_backup_banner">Close keys backup banner</string>
<string name="a11y_show_password">Show password</string>
<string name="a11y_hide_password">Hide password</string>
<!-- Read receipts list a11y --> <!-- Read receipts list a11y -->
<string name="two_and_some_others_read">%s, %s and %d others read</string> <string name="two_and_some_others_read">%s, %s and %d others read</string>