When opening a submenu from a popup in ActionMenuPresenter, delegate
the submenu callbacks to the presenter callback registered on the
ActionMenuPresenter. This allows menu visibility callbacks to
propagate properly so that apps that hide their action bars after a
timeout can detect open menus that are deeply nested.
Bug
11429613
Change-Id: I3332886f08d4f9010f0875057c457566301d12ec
if (subMenu == null) return false;
mOpenSubMenuId = ((SubMenuBuilder) subMenu).getItem().getItemId();
- return false;
+ final MenuPresenter.Callback cb = getCallback();
+ return cb != null ? cb.onOpenSubMenu(subMenu) : false;
}
@Override
if (menu instanceof SubMenuBuilder) {
((SubMenuBuilder) menu).getRootMenu().close(false);
}
+ final MenuPresenter.Callback cb = getCallback();
+ if (cb != null) {
+ cb.onCloseMenu(menu, allMenusAreClosing);
+ }
}
}
mCallback = cb;
}
+ public Callback getCallback() {
+ return mCallback;
+ }
+
/**
* Create a new item view that can be re-bound to other item data later.
*