diff options
author | Casey Burkhardt <caseyburkhardt@google.com> | 2012-10-01 14:13:41 -0700 |
---|---|---|
committer | Casey Burkhardt <caseyburkhardt@google.com> | 2012-10-01 15:57:17 -0700 |
commit | 4aeb961de2a2bbf0d897a8436b6421ecfbc4d712 (patch) | |
tree | 495f23bc4c2bacb480a39f02eed042527ae201e8 /core/java/com/android/internal/widget/ActionBarView.java | |
parent | 410bc60a77ee3ba6e596e84d44ec23f3325ae310 (diff) | |
download | frameworks_base-4aeb961de2a2bbf0d897a8436b6421ecfbc4d712.zip frameworks_base-4aeb961de2a2bbf0d897a8436b6421ecfbc4d712.tar.gz frameworks_base-4aeb961de2a2bbf0d897a8436b6421ecfbc4d712.tar.bz2 |
Sets accessibility importance for the home/up button.
Bug: 7196985
Change-Id: I4d27470eccb8933f751db892218a8032a80df3da
Diffstat (limited to 'core/java/com/android/internal/widget/ActionBarView.java')
-rw-r--r-- | core/java/com/android/internal/widget/ActionBarView.java | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java index 4715750..991c699 100644 --- a/core/java/com/android/internal/widget/ActionBarView.java +++ b/core/java/com/android/internal/widget/ActionBarView.java @@ -556,12 +556,16 @@ public class ActionBarView extends AbsActionBarView { // Make sure the home button has an accurate content description for accessibility. if (!enable) { mHomeLayout.setContentDescription(null); - } else if ((mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0) { - mHomeLayout.setContentDescription(mContext.getResources().getText( - R.string.action_bar_up_description)); + mHomeLayout.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); } else { - mHomeLayout.setContentDescription(mContext.getResources().getText( - R.string.action_bar_home_description)); + mHomeLayout.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_AUTO); + if ((mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0) { + mHomeLayout.setContentDescription(mContext.getResources().getText( + R.string.action_bar_up_description)); + } else { + mHomeLayout.setContentDescription(mContext.getResources().getText( + R.string.action_bar_home_description)); + } } } @@ -624,12 +628,16 @@ public class ActionBarView extends AbsActionBarView { // Make sure the home button has an accurate content description for accessibility. if (!mHomeLayout.isEnabled()) { mHomeLayout.setContentDescription(null); - } else if ((options & ActionBar.DISPLAY_HOME_AS_UP) != 0) { - mHomeLayout.setContentDescription(mContext.getResources().getText( - R.string.action_bar_up_description)); + mHomeLayout.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); } else { - mHomeLayout.setContentDescription(mContext.getResources().getText( - R.string.action_bar_home_description)); + mHomeLayout.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_AUTO); + if ((options & ActionBar.DISPLAY_HOME_AS_UP) != 0) { + mHomeLayout.setContentDescription(mContext.getResources().getText( + R.string.action_bar_up_description)); + } else { + mHomeLayout.setContentDescription(mContext.getResources().getText( + R.string.action_bar_home_description)); + } } } |