Fix crash with fast scroller
Fix an issue where the app would crash if the fast scroller is scrolled above the indicators. This change will be backported to 1.3.3.
This commit is contained in:
parent
ec78684c25
commit
54efad3fdf
3 changed files with 8 additions and 4 deletions
|
@ -208,7 +208,7 @@ class PlaybackService : Service(), Player.EventListener, PlaybackStateManager.Ca
|
||||||
}
|
}
|
||||||
|
|
||||||
// We use the wakelock to ensure that the CPU is active while music is being loaded
|
// We use the wakelock to ensure that the CPU is active while music is being loaded
|
||||||
holdWakelock()
|
acquireWakeLock()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPlayerError(error: ExoPlaybackException) {
|
override fun onPlayerError(error: ExoPlaybackException) {
|
||||||
|
@ -439,8 +439,10 @@ class PlaybackService : Service(), Player.EventListener, PlaybackStateManager.Ca
|
||||||
/**
|
/**
|
||||||
* Hold the wakelock for the default amount of time [25 Seconds]
|
* Hold the wakelock for the default amount of time [25 Seconds]
|
||||||
*/
|
*/
|
||||||
private fun holdWakelock() {
|
private fun acquireWakeLock() {
|
||||||
wakeLock.acquire(WAKELOCK_TIME)
|
wakeLock.acquire(WAKELOCK_TIME)
|
||||||
|
|
||||||
|
logD("Wakelock is held.")
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -449,6 +451,8 @@ class PlaybackService : Service(), Player.EventListener, PlaybackStateManager.Ca
|
||||||
private fun releaseWakelock() {
|
private fun releaseWakelock() {
|
||||||
if (wakeLock.isHeld) {
|
if (wakeLock.isHeld) {
|
||||||
wakeLock.release()
|
wakeLock.release()
|
||||||
|
|
||||||
|
logD("Wakelock is released.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -218,6 +218,6 @@ class FastScrollView @JvmOverloads constructor(
|
||||||
* Returns if the pointer is currently in the view
|
* Returns if the pointer is currently in the view
|
||||||
*/
|
*/
|
||||||
private fun View.isBeingPressed(x: Int, y: Int): Boolean {
|
private fun View.isBeingPressed(x: Int, y: Int): Boolean {
|
||||||
return (x in (left until right) && y in (top until bottom)) || isPressed
|
return y in (top until bottom)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
- Fixed crash that would prevent the playback state from being saved
|
- Fixed crash that would prevent the playback state from being saved
|
||||||
- Integrated fast-scroller completely in codebase
|
- Completely integrated fast-scroller into codebase
|
Loading…
Reference in a new issue