List of usage examples for android.view Menu NONE
int NONE
To view the source code for android.view Menu NONE.
Click Source Link
From source file:com.yeldi.yeldibazaar.ManageRepo.java
public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuItem item = menu.add(Menu.NONE, ADD_REPO, 1, R.string.menu_add_repo) .setIcon(android.R.drawable.ic_menu_add); menu.add(Menu.NONE, REM_REPO, 2, R.string.menu_rem_repo) .setIcon(android.R.drawable.ic_menu_close_clear_cancel); MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT); return true;// ww w.ja v a 2s . c o m }
From source file:com.ksharkapps.musicnow.ui.fragments.profile.FavoriteFragment.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; if (info.position > 0) { mSelectedPosition = info.position - 1; // Creat a new song mSong = mAdapter.getItem(mSelectedPosition); mSelectedId = mSong.mSongId; mArtistName = mSong.mArtistName; // Play the song menu.add(GROUP_ID, FragmentMenuItems.PLAY_SELECTION, Menu.NONE, getString(R.string.context_menu_play_selection)); // Play next 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, false); // 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)); // Remove from favorites menu.add(GROUP_ID, FragmentMenuItems.REMOVE_FROM_FAVORITES, Menu.NONE, getString(R.string.remove_from_favorites)); // 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.LastAddedFragment.java
/** * {@inheritDoc}/*from w w w . j av a 2s.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 = Long.valueOf(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)); // 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(getSherlockActivity(), GROUP_ID, subMenu, false); // 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.ArtistFragment.java
/** * {@inheritDoc}// w w w . j a v 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; // Creat a new model mArtist = mAdapter.getItem(info.position); // Create a list of the artist's songs mArtistList = MusicUtils.getSongListForArtist(getActivity(), mArtist.mArtistId); // Play the artist menu.add(GROUP_ID, FragmentMenuItems.PLAY_SELECTION, Menu.NONE, getString(R.string.context_menu_play_selection)); // Add the artist to the queue menu.add(GROUP_ID, FragmentMenuItems.ADD_TO_QUEUE, Menu.NONE, getString(R.string.add_to_queue)); // Add the artist 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 artist menu.add(GROUP_ID, FragmentMenuItems.DELETE, Menu.NONE, getString(R.string.context_menu_delete)); }
From source file:com.code.android.vibevault.ShowDetailsScreen.java
/** Create the activity, taking into account ongoing dialogs or already downloaded data. * * If there is a retained ParseShowDetailsPageTask, set its parent * activity to the newly created ShowDetailsScreen (the old one was * destroyed because of an orientation change or something. This * way, the ParseShowDetailsPageTask does not leak any of the Views * from the old ShowDetailsScreen. Also, grab the songs from the * ParseShowDetailsPageTask to refresh the list of songs with. */// www .java 2 s . c o m @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.show_details_screen); Intent intent = getIntent(); Bundle b = intent.getExtras(); if (b != null) { show = (ArchiveShowObj) b.get("Show"); } if (show == null) { if (intent.getScheme().equals("http")) { Uri link = intent.getData(); String linkString = link.toString(); if (linkString.contains("/download/")) { String[] paths = linkString.split("/"); for (int i = 0; i < paths.length; i++) { if (paths[i].equals("download")) { show = new ArchiveShowObj(Uri.parse("http://www.archive.org/details/" + paths[i + 1]), true); show.setSelectedSong(linkString); } } } else { show = new ArchiveShowObj(link, false); } } } // // showTitle = show.getArtistAndTitle(); showLabel = (TextView) findViewById(R.id.ShowLabel); showLabel.setText(showTitle); trackList = (ListView) findViewById(R.id.SongsListView); trackList.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> a, View v, int position, long id) { playShow(position); Intent i = new Intent(ShowDetailsScreen.this, NowPlayingScreen.class); startActivity(i); } }); trackList.setOnCreateContextMenuListener(new OnCreateContextMenuListener() { @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { menu.add(Menu.NONE, VibeVault.ADD_SONG_TO_QUEUE, Menu.NONE, "Add to playlist"); menu.add(Menu.NONE, VibeVault.DOWNLOAD_SONG, Menu.NONE, "Download Song"); menu.add(Menu.NONE, VibeVault.EMAIL_LINK, Menu.NONE, "Email Link to Song"); } }); downloadLinks = new ArrayList<ArchiveSongObj>(); Object retained = getLastNonConfigurationInstance(); if (retained instanceof ParseShowDetailsPageTask) { workerTask = (ParseShowDetailsPageTask) retained; workerTask.setActivity(this); downloadLinks = workerTask.songs; } else if (show.getShowURL() != null) { workerTask = new ParseShowDetailsPageTask(this); workerTask.execute(show); } }
From source file:com.boko.vimusic.ui.fragments.ArtistFragment.java
/** * {@inheritDoc}/*from ww w . j ava 2 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; // Creat a new model mArtist = mAdapter.getItem(info.position); // Create a list of the artist's songs mArtistList = MusicUtils.getSongListForArtist(getActivity(), mArtist.getId()); // Play the artist menu.add(GROUP_ID, FragmentMenuItems.PLAY_SELECTION, Menu.NONE, getString(R.string.context_menu_play_selection)); // Add the artist to the queue menu.add(GROUP_ID, FragmentMenuItems.ADD_TO_QUEUE, Menu.NONE, getString(R.string.add_to_queue)); // Add the artist 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 artist menu.add(GROUP_ID, FragmentMenuItems.DELETE, Menu.NONE, getString(R.string.context_menu_delete)); }
From source file:ru.mtuci.musicanalyzer.apollo.ui.fragments.profile.LastAddedFragment.java
/** * {@inheritDoc}//w w w. j a v 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; 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)); // 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, false); // 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.ArtistSongFragment.java
/** * {@inheritDoc}//from w ww .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.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 next 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.boko.vimusic.ui.fragments.profile.ArtistSongFragment.java
/** * {@inheritDoc}//www. j av a2s . 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 next 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.ArtistFragment.java
/** * {@inheritDoc}/*from w w w. ja 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; // Creat a new model mArtist = mAdapter.getItem(info.position); // Create a list of the artist's songs mArtistList = MusicUtils.getSongListForArtist(getSherlockActivity(), mArtist.mArtistId); // Play the artist menu.add(GROUP_ID, FragmentMenuItems.PLAY_SELECTION, Menu.NONE, getString(R.string.context_menu_play_selection)); // Add the artist to the queue menu.add(GROUP_ID, FragmentMenuItems.ADD_TO_QUEUE, Menu.NONE, getString(R.string.add_to_queue)); // Add the artist 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 artist menu.add(GROUP_ID, FragmentMenuItems.DELETE, Menu.NONE, getString(R.string.context_menu_delete)); }