fix: regressions by persistent notification lifecycle fix

This commit is contained in:
Bnyro 2023-12-30 16:20:46 +01:00
parent 65f113c445
commit 2e551c8226

View File

@ -448,7 +448,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
viewModel.isMiniPlayerVisible.value = false viewModel.isMiniPlayerVisible.value = false
// re-enable captions // re-enable captions
updateCurrentSubtitle(currentSubtitle) updateCurrentSubtitle(currentSubtitle)
enableController() binding.player.useController = true
commentsViewModel.setCommentSheetExpand(true) commentsViewModel.setCommentSheetExpand(true)
mainMotionLayout.progress = 0F mainMotionLayout.progress = 0F
changeOrientationMode() changeOrientationMode()
@ -468,7 +468,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
binding.playerMotionLayout binding.playerMotionLayout
.addSwipeUpListener { .addSwipeUpListener {
if (this::streams.isInitialized && PlayerHelper.fullscreenGesturesEnabled) { if (this::streams.isInitialized && PlayerHelper.fullscreenGesturesEnabled) {
disableController() binding.player.hideController()
setFullscreen() setFullscreen()
} }
} }
@ -536,7 +536,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
// hide fullscreen button if autorotation enabled // hide fullscreen button if autorotation enabled
playerBinding.fullscreen.setOnClickListener { playerBinding.fullscreen.setOnClickListener {
// hide player controller // hide player controller
disableController() binding.player.hideController()
if (viewModel.isFullscreen.value == false) { if (viewModel.isFullscreen.value == false) {
// go to fullscreen mode // go to fullscreen mode
setFullscreen() setFullscreen()
@ -1541,7 +1541,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
openOrCloseFullscreenDialog(true) openOrCloseFullscreenDialog(true)
} else { } else {
enableController() binding.player.useController = true
// close button got clicked in PiP mode // close button got clicked in PiP mode
// pause the video and keep the app alive // pause the video and keep the app alive
@ -1676,10 +1676,6 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
} }
} }
private fun enableController() {
binding.player.useController = true
}
private fun disableController() { private fun disableController() {
binding.player.useController = false binding.player.useController = false
binding.player.hideController() binding.player.hideController()