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:
parent
732b89a0b1
commit
90de930377
3 changed files with 4 additions and 6 deletions
|
@ -98,7 +98,7 @@ dependencies {
|
||||||
implementation "com.google.android.exoplayer:extension-mediasession:$exoplayer_version"
|
implementation "com.google.android.exoplayer:extension-mediasession:$exoplayer_version"
|
||||||
|
|
||||||
// Image loading
|
// Image loading
|
||||||
implementation "io.coil-kt:coil:1.1.1"
|
implementation "io.coil-kt:coil:1.2.0"
|
||||||
|
|
||||||
// Material
|
// Material
|
||||||
implementation "com.google.android.material:material:1.3.0"
|
implementation "com.google.android.material:material:1.3.0"
|
||||||
|
|
|
@ -260,16 +260,14 @@ class PlaybackStateManager private constructor() {
|
||||||
|
|
||||||
forceUserQueueUpdate()
|
forceUserQueueUpdate()
|
||||||
} else {
|
} else {
|
||||||
// Increment the index.
|
// Increment the index, if it cannot be incremented any further, then
|
||||||
// If it cant be incremented anymore, end playback or loop depending on the setting.
|
// loop and pause/resume playback depending on the setting
|
||||||
if (mIndex < mQueue.lastIndex) {
|
if (mIndex < mQueue.lastIndex) {
|
||||||
mIndex = mIndex.inc()
|
mIndex = mIndex.inc()
|
||||||
updatePlayback(mQueue[mIndex])
|
updatePlayback(mQueue[mIndex])
|
||||||
} else {
|
} else {
|
||||||
mIndex = 0
|
mIndex = 0
|
||||||
updatePlayback(mQueue[mIndex], shouldPlay = mLoopMode == LoopMode.ALL)
|
updatePlayback(mQueue[mIndex], shouldPlay = mLoopMode == LoopMode.ALL)
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
forceQueueUpdate()
|
forceQueueUpdate()
|
||||||
|
|
|
@ -65,7 +65,7 @@ class SlideLinearLayout @JvmOverloads constructor(
|
||||||
var consumed = false
|
var consumed = false
|
||||||
|
|
||||||
children.forEach { view ->
|
children.forEach { view ->
|
||||||
consumed = consumed or super.drawChild(canvas, view, drawingTime)
|
consumed = consumed || super.drawChild(canvas, view, drawingTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
return consumed
|
return consumed
|
||||||
|
|
Loading…
Reference in a new issue