From fa36ce56b56eafac5dcd9908cc14b9e4de608648 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 18 Jun 2015 15:04:06 -0700 Subject: Add letters associated with a number to content description. Add a pause(,) alongwith the letters associated with each number in the dialpad. This would cause the letters to be announced after a pause when talkback is enabled. BUG: 20140277 Change-Id: Ib60f8c47d9bbb4a1b232d2d4a7ea894e468f14b9 --- src/com/android/phone/common/dialpad/DialpadView.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/com/android/phone/common/dialpad/DialpadView.java b/src/com/android/phone/common/dialpad/DialpadView.java index b5c3982..43bbeca 100644 --- a/src/com/android/phone/common/dialpad/DialpadView.java +++ b/src/com/android/phone/common/dialpad/DialpadView.java @@ -153,12 +153,21 @@ public class DialpadView extends LinearLayout { lettersView = (TextView) dialpadKey.findViewById(R.id.dialpad_key_letters); final String numberString; + final String numberContentDescription; if (mButtonIds[i] == R.id.pound) { numberString = resources.getString(R.string.dialpad_pound_number); + numberContentDescription = numberString; } else if (mButtonIds[i] == R.id.star) { numberString = resources.getString(R.string.dialpad_star_number); + numberContentDescription = numberString; } else { numberString = nf.format(i); + // The content description is used for announcements on key + // press when TalkBack is enabled. They contain a "," + // (to introduce a slight delay) followed by letters + // corresponding to the keys in addition to the number. + numberContentDescription = numberString + "," + + resources.getString(letterIds[i]); } final RippleDrawable rippleBackground = @@ -169,7 +178,7 @@ public class DialpadView extends LinearLayout { numberView.setText(numberString); numberView.setElegantTextHeight(false); - dialpadKey.setContentDescription(numberString); + dialpadKey.setContentDescription(numberContentDescription); dialpadKey.setBackground(rippleBackground); if (lettersView != null) { -- cgit v1.2.3