Merge pull request #3544 from Bnyro/master

Fix black bar on displays with cutout/notch
This commit is contained in:
Bnyro 2023-04-13 13:08:41 +02:00 committed by GitHub
commit bbdb77e479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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