feat(android): set originalFitsSystemWindows on fullscreen open (#4013)

This commit is contained in:
Igor Malgrab 2024-07-17 12:29:38 +02:00 committed by GitHub
parent 7611da155f
commit 2f70c02cdc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -202,6 +202,7 @@ public class ReactExoplayerView extends FrameLayout implements
private long resumePosition;
private boolean loadVideoStarted;
private boolean isFullscreen;
private boolean originalFitsSystemWindows;
private boolean isInBackground;
private boolean isPaused;
private boolean isBuffering;
@ -2238,6 +2239,7 @@ public class ReactExoplayerView extends FrameLayout implements
fullScreenPlayerView.show();
}
UiThreadUtil.runOnUiThread(() -> {
originalFitsSystemWindows = window.getDecorView().getFitsSystemWindows();
WindowCompat.setDecorFitsSystemWindows(window, false);
controller.hide(WindowInsetsCompat.Type.systemBars());
controller.setSystemBarsBehavior(WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
@ -2251,7 +2253,7 @@ public class ReactExoplayerView extends FrameLayout implements
setControls(controls);
}
UiThreadUtil.runOnUiThread(() -> {
WindowCompat.setDecorFitsSystemWindows(window, true);
WindowCompat.setDecorFitsSystemWindows(window, originalFitsSystemWindows);
controller.show(WindowInsetsCompat.Type.systemBars());
eventEmitter.onVideoFullscreenPlayerDidDismiss.invoke();
});