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.guayaba.tapir.ui.fragments.profile.ArtistAlbumFragment.java

/**
 * {@inheritDoc}/* w ww .ja  v  a2  s . c  o m*/
 */
@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 album
    mAlbum = mAdapter.getItem(info.position - 1);
    // Create a list of the album's songs
    mAlbumList = MusicUtils.getSongListForAlbum(getActivity(), mAlbum.mAlbumId);

    // Play the album
    menu.add(GROUP_ID, FragmentMenuItems.PLAY_SELECTION, Menu.NONE,
            getString(R.string.context_menu_play_selection));

    // Add the album to the queue
    menu.add(GROUP_ID, FragmentMenuItems.ADD_TO_QUEUE, Menu.NONE, getString(R.string.add_to_queue));

    // Add the album to a playlist
    final SubMenu subMenu = menu.addSubMenu(GROUP_ID, FragmentMenuItems.ADD_TO_PLAYLIST, Menu.NONE,
            R.string.add_to_playlist);
    MusicUtils.makePlaylistMenu(getActivity(), GROUP_ID, subMenu, false);

    // Delete the album
    menu.add(GROUP_ID, FragmentMenuItems.DELETE, Menu.NONE, getString(R.string.context_menu_delete));
}

From source file:de.eidottermihi.rpicheck.activity.CustomCommandActivity.java

@Override
public void onCreateContextMenu(final ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    if (v.getId() == R.id.commandListView) {
        final AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
        LOGGER.debug("Creating context menu for command id = {}.", info.id);
        CommandBean cmd = deviceDb.readCommand(info.id);
        menu.setHeaderTitle(cmd.getName());
        menu.add(Menu.NONE, 1, 1, R.string.command_context_edit);
        menu.add(Menu.NONE, 2, 2, R.string.command_context_delete);
        menu.add(Menu.NONE, 3, 3, R.string.command_context_run);

    }/*from   www.j av a 2s  .c o  m*/
    super.onCreateContextMenu(menu, v, menuInfo);
}

From source file:com.boko.vimusic.ui.fragments.profile.ArtistAlbumFragment.java

/**
 * {@inheritDoc}//from   ww  w .  ja  va 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 album
    mAlbum = mAdapter.getItem(info.position - 1);
    // Create a list of the album's songs
    mAlbumList = MusicUtils.getSongListForAlbum(getActivity(), mAlbum.getId());

    // Play the album
    menu.add(GROUP_ID, FragmentMenuItems.PLAY_SELECTION, Menu.NONE,
            getString(R.string.context_menu_play_selection));

    // Add the album to the queue
    menu.add(GROUP_ID, FragmentMenuItems.ADD_TO_QUEUE, Menu.NONE, getString(R.string.add_to_queue));

    // Add the album to a playlist
    final SubMenu subMenu = menu.addSubMenu(GROUP_ID, FragmentMenuItems.ADD_TO_PLAYLIST, Menu.NONE,
            R.string.add_to_playlist);
    MusicUtils.makePlaylistMenu(getActivity(), GROUP_ID, subMenu, false);

    // Delete the album
    menu.add(GROUP_ID, FragmentMenuItems.DELETE, Menu.NONE, getString(R.string.context_menu_delete));
}

From source file:com.guayaba.tapir.ui.fragments.profile.GenreSongFragment.java

/**
 * {@inheritDoc}//from  w  w  w  .j  a  va 2s .c  o m
 */
