Lines Matching refs:menu

31 import android.support.v7.internal.view.menu.MenuItemImpl;
32 import android.support.v7.internal.view.menu.MenuItemWrapperICS;
48 * This class is used to instantiate menu XML files into Menu objects.
50 * For performance reasons, menu inflation relies heavily on pre-processing of
62 private static final String XML_MENU = "menu";
85 * Constructs a menu inflater.
97 * Inflate a menu hierarchy from the specified XML resource. Throws
101 * <code>R.menu.main_activity</code>)
102 * @param menu The Menu to inflate into. The items and submenus will be
106 public void inflate(int menuRes, Menu menu) {
108 if (!(menu instanceof SupportMenu)) {
109 super.inflate(menuRes, menu);
118 parseMenu(parser, attrs, menu);
120 throw new InflateException("Error inflating menu XML", e);
122 throw new InflateException("Error inflating menu XML", e);
129 * Called internally to fill the given menu. If a sub menu is seen, it will
132 private void parseMenu(XmlPullParser parser, AttributeSet attrs, Menu menu)
134 MenuState menuState = new MenuState(menu);
141 // This loop will skip to the menu start tag
151 throw new RuntimeException("Expecting menu, got " + tagName);
170 // A menu start tag denotes a submenu for an item
243 "Couldn't resolve menu item onClick handler " + methodName +
265 * State for the current menu.
267 * Groups can not be nested unless there is another menu (which will have
271 private Menu menu;
329 public MenuState(final Menu menu) {
330 this.menu = menu;
479 setItem(menu.add(groupId, itemId, itemCategoryOrder, itemTitle));
484 SubMenu subMenu = menu.addSubMenu(groupId, itemId, itemCategoryOrder, itemTitle);