Add option to scroll to new track on song change (#802)
Adds a new setting to scroll the queue to the new song after a song change. The new song will be at the top of the view.
This commit is contained in:
1 parent
0a9297a16c
commit
a44d959716
5 files changed
+16
-1
No files matched your search
@@ -70,6 +70,7 @@ public class PrefDefaults {
|
||||
public static final int AUTOPLAYLIST_PLAYCOUNTS = 0;
|
||||
public static final boolean IGNORE_AUDIOFOCUS_LOSS = false;
|
||||
public static final boolean ENABLE_SCROLL_TO_SONG = false;
|
||||
public static final boolean QUEUE_ENABLE_SCROLL_TO_SONG = false;
|
||||
public static final boolean KEEP_SCREEN_ON = false;
|
||||
public static final String PLAYLIST_SYNC_MODE = "0";
|
||||
public static final String PLAYLIST_SYNC_FOLDER = "/sdcard/Playlists";
|
||||
|
||||
@@ -71,6 +71,7 @@ public class PrefKeys {
|
||||
public static final String AUTOPLAYLIST_PLAYCOUNTS = "playcounts_autoplaylist";
|
||||
public static final String IGNORE_AUDIOFOCUS_LOSS = "ignore_audiofocus_loss";
|
||||
public static final String ENABLE_SCROLL_TO_SONG = "enable_scroll_to_song";
|
||||
public static final String QUEUE_ENABLE_SCROLL_TO_SONG = "queue_enable_scroll_to_song";
|
||||
public static final String KEEP_SCREEN_ON = "keep_screen_on";
|
||||
public static final String PLAYLIST_SYNC_MODE = "playlist_sync_mode";
|
||||
public static final String PLAYLIST_SYNC_FOLDER = "playlist_sync_folder";
|
||||
|
||||
@@ -21,6 +21,7 @@ import android.annotation.SuppressLint;
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -237,7 +238,11 @@ public class ShowQueueFragment extends Fragment
|
||||
*/
|
||||
public void onTimelineChanged() {
|
||||
if (PlaybackService.hasInstance()) {
|
||||
refreshSongQueueList(false);
|
||||
boolean shouldScroll = PlaybackService
|
||||
.getSettings(getActivity().getApplicationContext())
|
||||
.getBoolean(PrefKeys.QUEUE_ENABLE_SCROLL_TO_SONG,
|
||||
PrefDefaults.QUEUE_ENABLE_SCROLL_TO_SONG);
|
||||
refreshSongQueueList(shouldScroll);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user