Fix subsequent drag-to-open SubMenus
Caused by a timing issue in the dismiss calls.
The framework uses an Animation before performing
the item click after selecting an item. As AppCompat
doesn't use an Animation, the popup is dismissed and
thus null'ed out before onForwardingStopped() has been
called.
This messes up ActionMenuItemView's onForwardingStopped()
impl since it will now return false and make ListPopupWindow
think it's still forwarding. The fix is to just use the
default onForwardingStopped impl which works correctly.
BUG: 18141053
Change-Id: I5f4aef456157d926eb341e47393048ee22eef690
diff --git a/v7/appcompat/src/android/support/v7/internal/view/menu/ActionMenuItemView.java b/v7/appcompat/src/android/support/v7/internal/view/menu/ActionMenuItemView.java
index a6c6dde..b7f5ff7 100644
--- a/v7/appcompat/src/android/support/v7/internal/view/menu/ActionMenuItemView.java
+++ b/v7/appcompat/src/android/support/v7/internal/view/menu/ActionMenuItemView.java
@@ -314,15 +314,12 @@
return false;
}
- @Override
- protected boolean onForwardingStopped() {
- final ListPopupWindow popup = getPopup();
- if (popup != null) {
- popup.dismiss();
- return true;
- }
- return false;
- }
+ // Do not backport the framework impl here.
+ // The framework's ListPopupWindow uses an animation before performing the item click
+ // after selecting an item. As AppCompat doesn't use an animation, the popup is
+ // dismissed and thus null'ed out before onForwardingStopped() has been called.
+ // This messes up ActionMenuItemView's onForwardingStopped() impl since it will now
+ // return false and make ListPopupWindow think it's still forwarding.
}
public static abstract class PopupCallback {