From: Reimar Döffinger Date: Sun, 5 Apr 2020 19:08:43 +0000 (+0200) Subject: Accessibility fixes. X-Git-Url: http://gitweb.fperrin.net/?p=Dictionary.git;a=commitdiff_plain;h=b5e4a0082cd63f741fb0f519502bdc2650dd6e43 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. --- 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; }