/** * {@inheritDoc} * * @see org.emdev.ui.AbstractActionActivity#updateMenuItems(android.view.Menu) */ @Override protected void updateMenuItems(final Menu optionsMenu) { final File dir = getController().adapter.getCurrentDirectory(); final boolean hasParent = dir != null ? dir.getParentFile() != null : false; ActionMenuHelper.setMenuItemEnabled( optionsMenu, hasParent, R.id.browserupfolder, R.drawable.browser_actionbar_nav_up_enabled, R.drawable.browser_actionbar_nav_up_disabled); }
/** * {@inheritDoc} * * @see android.app.Activity#onCreateContextMenu(android.view.ContextMenu, android.view.View, * android.view.ContextMenu.ContextMenuInfo) */ @Override public void onCreateContextMenu( final ContextMenu menu, final View v, final ContextMenuInfo menuInfo) { final Object source = getContextMenuSource(v, menuInfo); if (source instanceof File) { final File node = (File) source; final String path = node.getAbsolutePath(); if (node.isDirectory()) { createFolderMenu(menu, path); } else { createFileMenu(menu, path); } } ActionMenuHelper.setMenuSource(getController(), menu, source); }
protected void addBookmarkMenuItem(final Menu menu, final Bookmark b) { final MenuItem bmi = menu.add(R.id.actions_goToBookmarkGroup, R.id.actions_goToBookmark, Menu.NONE, b.name); bmi.setIcon(R.drawable.viewer_menu_bookmark); ActionMenuHelper.setMenuItemExtra(bmi, "bookmark", b); }