Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c530126 authored by Linus Lee's avatar Linus Lee Committed by Gerrit Code Review
Browse files

Merge "Eleven: Add a play Album option on songs" into cm-12.0

parents 2ee41ff1 40c54252
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@
    <!-- 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>
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ package com.cyanogenmod.eleven.menu;
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
+13 −0
Original line number Diff line number Diff line
@@ -151,6 +151,13 @@ public abstract class PopupMenuHelper implements PopupMenu.OnMenuItemClickListen
        MusicUtils.playNext(getIdList(), getSourceId(), getSourceType());
    }

    /**
     * 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
@@ -201,6 +208,7 @@ public abstract class PopupMenuHelper implements PopupMenu.OnMenuItemClickListen
                return new int[] {
                        FragmentMenuItems.PLAY_SELECTION,
                        FragmentMenuItems.PLAY_NEXT,
                        FragmentMenuItems.PLAY_ALBUM,
                        FragmentMenuItems.ADD_TO_QUEUE,
                        FragmentMenuItems.ADD_TO_PLAYLIST,
                        FragmentMenuItems.MORE_BY_ARTIST,
@@ -295,6 +303,8 @@ public abstract class PopupMenuHelper implements PopupMenu.OnMenuItemClickListen
                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;
        }
@@ -371,6 +381,9 @@ public abstract class PopupMenuHelper implements PopupMenu.OnMenuItemClickListen
                case FragmentMenuItems.PLAY_NEXT:
                    playNext();
                    return true;
                case FragmentMenuItems.PLAY_ALBUM:
                    playAlbum();
                    return true;
                default:
                    break;
            }
+5 −0
Original line number Diff line number Diff line
@@ -46,6 +46,11 @@ public abstract class SongPopupMenuHelper extends PopupMenuHelper {
        return PopupMenuType.Song;
    }

    @Override
    protected void playAlbum() {
        MusicUtils.playAlbum(mActivity, mSong.mAlbumId, 0, false);
    }

    @Override
    protected long[] getIdList() {
        return new long[] { mSong.mSongId };