mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
Merge pull request #4802 from Bnyro/master
fix: crash when view handler got destroyed
This commit is contained in:
commit
00220d5985
@ -235,13 +235,13 @@ open class CustomExoPlayerView(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun enqueueHideControllerTask() {
|
private fun enqueueHideControllerTask() {
|
||||||
handler.postDelayed(AUTO_HIDE_CONTROLLER_DELAY, HIDE_CONTROLLER_TOKEN) {
|
runnableHandler.postDelayed(AUTO_HIDE_CONTROLLER_DELAY, HIDE_CONTROLLER_TOKEN) {
|
||||||
hideController()
|
hideController()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun cancelHideControllerTask() {
|
private fun cancelHideControllerTask() {
|
||||||
handler?.removeCallbacksAndMessages(HIDE_CONTROLLER_TOKEN)
|
runnableHandler.removeCallbacksAndMessages(HIDE_CONTROLLER_TOKEN)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hideController() {
|
override fun hideController() {
|
||||||
@ -436,7 +436,7 @@ open class CustomExoPlayerView(
|
|||||||
.setDuration((ANIMATION_DURATION * 1.5).toLong())
|
.setDuration((ANIMATION_DURATION * 1.5).toLong())
|
||||||
.withEndAction {
|
.withEndAction {
|
||||||
// move the text back into the button
|
// move the text back into the button
|
||||||
handler.postDelayed(100) {
|
runnableHandler.postDelayed(100) {
|
||||||
textView.animate()
|
textView.animate()
|
||||||
.setDuration(ANIMATION_DURATION / 2)
|
.setDuration(ANIMATION_DURATION / 2)
|
||||||
.translationX(0f)
|
.translationX(0f)
|
||||||
|
Loading…
Reference in New Issue
Block a user