Example usage for android.view Menu NONE

List of usage examples for android.view Menu NONE

Introduction

In this page you can find the example usage for android.view Menu NONE.

Prototype

int NONE

To view the source code for android.view Menu NONE.

Click Source Link

Document

Value to use for group and item identifier integers when you don't care about them.

Usage

From source file:org.alfresco.mobile.android.application.fragments.MenuFragmentHelper.java

public static MenuItem getMenu(Context context, Menu menu) {
    if (menu == null || context == null) {
        return null;
    }/*from   ww  w.j  a  v a  2  s . co  m*/
    if (AccessibilityUtils.isEnabled(context)) {
        MenuItem mi = menu.add(Menu.NONE, R.id.menu_refresh, Menu.FIRST + 40, R.string.refresh);
        mi.setIcon(R.drawable.ic_refresh);
        mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
        return mi;
    } else {
        return null;
    }
}

From source file:com.loopj.android.http.sample.Redirect302Sample.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    menu.add(Menu.NONE, 0, Menu.NONE, "Enable redirects").setCheckable(true);
    menu.add(Menu.NONE, 1, Menu.NONE, "Enable relative redirects").setCheckable(true);
    menu.add(Menu.NONE, 2, Menu.NONE, "Enable circular redirects").setCheckable(true);
    return super.onCreateOptionsMenu(menu);
}

From source file:com.bellman.bible.android.view.activity.base.actionbar.QuickActionButton.java

public void addToMenu(Menu menu) {
    if (menuItem == null || (menu.findItem(thisItemId) == null)) {
        menuItem = menu.add(Menu.NONE, thisItemId, Menu.NONE, "");
        MenuItemCompat.setShowAsAction(menuItem, showAsActionFlags);
        menuItem.setOnMenuItemClickListener(this);
        update(menuItem);/*from   w w w. ja  v  a 2 s  .  c  o m*/
    }
}

From source file:org.puder.trs80.EditConfigurationActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuItemCompat.setShowAsAction(// w  w w.  j av a 2 s .  com
            menu.add(Menu.NONE, MENU_OPTION_CANCEL, Menu.NONE, this.getString(R.string.menu_cancel))
                    .setIcon(R.drawable.cancel_icon),
            MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
    MenuItemCompat.setShowAsAction(
            menu.add(Menu.NONE, MENU_OPTION_HELP, Menu.NONE, this.getString(R.string.menu_help))
                    .setIcon(R.drawable.help_icon),
            MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
    return true;
}

From source file:yuejia.liu.musseta.components.settings.SettingsActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuItem os = menu.add(Menu.NONE, android.R.id.button1, Menu.NONE, "Open Source");
    os.setIcon(R.drawable.ic_code_white_24dp);
    MenuItemCompat.setShowAsAction(os, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
    return true;// w w w .  j av  a 2  s  . c o m
}

From source file:ca.rmen.android.scrumchatter.main.TeamNavigationMenu.java

void load() {
    Log.v(TAG, "load");
    mTeams.getAllTeams().subscribe(teamsData -> {
        // Update the navigation view.
        SubMenu teamsMenu = mNavigationMenu.findItem(R.id.teams_list).getSubMenu();
        teamsMenu.clear();// www.  j ava2 s  .co  m
        for (Teams.Team team : teamsData.teams) {
            MenuItem teamMenuItem = teamsMenu.add(R.id.teams_list_items, Menu.NONE, Menu.NONE, team.teamName);
            if (team.teamName.equals(teamsData.currentTeam.teamName)) {
                teamMenuItem.setChecked(true);
            }
        }
    });
}

From source file:com.commonsware.android.loader.ConstantsBrowser.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    menu.add(Menu.NONE, ADD_ID, Menu.NONE, "Add").setIcon(R.drawable.add).setAlphabeticShortcut('a');

    return (super.onCreateOptionsMenu(menu));
}

From source file:com.darsihmad.slideScreen.ScreenSlideActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    getMenuInflater().inflate(R.menu.activity_screen_slide, menu);

    menu.findItem(R.id.action_previous).setEnabled(mPager.getCurrentItem() > 0);

    MenuItem item = menu.add(Menu.NONE, R.id.action_next, Menu.NONE,
            (mPager.getCurrentItem() == mPagerAdapter.getCount() - 1) ? R.string.action_finish
                    : R.string.action_next);
    item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
    return true;//  www  . j ava  2 s .  com
}

From source file:org.puder.trs80.SettingsActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuItemCompat.setShowAsAction(/* ww w  .  j  a  v  a  2  s .com*/
            menu.add(Menu.NONE, MENU_OPTION_HELP, Menu.NONE, this.getString(R.string.menu_help))
                    .setIcon(R.drawable.help_icon),
            MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);

    return true;
}

From source file:com.tastycactus.timesheet.TimeEntriesActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    boolean result = super.onCreateOptionsMenu(menu);
    menu.add(Menu.NONE, ADD_TIME_ENTRY_MENU_ITEM, Menu.NONE, "Add Time Entry")
            .setIcon(android.R.drawable.ic_menu_add);
    menu.add(Menu.NONE, EXPORT_MENU_ITEM, Menu.NONE, "Export to CSV").setIcon(android.R.drawable.ic_menu_save);
    menu.add(Menu.NONE, EMAIL_MENU_ITEM, Menu.NONE, "Send Email").setIcon(android.R.drawable.ic_menu_send);
    return result;
}