mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
Restore the orientation before entering PiP
This commit is contained in:
parent
12e285f508
commit
dc16223b9a
@ -262,8 +262,8 @@ class PlayerFragment : Fragment(R.layout.fragment_player), OnlinePlayerOptions {
|
|||||||
* somehow the bottom bar is invisible on low screen resolutions, this fixes it
|
* somehow the bottom bar is invisible on low screen resolutions, this fixes it
|
||||||
*/
|
*/
|
||||||
private fun showBottomBar() {
|
private fun showBottomBar() {
|
||||||
if (isAdded && binding.player.isPlayerLocked) {
|
if (isAdded && !binding.player.isPlayerLocked) {
|
||||||
binding.player.binding.bottomBar.isVisible = true
|
playerBinding.bottomBar.isVisible = true
|
||||||
}
|
}
|
||||||
handler.postDelayed(this::showBottomBar, 100)
|
handler.postDelayed(this::showBottomBar, 100)
|
||||||
}
|
}
|
||||||
@ -1387,9 +1387,6 @@ class PlayerFragment : Fragment(R.layout.fragment_player), OnlinePlayerOptions {
|
|||||||
binding.player.hideController()
|
binding.player.hideController()
|
||||||
binding.player.useController = false
|
binding.player.useController = false
|
||||||
|
|
||||||
// set portrait mode
|
|
||||||
unsetFullscreen()
|
|
||||||
|
|
||||||
if (viewModel.isMiniPlayerVisible.value == true) {
|
if (viewModel.isMiniPlayerVisible.value == true) {
|
||||||
binding.playerMotionLayout.transitionToStart()
|
binding.playerMotionLayout.transitionToStart()
|
||||||
viewModel.isMiniPlayerVisible.value = false
|
viewModel.isMiniPlayerVisible.value = false
|
||||||
@ -1401,8 +1398,6 @@ class PlayerFragment : Fragment(R.layout.fragment_player), OnlinePlayerOptions {
|
|||||||
}
|
}
|
||||||
binding.linLayout.visibility = View.GONE
|
binding.linLayout.visibility = View.GONE
|
||||||
|
|
||||||
viewModel.isFullscreen.value = false
|
|
||||||
|
|
||||||
updateCaptionsLanguage(null)
|
updateCaptionsLanguage(null)
|
||||||
} else {
|
} else {
|
||||||
// close button got clicked in PiP mode
|
// close button got clicked in PiP mode
|
||||||
@ -1412,11 +1407,14 @@ class PlayerFragment : Fragment(R.layout.fragment_player), OnlinePlayerOptions {
|
|||||||
// enable exoPlayer controls again
|
// enable exoPlayer controls again
|
||||||
binding.player.useController = true
|
binding.player.useController = true
|
||||||
|
|
||||||
|
// set back to protrait mode
|
||||||
|
if (viewModel.isFullscreen.value != true) {
|
||||||
with(binding.playerMotionLayout) {
|
with(binding.playerMotionLayout) {
|
||||||
getConstraintSet(R.id.start).constrainHeight(R.id.player, 0)
|
getConstraintSet(R.id.start).constrainHeight(R.id.player, 0)
|
||||||
enableTransition(R.id.yt_transition, true)
|
enableTransition(R.id.yt_transition, true)
|
||||||
}
|
}
|
||||||
binding.linLayout.visibility = View.VISIBLE
|
binding.linLayout.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
updateCaptionsLanguage(captionLanguage)
|
updateCaptionsLanguage(captionLanguage)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user