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
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user