]> gitweb.fperrin.net Git - Dictionary.git/commitdiff
Accessibility fixes.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sun, 5 Apr 2020 19:08:43 +0000 (21:08 +0200)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sun, 5 Apr 2020 19:08:43 +0000 (21:08 +0200)
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
src/com/hughes/android/dictionary/IsoUtils.java

index 40b1f24aece45421872e6c5c59ac69b043556398..f10c0005a8f87e4dca183fa31a87ef24836664e6 100644 (file)
@@ -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"
index d5c4d436952a0461e5a1baf4983e33c9adc8fb4f..cd92832073d24ff972be3f593f553f261ca15615 100644 (file)
@@ -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;
         }