Lines Matching defs:mMenu
29 private MenuBuilder mMenu;
33 mMenu = new MenuBuilder(super.getContext());
39 final MenuItem item = mMenu.add(0, id, 0, "test");
42 Assert.assertEquals(item, mMenu.findItem(id));
43 Assert.assertEquals(0, mMenu.findItemIndex(id));
52 mMenu.add(0, 0, item1Index - 1, "ignore");
53 final MenuItem item = mMenu.add(groupId, 0, item1Index, "test");
54 mMenu.add(0, 0, item2Index - 1, "ignore");
55 final MenuItem item2 = mMenu.add(groupId, 0, item2Index, "test2");
59 Assert.assertEquals(item1Index, mMenu.findGroupIndex(groupId));
60 Assert.assertEquals(item2Index, mMenu.findGroupIndex(groupId, item1Index + 1));
73 mMenu.add(GROUP_ONE, 0, 0, "Menu text");
74 Assert.assertEquals(mMenu.findGroupIndex(GROUP_ONE), 0);
75 Assert.assertEquals(mMenu.findGroupIndex(GROUP_TWO), -1);
85 mMenu.add(0, 0, lastOrder, c);
86 mMenu.add(0, 0, firstOrder, a);
87 mMenu.add(0, 0, midOrder, b);
89 Assert.assertEquals(firstOrder, mMenu.getItem(0).getOrder());
90 Assert.assertEquals(a, mMenu.getItem(0).getTitle());
91 Assert.assertEquals(midOrder, mMenu.getItem(1).getOrder());
92 Assert.assertEquals(b, mMenu.getItem(1).getTitle());
93 Assert.assertEquals(lastOrder, mMenu.getItem(2).getOrder());
94 Assert.assertEquals(c, mMenu.getItem(2).getTitle());
100 final MenuItem stringItem = mMenu.add(title);
101 final MenuItem resItem = mMenu.add(R.string.menu_test);
111 final MenuItem item1 = mMenu.add(groupId, 1, 0, "item1");
112 final MenuItem item2 = mMenu.add(groupId, 2, 0, "item2");
115 mMenu.setGroupCheckable(groupId, true, true);
120 mMenu.findItem(2).setChecked(true);
125 mMenu.setGroupCheckable(groupId, true, false);
131 mMenu.findItem(2).setChecked(true);
138 final MenuItem item1 = mMenu.add(0, 1, 0, "item1");
139 final MenuItem item2 = mMenu.add(0, 2, 0, "item2");
148 mMenu.findItem(2).setVisible(false);
154 final SubMenu subMenu = mMenu.addSubMenu(0, 0, 0, "submenu");
160 Assert.assertEquals(item1, mMenu.findItem(1));
161 Assert.assertEquals(item2, mMenu.findItem(2));
167 final MenuItem item1 = mMenu.add(groupId, 1, 0, "item1");
168 final MenuItem item2 = mMenu.add(groupId, 2, 0, "item2");
169 final MenuItem item3 = mMenu.add(groupId, 3, 0, "item3");
170 final MenuItem item4 = mMenu.add(groupId, 4, 0, "item4");
171 final MenuItem item5 = mMenu.add(groupId, 5, 0, "item5");
172 final MenuItem item6 = mMenu.add(0, 6, 0, "item6");
174 Assert.assertEquals(item1, mMenu.findItem(1));
175 mMenu.removeItemAt(0);
176 Assert.assertNull(mMenu.findItem(1));
178 Assert.assertEquals(item2, mMenu.findItem(2));
179 mMenu.removeItem(2);
180 Assert.assertNull(mMenu.findItem(2));
182 Assert.assertEquals(item3, mMenu.findItem(3));
183 Assert.assertEquals(item4, mMenu.findItem(4));
184 Assert.assertEquals(item5, mMenu.findItem(5));
185 mMenu.removeGroup(groupId);
186 Assert.assertNull(mMenu.findItem(3));
187 Assert.assertNull(mMenu.findItem(4));
188 Assert.assertNull(mMenu.findItem(5));
190 Assert.assertEquals(item6, mMenu.findItem(6));
191 mMenu.clear();
192 Assert.assertNull(mMenu.findItem(6));