예제 #1
0
  /**
   * {@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);
  }
예제 #2
0
  /**
   * {@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);
  }
예제 #3
0
 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);
 }