diff options
author | Adam Powell <adamp@google.com> | 2013-02-05 16:13:57 -0800 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2013-02-05 16:24:25 -0800 |
commit | 07cf971e58aecab76f2b5b575cfe62120005c6e4 (patch) | |
tree | 028b87d7715456b560d48018d7a495bef06b6c0c /core | |
parent | 5e9be5bcf2d423e516d3c061fffc989ffa444212 (diff) | |
download | frameworks_base-07cf971e58aecab76f2b5b575cfe62120005c6e4.zip frameworks_base-07cf971e58aecab76f2b5b575cfe62120005c6e4.tar.gz frameworks_base-07cf971e58aecab76f2b5b575cfe62120005c6e4.tar.bz2 |
Fix re-enabled state of up after action view collapse
A certain call ordering to the action bar could cause the record of
the pre-action view expanded home button enabled state to be
incorrect. Store this in all cases, not just when the action view is
initially expanded. (Except for when we actually disable it for the
expanded view.)
If an action view is already expanded when we get a call to change the
enabled state of the home/up button, don't modify the state of the up
container or other accessibility info, but record the new state if
requested.
Bug 8142097
Change-Id: I070c151aa9f2046d2114ee541d964bf68c6f0def
Diffstat (limited to 'core')
-rw-r--r-- | core/java/com/android/internal/widget/ActionBarView.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java index d11b3b3..0f964b9 100644 --- a/core/java/com/android/internal/widget/ActionBarView.java +++ b/core/java/com/android/internal/widget/ActionBarView.java @@ -559,6 +559,21 @@ public class ActionBarView extends AbsActionBarView { } public void setHomeButtonEnabled(boolean enable) { + setHomeButtonEnabled(enable, true); + } + + private void setHomeButtonEnabled(boolean enable, boolean recordState) { + if (recordState) { + mWasHomeEnabled = enable; + } + + if (mExpandedActionView != null) { + // There's an action view currently showing and we want to keep the state + // configured for the action view at the moment. If we needed to record the + // new state for later we will have done so above. + return; + } + mUpGoerFive.setEnabled(enable); mUpGoerFive.setFocusable(enable); // Make sure the home button has an accurate content description for accessibility. @@ -1539,8 +1554,7 @@ public class ActionBarView extends AbsActionBarView { if (mTabScrollView != null) mTabScrollView.setVisibility(GONE); if (mSpinner != null) mSpinner.setVisibility(GONE); if (mCustomNavView != null) mCustomNavView.setVisibility(GONE); - mWasHomeEnabled = mUpGoerFive.isEnabled(); - setHomeButtonEnabled(false); + setHomeButtonEnabled(false, false); requestLayout(); item.setActionViewExpanded(true); |