Skip to content

Commit

Permalink
Merge pull request #4802 from Bnyro/master
Browse files Browse the repository at this point in the history
fix: crash when view handler got destroyed
  • Loading branch information
Bnyro authored Sep 17, 2023
2 parents 8063a67 + 749a616 commit 00220d5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,13 @@ open class CustomExoPlayerView(
}

private fun enqueueHideControllerTask() {
handler.postDelayed(AUTO_HIDE_CONTROLLER_DELAY, HIDE_CONTROLLER_TOKEN) {
runnableHandler.postDelayed(AUTO_HIDE_CONTROLLER_DELAY, HIDE_CONTROLLER_TOKEN) {
hideController()
}
}

private fun cancelHideControllerTask() {
handler?.removeCallbacksAndMessages(HIDE_CONTROLLER_TOKEN)
runnableHandler.removeCallbacksAndMessages(HIDE_CONTROLLER_TOKEN)
}

override fun hideController() {
Expand Down Expand Up @@ -436,7 +436,7 @@ open class CustomExoPlayerView(
.setDuration((ANIMATION_DURATION * 1.5).toLong())
.withEndAction {
// move the text back into the button
handler.postDelayed(100) {
runnableHandler.postDelayed(100) {
textView.animate()
.setDuration(ANIMATION_DURATION / 2)
.translationX(0f)
Expand Down

0 comments on commit 00220d5

Please sign in to comment.