Add shuffle all to every menu
This commit is contained in:
parent
07b9fbb599
commit
cb11044999
12 changed files with 112 additions and 46 deletions
|
|
@ -11,6 +11,7 @@ import android.widget.Toast;
|
|||
|
||||
import com.kabouzeid.gramophone.App;
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.loader.SongLoader;
|
||||
import com.kabouzeid.gramophone.misc.AppKeys;
|
||||
import com.kabouzeid.gramophone.model.MusicRemoteEvent;
|
||||
import com.kabouzeid.gramophone.model.Song;
|
||||
|
|
@ -20,6 +21,7 @@ import com.kabouzeid.gramophone.util.InternalStorageUtil;
|
|||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by karim on 29.11.14.
|
||||
|
|
@ -233,6 +235,12 @@ public class MusicPlayerRemote {
|
|||
}
|
||||
}
|
||||
|
||||
public static void shuffleAllSongs(final Context context){
|
||||
List<Song> songs = SongLoader.getAllSongs(context);
|
||||
MusicPlayerRemote.openQueue(songs, new Random().nextInt(songs.size()), true);
|
||||
forceSetShuffleMode(context, MusicService.SHUFFLE_MODE_SHUFFLE);
|
||||
}
|
||||
|
||||
public static void playNext(Song song) {
|
||||
if (musicService != null) {
|
||||
musicService.addSong(getPosition() + 1, song);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue