Skip to content

Commit

Permalink
fix: not full screen problem on notched devices
Browse files Browse the repository at this point in the history
  • Loading branch information
kadiraydinli committed Apr 23, 2023
1 parent 1efe764 commit 6367c11
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,30 @@ public void fullScreen(Boolean enabled, Promise promise) {
);
}
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
final Activity currentActivity = getCurrentActivity();
if (currentActivity == null) {
promise.reject("Error: ", "current activity is null");
return;
}
final Window view = currentActivity.getWindow();
runOnUiThread(
() -> {
view.clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
view.clearFlags(
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION
);

if (enabled) {
view.setFlags(
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION
);
}
}
);
}
}

/* Lean Back */
Expand Down

0 comments on commit 6367c11

Please sign in to comment.