Fixed queue reset when a song is clicked in Playing queue fragment
This commit is contained in:
parent
2f818ce65f
commit
7a82883f57
5 changed files with 11 additions and 17 deletions
|
@ -136,7 +136,6 @@ const val ARTIST_DETAIL_SONG_SORT_ORDER = "artist_detail_song_sort_order"
|
||||||
const val LYRICS_OPTIONS = "lyrics_tab_position"
|
const val LYRICS_OPTIONS = "lyrics_tab_position"
|
||||||
const val CHOOSE_EQUALIZER = "choose_equalizer"
|
const val CHOOSE_EQUALIZER = "choose_equalizer"
|
||||||
const val EQUALIZER = "equalizer"
|
const val EQUALIZER = "equalizer"
|
||||||
const val TOGGLE_SHUFFLE = "toggle_shuffle"
|
|
||||||
const val SONG_GRID_STYLE = "song_grid_style"
|
const val SONG_GRID_STYLE = "song_grid_style"
|
||||||
const val PAUSE_ON_ZERO_VOLUME = "pause_on_zero_volume"
|
const val PAUSE_ON_ZERO_VOLUME = "pause_on_zero_volume"
|
||||||
const val FILTER_SONG = "filter_song"
|
const val FILTER_SONG = "filter_song"
|
||||||
|
|
|
@ -42,7 +42,7 @@ class PlayingQueueAdapter(
|
||||||
activity: FragmentActivity,
|
activity: FragmentActivity,
|
||||||
dataSet: MutableList<Song>,
|
dataSet: MutableList<Song>,
|
||||||
private var current: Int,
|
private var current: Int,
|
||||||
itemLayoutRes: Int
|
itemLayoutRes: Int,
|
||||||
) : SongAdapter(
|
) : SongAdapter(
|
||||||
activity, dataSet, itemLayoutRes, null
|
activity, dataSet, itemLayoutRes, null
|
||||||
), DraggableItemAdapter<PlayingQueueAdapter.ViewHolder>,
|
), DraggableItemAdapter<PlayingQueueAdapter.ViewHolder>,
|
||||||
|
@ -153,6 +153,14 @@ class PlayingQueueAdapter(
|
||||||
dragView?.isVisible = true
|
dragView?.isVisible = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onClick(v: View?) {
|
||||||
|
if (isInQuickSelectMode) {
|
||||||
|
toggleChecked(layoutPosition)
|
||||||
|
} else {
|
||||||
|
MusicPlayerRemote.playSongAt(layoutPosition)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onSongMenuItemClick(item: MenuItem): Boolean {
|
override fun onSongMenuItemClick(item: MenuItem): Boolean {
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
R.id.action_remove_from_playing_queue -> {
|
R.id.action_remove_from_playing_queue -> {
|
||||||
|
@ -209,7 +217,7 @@ class PlayingQueueAdapter(
|
||||||
internal class SwipedResultActionRemoveItem(
|
internal class SwipedResultActionRemoveItem(
|
||||||
private val adapter: PlayingQueueAdapter,
|
private val adapter: PlayingQueueAdapter,
|
||||||
private val position: Int,
|
private val position: Int,
|
||||||
private val activity: FragmentActivity
|
private val activity: FragmentActivity,
|
||||||
) : SwipeResultActionRemoveItem() {
|
) : SwipeResultActionRemoveItem() {
|
||||||
|
|
||||||
private var songToRemove: Song? = null
|
private var songToRemove: Song? = null
|
||||||
|
|
|
@ -171,9 +171,6 @@ object MusicPlayerRemote : KoinComponent {
|
||||||
return musicService?.playingQueue?.size ?: -1
|
return musicService?.playingQueue?.size ?: -1
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Async
|
|
||||||
*/
|
|
||||||
fun playSongAt(position: Int) {
|
fun playSongAt(position: Int) {
|
||||||
musicService?.playSongAt(position)
|
musicService?.playSongAt(position)
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,7 @@ object PreferenceUtil {
|
||||||
putString(SAF_SDCARD_URI, value)
|
putString(SAF_SDCARD_URI, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
val autoDownloadImagesPolicy
|
private val autoDownloadImagesPolicy
|
||||||
get() = sharedPreferences.getStringOrDefault(
|
get() = sharedPreferences.getStringOrDefault(
|
||||||
AUTO_DOWNLOAD_IMAGES_POLICY,
|
AUTO_DOWNLOAD_IMAGES_POLICY,
|
||||||
"only_wifi"
|
"only_wifi"
|
||||||
|
@ -242,8 +242,6 @@ object PreferenceUtil {
|
||||||
|
|
||||||
val isScreenOnEnabled get() = sharedPreferences.getBoolean(KEEP_SCREEN_ON, false)
|
val isScreenOnEnabled get() = sharedPreferences.getBoolean(KEEP_SCREEN_ON, false)
|
||||||
|
|
||||||
val isShuffleModeOn get() = sharedPreferences.getBoolean(TOGGLE_SHUFFLE, false)
|
|
||||||
|
|
||||||
val isSongInfo get() = sharedPreferences.getBoolean(EXTRA_SONG_INFO, false)
|
val isSongInfo get() = sharedPreferences.getBoolean(EXTRA_SONG_INFO, false)
|
||||||
|
|
||||||
val isPauseOnZeroVolume get() = sharedPreferences.getBoolean(PAUSE_ON_ZERO_VOLUME, false)
|
val isPauseOnZeroVolume get() = sharedPreferences.getBoolean(PAUSE_ON_ZERO_VOLUME, false)
|
||||||
|
|
|
@ -56,14 +56,6 @@
|
||||||
android:title="@string/pref_title_toggle_toggle_headset"
|
android:title="@string/pref_title_toggle_toggle_headset"
|
||||||
app:icon="@drawable/ic_play_arrow" />
|
app:icon="@drawable/ic_play_arrow" />
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="toggle_shuffle"
|
|
||||||
android:layout="@layout/list_item_view_switch"
|
|
||||||
android:summary="@string/pref_summary_toggle_shuffle"
|
|
||||||
android:title="@string/pref_title_toggle_toggle_shuffle"
|
|
||||||
app:icon="@drawable/ic_shuffle" />
|
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
|
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="bluetooth_playback"
|
android:key="bluetooth_playback"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue