Methods Summary |
---|
final android.view.MenuItem | getMenuItemWrapper(android.view.MenuItem menuItem)
if (menuItem instanceof SupportMenuItem) {
final SupportMenuItem supportMenuItem = (SupportMenuItem) menuItem;
// Instantiate Map if null
if (mMenuItems == null) {
mMenuItems = new ArrayMap<>();
}
// First check if we already have a wrapper for this item
MenuItem wrappedItem = mMenuItems.get(menuItem);
if (null == wrappedItem) {
// ... if not, create one and add it to our map
wrappedItem = MenuWrapperFactory.wrapSupportMenuItem(mContext, supportMenuItem);
mMenuItems.put(supportMenuItem, wrappedItem);
}
return wrappedItem;
}
return menuItem;
|
final android.view.SubMenu | getSubMenuWrapper(android.view.SubMenu subMenu)
if (subMenu instanceof SupportSubMenu) {
final SupportSubMenu supportSubMenu = (SupportSubMenu) subMenu;
// Instantiate Map if null
if (mSubMenus == null) {
mSubMenus = new ArrayMap<>();
}
SubMenu wrappedMenu = mSubMenus.get(supportSubMenu);
if (null == wrappedMenu) {
wrappedMenu = MenuWrapperFactory.wrapSupportSubMenu(mContext, supportSubMenu);
mSubMenus.put(supportSubMenu, wrappedMenu);
}
return wrappedMenu;
}
return subMenu;
|
final void | internalClear()
if (mMenuItems != null) {
mMenuItems.clear();
}
if (mSubMenus != null) {
mSubMenus.clear();
}
|
final void | internalRemoveGroup(int groupId)
if (mMenuItems == null) {
return;
}
Iterator<SupportMenuItem> iterator = mMenuItems.keySet().iterator();
android.view.MenuItem menuItem;
while (iterator.hasNext()) {
menuItem = iterator.next();
if (groupId == menuItem.getGroupId()) {
iterator.remove();
}
}
|
final void | internalRemoveItem(int id)
if (mMenuItems == null) {
return;
}
Iterator<SupportMenuItem> iterator = mMenuItems.keySet().iterator();
android.view.MenuItem menuItem;
while (iterator.hasNext()) {
menuItem = iterator.next();
if (id == menuItem.getItemId()) {
iterator.remove();
break;
}
}
|