From d96c87eb6464854822a2b26865785495a96105de Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Thu, 7 May 2015 07:43:22 -0700 Subject: Disable ActionBar animations pending more involved fix Recycling of ActionBar items can cause problems with the current ActionBar animations, as the system animates views that represent both pre- and post-layout changes, sometimes causing opposit animations to run on the same view, resulting in unpredictable effect slike views remaining invisible. This 'fix' is a workaround to disable item animations pending a more complete and robust fix that involves a more involved system of view recycling that would avoid recycling views that are currently being used in animations. Issue #20538912 Menu missing in Downloads app Change-Id: I7b1d3baf94378e4788f868801a452c6583353842 --- core/java/android/widget/ActionMenuPresenter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/java/android/widget/ActionMenuPresenter.java b/core/java/android/widget/ActionMenuPresenter.java index e0b0e1f..f08141c 100644 --- a/core/java/android/widget/ActionMenuPresenter.java +++ b/core/java/android/widget/ActionMenuPresenter.java @@ -61,6 +61,7 @@ public class ActionMenuPresenter extends BaseMenuPresenter implements ActionProvider.SubUiVisibilityListener { private static final String TAG = "ActionMenuPresenter"; private static final int ITEM_ANIMATION_DURATION = 150; + private static final boolean ACTIONBAR_ANIMATIONS_ENABLED = false; private OverflowMenuButton mOverflowButton; private boolean mReserveOverflow; @@ -414,7 +415,7 @@ public class ActionMenuPresenter extends BaseMenuPresenter @Override public void updateMenuView(boolean cleared) { final ViewGroup menuViewParent = (ViewGroup) ((View) mMenuView).getParent(); - if (menuViewParent != null) { + if (menuViewParent != null && ACTIONBAR_ANIMATIONS_ENABLED) { setupItemAnimations(); } super.updateMenuView(cleared); -- cgit v1.1