Skip to content

Commit

Permalink
feat(android): set originalFitsSystemWindows on fullscreen open (#4013)
Browse files Browse the repository at this point in the history
  • Loading branch information
imalgrab authored Jul 17, 2024
1 parent 7611da1 commit 2f70c02
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -2238,6 +2239,7 @@ public void setFullscreen(boolean fullscreen) {
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);
Expand All @@ -2251,7 +2253,7 @@ public void setFullscreen(boolean fullscreen) {
setControls(controls);
}
UiThreadUtil.runOnUiThread(() -> {
WindowCompat.setDecorFitsSystemWindows(window, true);
WindowCompat.setDecorFitsSystemWindows(window, originalFitsSystemWindows);
controller.show(WindowInsetsCompat.Type.systemBars());
eventEmitter.onVideoFullscreenPlayerDidDismiss.invoke();
});
Expand Down

0 comments on commit 2f70c02

Please sign in to comment.