<!-- Context menu items -->
<string name="context_menu_play_selection">Play</string>
<string name="context_menu_play_next">Play next</string>
+ <string name="context_menu_play_album">Play album</string>
<string name="context_menu_more_by_artist">More by artist</string>
<string name="context_menu_rename_playlist">Rename</string>
<string name="context_menu_delete">Delete</string>
public interface FragmentMenuItems {
int PLAY_SELECTION = 10; // play the selected song, album, etc.
int PLAY_NEXT = 20; // queue a track to be played next
+ int PLAY_ALBUM = 25; // play the album that this track belongs to
// SHUFFLE = 30 // defined in res/menu
int ADD_TO_QUEUE = 40; // add to end of current queue
int ADD_TO_PLAYLIST = 50; // append to a playlist
}
/**
+ * Called when the user clicks "play album".
+ */
+ protected void playAlbum() {
+ throw new UnsupportedOperationException("Method Not Implemented!");
+ }
+
+ /**
* Creates the pop up menu by inflating the menu items
* @param menu Menu to use for adding to
*/
return new int[] {
FragmentMenuItems.PLAY_SELECTION,
FragmentMenuItems.PLAY_NEXT,
+ FragmentMenuItems.PLAY_ALBUM,
FragmentMenuItems.ADD_TO_QUEUE,
FragmentMenuItems.ADD_TO_PLAYLIST,
FragmentMenuItems.MORE_BY_ARTIST,
return R.string.remove_from_queue;
case FragmentMenuItems.PLAY_NEXT:
return R.string.context_menu_play_next;
+ case FragmentMenuItems.PLAY_ALBUM:
+ return R.string.context_menu_play_album;
case FragmentMenuItems.CHANGE_IMAGE:
return R.string.context_menu_change_image;
}
case FragmentMenuItems.PLAY_NEXT:
playNext();
return true;
+ case FragmentMenuItems.PLAY_ALBUM:
+ playAlbum();
+ return true;
default:
break;
}
}
@Override
+ protected void playAlbum() {
+ MusicUtils.playAlbum(mActivity, mSong.mAlbumId, 0, false);
+ }
+
+ @Override
protected long[] getIdList() {
return new long[] { mSong.mSongId };
}