diff options
author | Roshan Pius <rpius@google.com> | 2015-06-18 15:04:06 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2015-06-18 16:26:59 -0700 |
commit | fa36ce56b56eafac5dcd9908cc14b9e4de608648 (patch) | |
tree | 37c07187be6361dda89745d484284525b79b9f61 /src | |
parent | ab87b7868a110337c69f6affd0febb52995bb9c3 (diff) | |
download | android_packages_apps_PhoneCommon-fa36ce56b56eafac5dcd9908cc14b9e4de608648.tar.gz android_packages_apps_PhoneCommon-fa36ce56b56eafac5dcd9908cc14b9e4de608648.tar.bz2 android_packages_apps_PhoneCommon-fa36ce56b56eafac5dcd9908cc14b9e4de608648.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/phone/common/dialpad/DialpadView.java | 11 |
1 files changed, 10 insertions, 1 deletions
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) { |