Skip to content

Commit

Permalink
Merge pull request #5174 from Zoo-M0/auto-fullscreen-bug
Browse files Browse the repository at this point in the history
fix: auto fullscreen stops working after first rotation
  • Loading branch information
Bnyro authored Nov 17, 2023
2 parents 1ff71fe + 98dc929 commit c84f445
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,15 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
override fun onTransitionCompleted(motionLayout: MotionLayout?, currentId: Int) {
if (_binding == null) return

if (currentId == transitionEndId) {
if (currentId == transitionStartId) {
viewModel.isMiniPlayerVisible.value = false
// re-enable captions
updateCurrentSubtitle(currentSubtitle)
binding.player.useController = true
commentsViewModel.setCommentSheetExpand(true)
mainMotionLayout.progress = 0F
changeOrientationMode()
} else if (currentId == transitionEndId) {
viewModel.isMiniPlayerVisible.value = true
// disable captions temporarily
updateCurrentSubtitle(null)
Expand All @@ -454,14 +462,6 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
binding.sbSkipBtn.isGone = true
mainMotionLayout.progress = 1F
(activity as MainActivity).requestOrientationChange()
} else if (currentId == transitionStartId) {
viewModel.isMiniPlayerVisible.value = false
// re-enable captions
updateCurrentSubtitle(currentSubtitle)
binding.player.useController = true
commentsViewModel.setCommentSheetExpand(true)
mainMotionLayout.progress = 0F
changeOrientationMode()
}
}
})
Expand Down Expand Up @@ -706,7 +706,10 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {

viewModel.isFullscreen.value = false

if (mainActivity.screenOrientationPref == ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT) {
if (
!PlayerHelper.autoFullscreenEnabled &&
mainActivity.screenOrientationPref == ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
) {
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
}

Expand Down

0 comments on commit c84f445

Please sign in to comment.