From f8c360febf6cd804e61001ccd24f46b58f6eccbb Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Fri, 21 Jun 2019 16:34:16 +0800 Subject: [PATCH] Add content description in the tutorial dialog Add content description in the message of tutorial dialog in accessibility button mode. It prevents Talkback speaking out "%s", which is not the content we want. Bug: 135497450 Test: test with TalkBack Change-Id: If7ce8a957cbb44a12124bc3436d8e32ef0f0da83 --- res/values/strings.xml | 2 +- .../accessibility/AccessibilityGestureNavigationTutorial.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index b215ef58f55..ea0f8bce388 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -4856,7 +4856,7 @@ Use new accessibility gesture - To turn this service on or off, tap the accessibility button%son the bottom of your screen.\n\nTo switch between services, touch & hold the accessibility button. + To turn this service on or off, tap the accessibility button %s on the bottom of your screen.\n\nTo switch between services, touch & hold the accessibility button. To turn this service on or off, swipe up from the bottom of the screen with two fingers.\n\nTo switch between services, swipe up with two fingers and hold. diff --git a/src/com/android/settings/accessibility/AccessibilityGestureNavigationTutorial.java b/src/com/android/settings/accessibility/AccessibilityGestureNavigationTutorial.java index e7b2b829b57..153fa192a5b 100644 --- a/src/com/android/settings/accessibility/AccessibilityGestureNavigationTutorial.java +++ b/src/com/android/settings/accessibility/AccessibilityGestureNavigationTutorial.java @@ -179,10 +179,12 @@ public class AccessibilityGestureNavigationTutorial { final int indexIconStart = messageString.indexOf("%s"); final int indexIconEnd = indexIconStart + 2; final Drawable icon = context.getDrawable(R.drawable.ic_accessibility_new); + final ImageSpan imageSpan = new ImageSpan(icon); + imageSpan.setContentDescription(""); icon.setTint(getThemeAttrColor(context, android.R.attr.textColorPrimary)); icon.setBounds(0, 0, lineHeight, lineHeight); spannableMessage.setSpan( - new ImageSpan(icon), indexIconStart, indexIconEnd, + imageSpan, indexIconStart, indexIconEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); return spannableMessage;