mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
fix: navigation bar missing when closing player in fullscreen
This commit is contained in:
parent
ddde276866
commit
1aaa801657
@ -826,18 +826,28 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
|||||||
_binding = null
|
_binding = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manually kill the player fragment - call instead of using onDestroy directly
|
||||||
|
*/
|
||||||
private fun killPlayerFragment() {
|
private fun killPlayerFragment() {
|
||||||
viewModel.isFullscreen.value = false
|
binding.playerMotionLayout.transitionToEnd()
|
||||||
|
|
||||||
viewModel.isMiniPlayerVisible.value = false
|
viewModel.isMiniPlayerVisible.value = false
|
||||||
|
|
||||||
// dismiss the fullscreen dialog if it's currently visible
|
if (viewModel.isFullscreen.value == true) {
|
||||||
// otherwise it would stay alive while being detached from this fragment
|
unsetFullscreen()
|
||||||
fullscreenDialog.dismiss()
|
|
||||||
binding.player.currentWindow = null
|
|
||||||
|
|
||||||
binding.playerMotionLayout.transitionToEnd()
|
// wait a short amount of time for the unset fullscreen process to properly finish
|
||||||
mainActivity.supportFragmentManager.commit {
|
// (Android animations etc...)
|
||||||
remove(this@PlayerFragment)
|
handler.postDelayed(100) {
|
||||||
|
mainActivity.supportFragmentManager.commit {
|
||||||
|
remove(this@PlayerFragment)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
mainActivity.supportFragmentManager.commit {
|
||||||
|
remove(this@PlayerFragment)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user