Lines Matching refs:menu
19 import com.android.internal.view.menu.MenuItemImpl;
34 * This class is used to instantiate menu XML files into Menu objects.
36 * For performance reasons, menu inflation relies heavily on pre-processing of
44 private static final String XML_MENU = "menu";
57 * Constructs a menu inflater.
66 * Inflate a menu hierarchy from the specified XML resource. Throws
70 * <code>R.menu.main_activity</code>)
71 * @param menu The Menu to inflate into. The items and submenus will be
74 public void inflate(int menuRes, Menu menu) {
80 parseMenu(parser, attrs, menu);
82 throw new InflateException("Error inflating menu XML", e);
84 throw new InflateException("Error inflating menu XML", e);
91 * Called internally to fill the given menu. If a sub menu is seen, it will
94 private void parseMenu(XmlPullParser parser, AttributeSet attrs, Menu menu)
96 MenuState menuState = new MenuState(menu);
103 // This loop will skip to the menu start tag
113 throw new RuntimeException("Expecting menu, got " + tagName);
132 // A menu start tag denotes a submenu for an item
170 * State for the current menu.
172 * Groups can not be nested unless there is another menu (which will have
176 private Menu menu;
217 public MenuState(final Menu menu) {
218 this.menu = menu;
310 setItem(menu.add(groupId, itemId, itemCategoryOrder, itemTitle));
315 SubMenu subMenu = menu.addSubMenu(groupId, itemId, itemCategoryOrder, itemTitle);