@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;
    mSelectedPosition = info.position - 1;
    // Creat a new song
    mSong = mAdapter.getItem(mSelectedPosition);
    mSelectedId = mSong.mSongId;
    mSongName = mSong.mSongName;
    mAlbumName = mSong.mAlbumName;
    mArtistName = mSong.mArtistName;

    // Play the song
    menu.add(GROUP_ID, FragmentMenuItems.PLAY_SELECTION, Menu.NONE,
            getString(R.string.context_menu_play_selection));

    // Play the song
    menu.add(GROUP_ID, FragmentMenuItems.PLAY_NEXT, Menu.NONE, getString(R.string.context_menu_play_next));

    // Add the song to the queue
    menu.add(GROUP_ID, FragmentMenuItems.ADD_TO_QUEUE, Menu.NONE, getString(R.string.add_to_queue));

    // Add the song to a playlist
    final SubMenu subMenu = menu.addSubMenu(GROUP_ID, FragmentMenuItems.ADD_TO_PLAYLIST, Menu.NONE,
            R.string.add_to_playlist);
    MusicUtils.makePlaylistMenu(getActivity(), GROUP_ID, subMenu, true);

    // View more content by the song artist
    menu.add(GROUP_ID, FragmentMenuItems.MORE_BY_ARTIST, Menu.NONE,
            getString(R.string.context_menu_more_by_artist));

    // Make the song a ringtone
    menu.add(GROUP_ID, FragmentMenuItems.USE_AS_RINGTONE, Menu.NONE,
            getString(R.string.context_menu_use_as_ringtone));

    // Delete the song
    menu.add(GROUP_ID, FragmentMenuItems.DELETE, Menu.NONE, getString(R.string.context_menu_delete));
}

From source file:com.guayaba.tapir.ui.fragments.profile.AlbumSongFragment.java

/**
 * {@inheritDoc}//from  w  w w  . j  a  v a2  s  .co m
 */
@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;
    mSelectedPosition = info.position - 1;
    // Creat a new song
    mSong = mAdapter.getItem(mSelectedPosition);
    mSelectedId = mSong.mSongId;
    mSongName = mSong.mSongName;
    mAlbumName = mSong.mAlbumName;
    mArtistName = mSong.mArtistName;

    // Play the song
    menu.add(GROUP_ID, FragmentMenuItems.PLAY_SELECTION, Menu.NONE,
            getString(R.string.context_menu_play_selection));

    // Play the song
    menu.add(GROUP_ID, FragmentMenuItems.PLAY_NEXT, Menu.NONE, getString(R.string.context_menu_play_next));

    // Add the song to the queue
    menu.add(GROUP_ID, FragmentMenuItems.ADD_TO_QUEUE, Menu.NONE, getString(R.string.add_to_queue));

    // Add the song to a playlist
    final SubMenu subMenu = menu.addSubMenu(GROUP_ID, FragmentMenuItems.ADD_TO_PLAYLIST, Menu.NONE,
            R.string.add_to_playlist);
    MusicUtils.makePlaylistMenu(getActivity(), GROUP_ID, subMenu, true);

    // Make the song a ringtone
    menu.add(GROUP_ID, FragmentMenuItems.USE_AS_RINGTONE, Menu.NONE,
            getString(R.string.context_menu_use_as_ringtone));

    // Delete the song
    menu.add(GROUP_ID, FragmentMenuItems.DELETE, Menu.NONE, getString(R.string.context_menu_delete));
}

From source file:com.example.shiwangi.dataplan.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);

    // 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;//  ww  w . j  ava2 s .c  o m
}

From source file:org.mythdroid.activities.Recordings.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {

    MenuItemCompat.setShowAsAction(//from   w  w w.  j  a  va 2s  .c o m
            menu.add(Menu.NONE, MENU_REFRESH, Menu.NONE, R.string.refresh).setIcon(R.drawable.ic_menu_refresh),
            MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);

    MenuItemCompat.setShowAsAction(
            menu.add(Menu.NONE, MENU_FILTER, Menu.NONE, R.string.filter).setIcon(drawable.ic_menu_search),
            MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);

    MenuItemCompat.setShowAsAction(menu.add(Menu.NONE, MENU_FILTER_RESET, Menu.NONE, R.string.resetFilter)
            .setIcon(drawable.ic_menu_revert), MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);

    addFrontendChooser(menu);

    menu.add(Menu.NONE, MENU_WAKE, Menu.NONE, R.string.wakeFe).setIcon(drawable.ic_lock_power_off);

    return true;

}

From source file:com.boko.vimusic.ui.fragments.profile.GenreSongFragment.java

/**
 * {@inheritDoc}//from  ww w .j  a va2  s.co m
 */
