Fix queue update issue

Fix a bug where the queue would not be updated when the queue looped around to the beginning.
This commit is contained in:
OxygenCobalt 2021-04-14 14:30:32 -06:00
parent 732b89a0b1
commit 90de930377
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
3 changed files with 4 additions and 6 deletions

View file

@ -98,7 +98,7 @@ dependencies {
implementation "com.google.android.exoplayer:extension-mediasession:$exoplayer_version"
// Image loading
implementation "io.coil-kt:coil:1.1.1"
implementation "io.coil-kt:coil:1.2.0"
// Material
implementation "com.google.android.material:material:1.3.0"

View file

@ -260,16 +260,14 @@ class PlaybackStateManager private constructor() {
forceUserQueueUpdate()
} else {
// Increment the index.
// If it cant be incremented anymore, end playback or loop depending on the setting.
// Increment the index, if it cannot be incremented any further, then
// loop and pause/resume playback depending on the setting
if (mIndex < mQueue.lastIndex) {
mIndex = mIndex.inc()
updatePlayback(mQueue[mIndex])
} else {
mIndex = 0
updatePlayback(mQueue[mIndex], shouldPlay = mLoopMode == LoopMode.ALL)
return
}
forceQueueUpdate()

View file

@ -65,7 +65,7 @@ class SlideLinearLayout @JvmOverloads constructor(
var consumed = false
children.forEach { view ->
consumed = consumed or super.drawChild(canvas, view, drawingTime)
consumed = consumed || super.drawChild(canvas, view, drawingTime)
}
return consumed