From b5e4a0082cd63f741fb0f519502bdc2650dd6e43 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Reimar=20D=C3=B6ffinger?= Date: Sun, 5 Apr 2020 21:08:43 +0200 Subject: [PATCH] Accessibility fixes. Add content description to some flag buttons. Mark the floating buttons as not relevant, as the functionality is available otherwise, they only exist to ease touch usage. --- res/layout/dictionary_activity.xml | 2 ++ src/com/hughes/android/dictionary/IsoUtils.java | 1 + 2 files changed, 3 insertions(+) diff --git a/res/layout/dictionary_activity.xml b/res/layout/dictionary_activity.xml index 40b1f24..f10c000 100644 --- a/res/layout/dictionary_activity.xml +++ b/res/layout/dictionary_activity.xml @@ -22,6 +22,7 @@ android:id="@+id/floatSwapButton" app:fabSize="mini" app:useCompatPadding="true" + android:importantForAccessibility="no" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_width="wrap_content" @@ -33,6 +34,7 @@ android:id="@+id/floatSearchButton" app:fabSize="mini" app:useCompatPadding="true" + android:importantForAccessibility="no" android:layout_toLeftOf="@+id/floatSwapButton" android:layout_alignParentBottom="true" android:layout_width="wrap_content" diff --git a/src/com/hughes/android/dictionary/IsoUtils.java b/src/com/hughes/android/dictionary/IsoUtils.java index d5c4d43..cd92832 100644 --- a/src/com/hughes/android/dictionary/IsoUtils.java +++ b/src/com/hughes/android/dictionary/IsoUtils.java @@ -226,6 +226,7 @@ public enum IsoUtils { } else { ImageButton button = new ImageButton(context); button.setImageResource(languageResources.flagId); + button.setContentDescription(isoCodeToLocalizedLanguageName(button.getContext(), indexInfo.shortName)); button.setScaleType(ImageView.ScaleType.FIT_CENTER); result = button; } -- 2.43.0