Added preference to turn off shuffle mode when selecting new list of songs (#527)
An option to turn sticky shuffle on or off. It's enabled by default so it keeps the current functionality the same. I noticed every other player has it so hopefully you don't have any issues with it being in the app.
This commit is contained in:
parent
21de932e32
commit
6624fcd505
4 changed files with 18 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ import com.kabouzeid.gramophone.R;
|
|||
import com.kabouzeid.gramophone.loader.SongLoader;
|
||||
import com.kabouzeid.gramophone.model.Song;
|
||||
import com.kabouzeid.gramophone.service.MusicService;
|
||||
import com.kabouzeid.gramophone.util.PreferenceUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -176,6 +177,9 @@ public class MusicPlayerRemote {
|
|||
public static void openQueue(final ArrayList<Song> queue, final int startPosition, final boolean startPlaying) {
|
||||
if (!tryToHandleOpenPlayingQueue(queue, startPosition, startPlaying) && musicService != null) {
|
||||
musicService.openQueue(queue, startPosition, startPlaying);
|
||||
if (!PreferenceUtil.getInstance(musicService).rememberShuffle()){
|
||||
setShuffleMode(MusicService.SHUFFLE_MODE_NONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@ public final class PreferenceUtil {
|
|||
|
||||
public static final String LIBRARY_CATEGORIES = "library_categories";
|
||||
|
||||
private static final String REMEMBER_SHUFFLE = "remember_shuffle";
|
||||
|
||||
private static PreferenceUtil sInstance;
|
||||
|
||||
private final SharedPreferences mPreferences;
|
||||
|
|
@ -432,6 +434,10 @@ public final class PreferenceUtil {
|
|||
return mPreferences.getBoolean(INTRO_SHOWN, false);
|
||||
}
|
||||
|
||||
public final boolean rememberShuffle() {
|
||||
return mPreferences.getBoolean(REMEMBER_SHUFFLE, true);
|
||||
}
|
||||
|
||||
public final String autoDownloadImagesPolicy() {
|
||||
return mPreferences.getString(AUTO_DOWNLOAD_IMAGES_POLICY, "only_wifi");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue