Skip to content

Commit

Permalink
Merge pull request #7924 from litetex/revert-7451
Browse files Browse the repository at this point in the history
Revert "Respect cutouts when playing in MultiWindow"
  • Loading branch information
TobiGr authored Feb 21, 2022
2 parents 1030e09 + 96b930c commit c42f294
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1994,9 +1994,7 @@ private void showSystemUi() {
// Prevent jumping of the player on devices with cutout
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
activity.getWindow().getAttributes().layoutInDisplayCutoutMode =
isMultiWindowOrFullscreen()
? WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER
: WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT;
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT;
}
activity.getWindow().getDecorView().setSystemUiVisibility(0);
activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
Expand All @@ -2018,9 +2016,7 @@ private void hideSystemUi() {
// Prevent jumping of the player on devices with cutout
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
activity.getWindow().getAttributes().layoutInDisplayCutoutMode =
isMultiWindowOrFullscreen()
? WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER
: WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
}
int visibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
Expand All @@ -2037,7 +2033,7 @@ private void hideSystemUi() {
activity.getWindow().getDecorView().setSystemUiVisibility(visibility);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
&& isMultiWindowOrFullscreen()) {
&& (isInMultiWindow || (isPlayerAvailable() && player.isFullscreen()))) {
activity.getWindow().setStatusBarColor(Color.TRANSPARENT);
activity.getWindow().setNavigationBarColor(Color.TRANSPARENT);
}
Expand All @@ -2053,11 +2049,6 @@ public void hideSystemUiIfNeeded() {
}
}

private boolean isMultiWindowOrFullscreen() {
return DeviceUtils.isInMultiWindow(activity)
|| (isPlayerAvailable() && player.isFullscreen());
}

private boolean playerIsNotStopped() {
return isPlayerAvailable() && !player.isStopped();
}
Expand Down

0 comments on commit c42f294

Please sign in to comment.