@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;
    mSelectedPosition = info.position - 1;
    // Creat a new song
    mSong = mAdapter.getItem(mSelectedPosition);
    mSelectedId = mSong;
    mSongName = mSong.getName();
    mAlbumName = mSong.mAlbumName;
    mArtistName = mSong.mArtistName;

    // Play the song
    menu.add(GROUP_ID, FragmentMenuItems.PLAY_SELECTION, Menu.NONE,
            getString(R.string.context_menu_play_selection));

    // Play the song
    menu.add(GROUP_ID, FragmentMenuItems.PLAY_NEXT, Menu.NONE, getString(R.string.context_menu_play_next));

    // Add the song to the queue
    menu.add(GROUP_ID, FragmentMenuItems.ADD_TO_QUEUE, Menu.NONE, getString(R.string.add_to_queue));

    // Add the song to a playlist
    final SubMenu subMenu = menu.addSubMenu(GROUP_ID, FragmentMenuItems.ADD_TO_PLAYLIST, Menu.NONE,
            R.string.add_to_playlist);
    MusicUtils.makePlaylistMenu(getActivity(), GROUP_ID, subMenu, true);

    // View more content by the song artist
    menu.add(GROUP_ID, FragmentMenuItems.MORE_BY_ARTIST, Menu.NONE,
            getString(R.string.context_menu_more_by_artist));

    // Make the song a ringtone
    menu.add(GROUP_ID, FragmentMenuItems.USE_AS_RINGTONE, Menu.NONE,
            getString(R.string.context_menu_use_as_ringtone));

    // Delete the song
    menu.add(GROUP_ID, FragmentMenuItems.DELETE, Menu.NONE, getString(R.string.context_menu_delete));
}

From source file:com.boko.vimusic.ui.fragments.profile.AlbumSongFragment.java

/**
 * {@inheritDoc}/*www .j  a  v  a  2  s .  c  o  m*/
 */
@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;
    mSelectedPosition = info.position - 1;
    // Creat a new song
    mSong = mAdapter.getItem(mSelectedPosition);
    mSelectedId = mSong;
    mSongName = mSong.getName();
    mAlbumName = mSong.mAlbumName;
    mArtistName = mSong.mArtistName;

    // Play the song
    menu.add(GROUP_ID, FragmentMenuItems.PLAY_SELECTION, Menu.NONE,
            getString(R.string.context_menu_play_selection));

    // Play the song
    menu.add(GROUP_ID, FragmentMenuItems.PLAY_NEXT, Menu.NONE, getString(R.string.context_menu_play_next));

    // Add the song to the queue
    menu.add(GROUP_ID, FragmentMenuItems.ADD_TO_QUEUE, Menu.NONE, getString(R.string.add_to_queue));

    // Add the song to a playlist
    final SubMenu subMenu = menu.addSubMenu(GROUP_ID, FragmentMenuItems.ADD_TO_PLAYLIST, Menu.NONE,
            R.string.add_to_playlist);
    MusicUtils.makePlaylistMenu(getActivity(), GROUP_ID, subMenu, true);

    // Make the song a ringtone
    menu.add(GROUP_ID, FragmentMenuItems.USE_AS_RINGTONE, Menu.NONE,
            getString(R.string.context_menu_use_as_ringtone));

    // Delete the song
    menu.add(GROUP_ID, FragmentMenuItems.DELETE, Menu.NONE, getString(R.string.context_menu_delete));
}

From source file:com.andrew.apollo.ui.fragments.profile.ArtistAlbumFragment.java

/**
 * {@inheritDoc}//from   w  w  w . j  a v a 2s.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 album
    mAlbum = mAdapter.getItem(info.position - 1);
    // Create a list of the album's songs
    mAlbumList = MusicUtils.getSongListForAlbum(getSherlockActivity(), mAlbum.mAlbumId);

    // Play the album
    menu.add(GROUP_ID, FragmentMenuItems.PLAY_SELECTION, Menu.NONE,
            getString(R.string.context_menu_play_selection));

    // Add the album to the queue
    menu.add(GROUP_ID, FragmentMenuItems.ADD_TO_QUEUE, Menu.NONE, getString(R.string.add_to_queue));

    // Add the album to a playlist
    final SubMenu subMenu = menu.addSubMenu(GROUP_ID, FragmentMenuItems.ADD_TO_PLAYLIST, Menu.NONE,
            R.string.add_to_playlist);
    MusicUtils.makePlaylistMenu(getSherlockActivity(), GROUP_ID, subMenu, false);

    // Delete the album
    menu.add(GROUP_ID, FragmentMenuItems.DELETE, Menu.NONE, getString(R.string.context_menu_delete));
}