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:edu.illinois.whereru.FriendListFragment.java
@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.add(Menu.NONE, FRIEND_SETTING_MENU_ID, Menu.NONE, "Setting"); menu.add(Menu.NONE, FRIEND_REMOVE_MENU_ID, Menu.NONE, "Remove"); }
From source file:com.andrew.apollo.ui.fragments.SongFragment.java
/** * {@inheritDoc}/*from www . 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; mSelectedPosition = info.position; // 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, 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:cm.aptoide.pt.RemoteInTab.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); menu.add(Menu.NONE, SEARCH_MENU, 3, R.string.menu_search).setIcon(android.R.drawable.ic_menu_search); menu.add(Menu.NONE, SETTINGS, 4, R.string.menu_settings).setIcon(android.R.drawable.ic_menu_preferences); menu.add(Menu.NONE, ABOUT, 5, R.string.menu_about).setIcon(android.R.drawable.ic_menu_help); return true;/*from ww w . j a va 2s .co m*/ }
From source file:com.guayaba.tapir.ui.fragments.profile.FavoriteFragment.java
/** * {@inheritDoc}//from w ww . 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.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.boko.vimusic.ui.fragments.profile.FavoriteFragment.java
/** * {@inheritDoc}//www . 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; 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:ru.mtuci.musicanalyzer.apollo.ui.fragments.SongFragment.java
/** * {@inheritDoc}// w ww . java 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; // 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, 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.recipewizard.recipewizard.MainActivity.java
@Override public boolean onCreateOptionsMenu(Menu menu) { // only show options menu on portrait view super.onCreateOptionsMenu(menu); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.activity_main_actions, menu); menu.add(Menu.NONE, MENU_RESET_INGREDIENTS, Menu.NONE, getResources().getString(R.string.reset_ingredient_list)); return true;//from ww w. j av a2 s. c o m }
From source file:com.andrew.apollo.ui.fragments.profile.FavoriteFragment.java
/** * {@inheritDoc}/* www.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; mSelectedPosition = info.position - 1; // Creat a new song mSong = mAdapter.getItem(mSelectedPosition); mSelectedId = Long.valueOf(mSong.mSongId); 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)); // 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.grarak.kerneladiutor.fragments.tools.RecoveryFragment.java
private void addAction(Recovery.RECOVERY_COMMAND recovery_command, String path) { String summary = null;/*from w ww .j a v a 2s . c o m*/ switch (recovery_command) { case WIPE_DATA: summary = getString(R.string.wipe_data); break; case WIPE_CACHE: summary = getString(R.string.wipe_cache); break; case FLASH_ZIP: summary = new File(path).getName(); break; } final Recovery recovery = new Recovery(recovery_command, path == null ? null : new File(path)); mCommands.add(recovery); CardView cardView = new CardView(getActivity()); cardView.setOnMenuListener(new CardView.OnMenuListener() { @Override public void onMenuReady(final CardView cardView, PopupMenu popupMenu) { popupMenu.getMenu().add(Menu.NONE, 0, Menu.NONE, getString(R.string.delete)); popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { if (item.getItemId() == 0) { mCommands.remove(recovery); removeItem(cardView); } return false; } }); } }); DescriptionView descriptionView = new DescriptionView(); if (path != null) { descriptionView.setTitle(getString(R.string.flash_zip)); } descriptionView.setSummary(summary); cardView.addItem(descriptionView); addItem(cardView); }
From source file:com.guayaba.tapir.ui.fragments.RecentFragment.java
/** * {@inheritDoc}/*from w w w . j a v a2s . 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; // Create a new album mAlbum = mAdapter.getItem(info.position); // 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); // View more content by the album artist menu.add(GROUP_ID, FragmentMenuItems.MORE_BY_ARTIST, Menu.NONE, getString(R.string.context_menu_more_by_artist)); // Remove the album from the list menu.add(GROUP_ID, FragmentMenuItems.REMOVE_FROM_RECENT, Menu.NONE, getString(R.string.context_menu_remove_from_recent)); // Delete the album menu.add(GROUP_ID, FragmentMenuItems.DELETE, Menu.NONE, getString(R.string.context_menu_delete)); }