Fix black bar on displays with cutout/notch

This commit is contained in:
Bnyro 2023-04-13 13:08:04 +02:00
parent 26713d31a6
commit 1710340bbf

View File

@ -20,6 +20,13 @@ object WindowHelper {
WindowCompat.setDecorFitsSystemWindows(window, !isFullscreen)
val layoutNoLimitsFlag = WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
if (isFullscreen) {
window.setFlags(layoutNoLimitsFlag, layoutNoLimitsFlag)
} else {
window.clearFlags(layoutNoLimitsFlag)
}
// Show the system bars when it is not fullscreen and hide them when it is fullscreen
// System bars means status bar and the navigation bar
// See: https://developer.android.com/training/system-ui/immersive#kotlin