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:com.willyan.viewpagerslideanimation.ScreenSlideActivity.java

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

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

    // Add either a "next" or "finish" button to the action bar, depending on which page
    // is currently selected.
    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;//from ww w  .j a v  a 2  s . c o  m
}

From source file:com.andrew.apollo.ui.fragments.GenreFragment.java

/**
 * {@inheritDoc}/* www.j av  a 2 s. c  om*/
 */
@Override
public void onCreateContextMenu(final ContextMenu menu, final View v, final ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    // Get the position of the selected item
    final AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
    // Create a new genre
    mGenre = mAdapter.getItem(info.position);
    // Create a list of the genre's songs
    mGenreList = MusicUtils.getSongListForGenre(getSherlockActivity(), mGenre.mGenreId);

    // Play the genre
    menu.add(GROUP_ID, FragmentMenuItems.PLAY_SELECTION, Menu.NONE, R.string.context_menu_play_selection);
    // Add the genre to the queue
    menu.add(GROUP_ID, FragmentMenuItems.ADD_TO_QUEUE, Menu.NONE, R.string.add_to_queue);
}

From source file:org.alfresco.mobile.android.application.fragments.workflow.process.ProcessesFragment.java

public static void getMenu(Context context, Menu menu) {
    MenuItem mi;/*  ww w  .  j  a  v  a 2  s.  c o m*/

    mi = menu.add(Menu.NONE, R.id.menu_workflow_add, Menu.FIRST, R.string.workflow_start);
    mi.setIcon(android.R.drawable.ic_menu_add);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

    MenuFragmentHelper.getMenu(context, menu);
}

From source file:edu.princeton.jrpalmer.asmlibrary.ListMyDataCursorLoader.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);

    menu.add(0, LOCATE_NOW, Menu.NONE, R.string.menu_locate_now);

    return true;//ww  w .java 2s  .  co  m

}

From source file:com.gmail.at.faint545.fragments.HistoryFragment.java

@Override
public void onPrepareOptionsMenu(Menu menu) {
    menu.clear();/*  w  ww .j  ava  2s  .c  o m*/
    /* Only show these two options if there are jobs to delete */
    if (mSelectedPositions.size() > 0 && mOldJobs.size() > 0) {
        menu.add(Menu.NONE, DELETE, Menu.NONE, "Delete selected");
    } else if (mOldJobs.size() > 0) {
        menu.add(Menu.NONE, DELETE, Menu.NONE, "Delete all");
    }
    super.onPrepareOptionsMenu(menu);
}

From source file:com.thesis.asa.mainui.MainSlideActivity.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(pager.getCurrentItem() > 0);

    MenuItem item = menu.add(Menu.NONE, R.id.action_next, Menu.NONE,
            (pager.getCurrentItem() == pagerAdapter.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;//  w  w w  .jav  a 2 s  .  co  m
}

From source file:org.alfresco.mobile.android.application.fragments.site.browser.SiteAdapter.java

public void getMenu(Menu menu, Site site) {
    if (site.isMember()) {
        menu.add(Menu.NONE, R.id.menu_site_leave, Menu.FIRST + 2, R.string.action_leave_site);
    } else if (!SiteVisibility.PRIVATE.equals(site.getVisibility()) && !site.isPendingMember()) {
        menu.add(Menu.NONE, R.id.menu_site_join, Menu.FIRST + 1,
                (SiteVisibility.MODERATED.equals(site.getVisibility())) ? R.string.action_join_request_site
                        : R.string.action_join_site);
    }// w ww .j a  v a 2  s . c  om

    if (site.isFavorite()) {
        menu.add(Menu.NONE, R.id.menu_site_unfavorite, Menu.FIRST + 5, R.string.action_unfavorite_site);
    } else {
        menu.add(Menu.NONE, R.id.menu_site_favorite, Menu.FIRST + 4, R.string.action_favorite_site);
    }

    menu.add(Menu.NONE, R.id.menu_site_members, Menu.FIRST, R.string.members);
}

From source file:com.yeldi.yeldibazaar.SearchResults.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {

    super.onCreateOptionsMenu(menu);
    MenuItem search = menu.add(Menu.NONE, SEARCH, 1, R.string.menu_search)
            .setIcon(android.R.drawable.ic_menu_search);
    MenuItemCompat.setShowAsAction(search, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
    return true;// ww w.j  a  v a 2 s .c  om
}

From source file:org.mozilla.mozstumbler.client.navdrawer.MainDrawerActivity.java

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

    mMenuItemStartStop = menu.add(Menu.NONE, MENU_START_STOP, Menu.NONE, R.string.start_scanning);
    if (Build.VERSION.SDK_INT >= 14) {
        Switch s = new Switch(this);
        s.setChecked(false);// w  w w .j  a v a  2  s  .com
        s.setOnCheckedChangeListener(mStartStopButtonListener);
        mMenuItemStartStop.setActionView(s);
        mMenuItemStartStop.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
    } else {
        MenuItemCompat.setShowAsAction(mMenuItemStartStop, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
    }

    updateStartStopMenuItemState();
    return true;
}

From source file:com.yeldi.yeldibazaar.FDroid.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {

    super.onCreateOptionsMenu(menu);
    menu.add(Menu.NONE, UPDATE_REPO, 1, R.string.menu_update_repo).setIcon(android.R.drawable.ic_menu_rotate);
    menu.add(Menu.NONE, MANAGE_REPO, 2, R.string.menu_manage).setIcon(android.R.drawable.ic_menu_agenda);
    MenuItem search = menu.add(Menu.NONE, SEARCH, 3, R.string.menu_search)
            .setIcon(android.R.drawable.ic_menu_search);
    menu.add(Menu.NONE, PREFERENCES, 4, R.string.menu_preferences)
            .setIcon(android.R.drawable.ic_menu_preferences);
    menu.add(Menu.NONE, ABOUT, 5, R.string.menu_about).setIcon(android.R.drawable.ic_menu_help);
    MenuItemCompat.setShowAsAction(search, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
    return true;/*from w  ww. ja  va 2 s .c o  m*/
}