diff options
author | Jim Miller <jaggies@google.com> | 2013-09-24 15:54:04 -0700 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2013-09-24 15:54:04 -0700 |
commit | e38c8e28ba50d5fe7f4f2bc5fe68a9f10bafe0f0 (patch) | |
tree | 43951a104d7f5f5808dbfc8719d5b9be3b4581be /packages/Keyguard | |
parent | 5f86b90b8a224e21db89bacf78d4bd4d3f44342d (diff) | |
download | frameworks_base-e38c8e28ba50d5fe7f4f2bc5fe68a9f10bafe0f0.zip frameworks_base-e38c8e28ba50d5fe7f4f2bc5fe68a9f10bafe0f0.tar.gz frameworks_base-e38c8e28ba50d5fe7f4f2bc5fe68a9f10bafe0f0.tar.bz2 |
Fix accessibility for all-caps items in keyguard
This fixes a bug where TTS on all-caps items doesn't work for
Buttons. The fix is to use translation (ala. TextView.setAllCaps()),
which just affects rendering and not the original text string.
Fix bug 10912259
Change-Id: Id8cba927819c979fe699353219d45f8b0f9f5aac
Diffstat (limited to 'packages/Keyguard')
7 files changed, 15 insertions, 20 deletions
diff --git a/packages/Keyguard/res/layout-land/keyguard_status_area.xml b/packages/Keyguard/res/layout-land/keyguard_status_area.xml index 51ee740..d450c5c 100644 --- a/packages/Keyguard/res/layout-land/keyguard_status_area.xml +++ b/packages/Keyguard/res/layout-land/keyguard_status_area.xml @@ -37,6 +37,7 @@ android:ellipsize="marquee" android:textAppearance="?android:attr/textAppearanceMedium" android:textSize="@dimen/kg_status_date_font_size" + android:textAllCaps="@bool/kg_use_all_caps" /> <TextView @@ -51,6 +52,7 @@ android:textAppearance="?android:attr/textAppearance" android:textSize="@dimen/kg_status_line_font_size" android:drawablePadding="4dip" + android:textAllCaps="@bool/kg_use_all_caps" /> </LinearLayout>
\ No newline at end of file diff --git a/packages/Keyguard/res/layout-port/keyguard_status_area.xml b/packages/Keyguard/res/layout-port/keyguard_status_area.xml index d274457..af0d2e8 100644 --- a/packages/Keyguard/res/layout-port/keyguard_status_area.xml +++ b/packages/Keyguard/res/layout-port/keyguard_status_area.xml @@ -41,6 +41,7 @@ android:ellipsize="marquee" android:textAppearance="?android:attr/textAppearanceMedium" android:textSize="@dimen/kg_status_date_font_size" + android:textAllCaps="@bool/kg_use_all_caps" /> <TextView @@ -53,6 +54,7 @@ android:textAppearance="?android:attr/textAppearance" android:textSize="@dimen/kg_status_line_font_size" android:drawablePadding="4dip" + android:textAllCaps="@bool/kg_use_all_caps" /> </LinearLayout> diff --git a/packages/Keyguard/res/layout/keyguard_emergency_carrier_area.xml b/packages/Keyguard/res/layout/keyguard_emergency_carrier_area.xml index de673ec..313fe9f 100644 --- a/packages/Keyguard/res/layout/keyguard_emergency_carrier_area.xml +++ b/packages/Keyguard/res/layout/keyguard_emergency_carrier_area.xml @@ -36,7 +36,8 @@ android:ellipsize="marquee" android:textAppearance="?android:attr/textAppearanceMedium" android:textSize="@dimen/kg_status_line_font_size" - android:textColor="?android:attr/textColorSecondary"/> + android:textColor="?android:attr/textColorSecondary" + android:textAllCaps="@bool/kg_use_all_caps" /> <LinearLayout android:layout_width="match_parent" @@ -58,7 +59,8 @@ android:textAppearance="?android:attr/textAppearanceMedium" android:textSize="@dimen/kg_status_line_font_size" android:textColor="?android:attr/textColorSecondary" - android:drawablePadding="8dip" /> + android:drawablePadding="8dip" + android:textAllCaps="@bool/kg_use_all_caps" /> <Button android:id="@+id/forgot_password_button" android:layout_width="0dip" @@ -70,7 +72,8 @@ android:textColor="?android:attr/textColorSecondary" android:textAppearance="?android:attr/textAppearanceMedium" android:drawablePadding="8dip" - android:visibility="gone"/> + android:visibility="gone" + android:textAllCaps="@bool/kg_use_all_caps" /> </LinearLayout> </com.android.keyguard.EmergencyCarrierArea> diff --git a/packages/Keyguard/res/values/bools.xml b/packages/Keyguard/res/values/bools.xml index a9f69e5..5e842d7 100644 --- a/packages/Keyguard/res/values/bools.xml +++ b/packages/Keyguard/res/values/bools.xml @@ -19,4 +19,5 @@ <bool name="kg_center_small_widgets_vertically">false</bool> <bool name="kg_top_align_page_shrink_on_bouncer_visible">true</bool> <bool name="kg_show_ime_at_screen_on">true</bool> + <bool name="kg_use_all_caps">true</bool> </resources> diff --git a/packages/Keyguard/src/com/android/keyguard/CarrierText.java b/packages/Keyguard/src/com/android/keyguard/CarrierText.java index 9f0a042..03b09b1 100644 --- a/packages/Keyguard/src/com/android/keyguard/CarrierText.java +++ b/packages/Keyguard/src/com/android/keyguard/CarrierText.java @@ -72,12 +72,7 @@ public class CarrierText extends TextView { } protected void updateCarrierText(State simState, CharSequence plmn, CharSequence spn) { - CharSequence text = getCarrierTextForSimState(simState, plmn, spn); - if (KeyguardViewManager.USE_UPPER_CASE) { - setText(text != null ? text.toString().toUpperCase() : null); - } else { - setText(text); - } + setText(getCarrierTextForSimState(simState, plmn, spn)); } @Override diff --git a/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java b/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java index 8cdcb7a..fd56613 100644 --- a/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java +++ b/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java @@ -127,8 +127,7 @@ public class EmergencyButton extends Button { enabled = mLockPatternUtils.isSecure(); } } - mLockPatternUtils.updateEmergencyCallButtonState(this, phoneState, enabled, - KeyguardViewManager.USE_UPPER_CASE, false); + mLockPatternUtils.updateEmergencyCallButtonState(this, phoneState, enabled, false); } } diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java index 29f76f3..0289a1f 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java @@ -116,7 +116,7 @@ public class KeyguardStatusView extends GridLayout { // Update Alarm status String nextAlarm = mLockPatternUtils.getNextAlarm(); if (!TextUtils.isEmpty(nextAlarm)) { - maybeSetUpperCaseText(mAlarmStatusView, nextAlarm); + mAlarmStatusView.setText(nextAlarm); mAlarmStatusView.setCompoundDrawablesWithIntrinsicBounds(ALARM_ICON, 0, 0, 0); mAlarmStatusView.setVisibility(View.VISIBLE); } else { @@ -125,7 +125,7 @@ public class KeyguardStatusView extends GridLayout { } void refreshDate() { - maybeSetUpperCaseText(mDateView, mDateFormat.format(new Date())); + mDateView.setText(mDateFormat.format(new Date())); } @Override @@ -144,11 +144,4 @@ public class KeyguardStatusView extends GridLayout { return LockPatternUtils.ID_DEFAULT_STATUS_WIDGET; } - private void maybeSetUpperCaseText(TextView textView, CharSequence text) { - if (KeyguardViewManager.USE_UPPER_CASE) { - textView.setText(text != null ? text.toString().toUpperCase() : null); - } else { - textView.setText(text); - } - } } |