Commit 976f098 1 parent e5115d8 commit 976f098 Copy full SHA for 976f098
File tree 1 file changed +8
-0
lines changed
app/src/main/java/org/schabi/newpipe/fragments/detail
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1109,6 +1109,14 @@ public void openVideoPlayer(final boolean directlyFullscreenIfApplicable) {
1109
1109
&& PlayerHelper .isStartMainPlayerFullscreen (requireContext ())
1110
1110
&& !DeviceUtils .isLandscape (requireContext ())
1111
1111
&& 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 ;
1112
1120
// toggle landscape in order to open directly in fullscreen
1113
1121
onScreenRotationButtonClicked ();
1114
1122
}
You can’t perform that action at this time.
0 commit comments