Skip to content

Commit 96b930c

Browse files
committed
Revert "Respect cutouts when playing in MultiWindow"
This reverts commit c92a907.
1 parent af80d96 commit 96b930c

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,9 +1994,7 @@ private void showSystemUi() {
19941994
// Prevent jumping of the player on devices with cutout
19951995
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
19961996
activity.getWindow().getAttributes().layoutInDisplayCutoutMode =
1997-
isMultiWindowOrFullscreen()
1998-
? WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER
1999-
: WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT;
1997+
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT;
20001998
}
20011999
activity.getWindow().getDecorView().setSystemUiVisibility(0);
20022000
activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
@@ -2018,9 +2016,7 @@ private void hideSystemUi() {
20182016
// Prevent jumping of the player on devices with cutout
20192017
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
20202018
activity.getWindow().getAttributes().layoutInDisplayCutoutMode =
2021-
isMultiWindowOrFullscreen()
2022-
? WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER
2023-
: WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
2019+
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
20242020
}
20252021
int visibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
20262022
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
@@ -2037,7 +2033,7 @@ private void hideSystemUi() {
20372033
activity.getWindow().getDecorView().setSystemUiVisibility(visibility);
20382034

20392035
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
2040-
&& isMultiWindowOrFullscreen()) {
2036+
&& (isInMultiWindow || (isPlayerAvailable() && player.isFullscreen()))) {
20412037
activity.getWindow().setStatusBarColor(Color.TRANSPARENT);
20422038
activity.getWindow().setNavigationBarColor(Color.TRANSPARENT);
20432039
}
@@ -2053,11 +2049,6 @@ public void hideSystemUiIfNeeded() {
20532049
}
20542050
}
20552051

2056-
private boolean isMultiWindowOrFullscreen() {
2057-
return DeviceUtils.isInMultiWindow(activity)
2058-
|| (isPlayerAvailable() && player.isFullscreen());
2059-
}
2060-
20612052
private boolean playerIsNotStopped() {
20622053
return isPlayerAvailable() && !player.isStopped();
20632054
}

0 commit comments

Comments
 (0)