File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/fragments/detail Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1109,6 +1109,14 @@ public void openVideoPlayer(final boolean directlyFullscreenIfApplicable) {
11091109 && PlayerHelper .isStartMainPlayerFullscreenEnabled (requireContext ())
11101110 && !DeviceUtils .isLandscape (requireContext ())
11111111 && PlayerHelper .globalScreenOrientationLocked (requireContext ())) {
1112+ // Make sure the bottom sheet turns out expanded. When this code kicks in the bottom
1113+ // sheet could not have fully expanded yet, and thus be in the STATE_SETTLING state.
1114+ // When the activity is rotated, and its state is saved and then restored, the bottom
1115+ // sheet would forget what it was doing, since even if STATE_SETTLING is restored, it
1116+ // doesn't tell which state it was settling to, and thus the bottom sheet settles to
1117+ // STATE_COLLAPSED. This can be solved by manually setting the state that will be
1118+ // restored (i.e. bottomSheetState) to STATE_EXPANDED.
1119+ bottomSheetState = BottomSheetBehavior .STATE_EXPANDED ;
11121120 // toggle landscape in order to open directly in fullscreen
11131121 onScreenRotationButtonClicked ();
11141122 }
You can’t perform that action at this time.
0 commit comments