Home | History | Annotate | Download | only in media

Lines Matching full:menu

51     private Menu[] mMenus = {};
72 public Menu[] getMenus() {
76 public void setMenus(Menu[] menus) {
81 public void updateMenu(Menu menu, int index) {
82 mMenus[index] = menu;
127 Menu[] menus = mMenus;
146 Menu menu = menus[i];
147 ResourceTexture icon = view.getResource(menu.icon);
149 StringTexture titleTexture = (StringTexture) mTextureMap.get(menu.title);
151 titleTexture = new StringTexture(menu.title, menu.config, menu.titleWidth, MENU_TITLE_STYLE.height);
153 menu.titleTexture = titleTexture;
154 mTextureMap.put(menu.title, titleTexture);
157 int width = iconWidth + menu.titleWidth;
158 int offset = (menu.mWidth - width) / 2;
161 view.draw2D(icon, menu.x + offset, iconY);
164 view.draw2D(titleTexture, menu.x + offset + iconWidth, titleY);
175 Menu menu = mMenus[touchMenu];
176 int x = menu.x + (int) (MENU_HIGHLIGHT_EDGE_INSET * App.PIXEL_DENSITY);
177 int width = menu.mWidth - (int) ((MENU_HIGHLIGHT_EDGE_INSET * 2) * App.PIXEL_DENSITY);
193 Menu[] menus = mMenus;
211 Menu[] menus = mMenus;
213 Menu oldMenu = menus[oldIndex];
219 // Select the new menu.
223 // Show the submenu for the selected menu if one is provided.
228 Menu menu = mMenus[index];
229 if (menu.onSelect != null) {
230 menu.onSelect.run();
233 // Show the popup menu if options are provided.
234 PopupMenu.Option[] options = menu.options;
236 int x = (int) mX + menu.x + menu.mWidth / 2;
253 Menu[] menus = mMenus;
255 Menu oldMenu = menus[oldIndex];
282 // Determine which menu the touch is over.
284 // Select the menu and invoke the action.
288 // Forward events outside the menubar to the active popup menu.
302 // Leave the submenu open if the touch ends on the menu button in
308 Menu menu = mMenus[hit];
309 if (menu.onSingleTapUp != null) {
310 menu.onSingleTapUp.run();
312 if (menu.options == null)
334 Menu[] menus = mMenus;
336 // we do the best attempt to fit the menu items and resize them
337 // also, it tries to minimize different sized menu items
338 // it finds the maximum width for a set of menu items, and checks
359 Menu menu = menus[i];
360 menu.x = x;
361 menu.mWidth = widthPerMenu;
362 menu.titleWidth = widthPerMenu - (20 + (menu.icon != 0 ? 45 : 0)); // TODO
369 // last menu.
371 menu.mWidth = (int) viewWidth - x;
399 Menu menu = menus[i];
400 menu.x = x;
407 menu.mWidth = (int) width;
408 menu.titleWidth = StringTexture.computeTextWidthForConfig(menu.title, menu.config); // (int)menus[i].title.computeTextWidth();
422 public static final class Menu {
487 public Menu build() {
488 return new Menu(this);
492 private Menu(Builder builder) {
520 public void onSelectionChanged(PopupMenu menu, int selectedIndex) {
524 public void onSelectionClicked(PopupMenu menu, int selectedIndex) {