From 53543453b3ce1e79c1e3da1c9a02163a225032dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20V=C3=A1gner?= Date: Sat, 28 Sep 2019 20:59:41 +0200 Subject: [PATCH] Login: add contentDescription to password reveal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Vágner --- .../main/java/im/vector/riotx/features/login/LoginFragment.kt | 3 ++- vector/src/main/res/layout/fragment_login.xml | 1 + vector/src/main/res/values/strings_riotX.xml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/riotx/features/login/LoginFragment.kt b/vector/src/main/java/im/vector/riotx/features/login/LoginFragment.kt index 3c477c8a90..c5bc4dd9c8 100644 --- a/vector/src/main/java/im/vector/riotx/features/login/LoginFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/login/LoginFragment.kt @@ -143,6 +143,7 @@ class LoginFragment : VectorBaseFragment() { passwordField.showPassword(passwordShown) 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 -> @@ -217,4 +218,4 @@ class LoginFragment : VectorBaseFragment() { is Success -> Unit } } -} \ No newline at end of file +} diff --git a/vector/src/main/res/layout/fragment_login.xml b/vector/src/main/res/layout/fragment_login.xml index 173527f995..a3a1187a64 100644 --- a/vector/src/main/res/layout/fragment_login.xml +++ b/vector/src/main/res/layout/fragment_login.xml @@ -87,6 +87,7 @@ android:layout_marginTop="8dp" android:background="?attr/selectableItemBackground" android:scaleType="center" + android:contentDescription="@string/a11y_show_password" android:src="@drawable/ic_eye_black" android:tint="?attr/colorAccent" /> diff --git a/vector/src/main/res/values/strings_riotX.xml b/vector/src/main/res/values/strings_riotX.xml index 6ee8229c35..1ef1587c70 100644 --- a/vector/src/main/res/values/strings_riotX.xml +++ b/vector/src/main/res/values/strings_riotX.xml @@ -21,6 +21,8 @@ Create a new direct conversation Create a new room Close keys backup banner + Show password + Hide password %s, %s and %d others read