Improved the full screen mode since the systemBars were visible in fullScreen mode.

This commit is contained in:
MohitMaliFtechiz 2024-12-27 14:35:01 +05:30 committed by Kelson
parent 0c15a406f0
commit d94ca866df

View File

@ -96,7 +96,7 @@ fun View.showFullScreenMode(window: Window) {
WindowCompat.setDecorFitsSystemWindows(window, false) WindowCompat.setDecorFitsSystemWindows(window, false)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
WindowInsetsControllerCompat(window, window.decorView).apply { WindowInsetsControllerCompat(window, window.decorView).apply {
hide(WindowInsetsCompat.Type.statusBars()) hide(WindowInsetsCompat.Type.systemBars())
hide(WindowInsetsCompat.Type.displayCutout()) hide(WindowInsetsCompat.Type.displayCutout())
systemBarsBehavior = systemBarsBehavior =
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
@ -113,7 +113,7 @@ fun View.closeFullScreenMode(window: Window) {
WindowCompat.setDecorFitsSystemWindows(window, true) WindowCompat.setDecorFitsSystemWindows(window, true)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
WindowInsetsControllerCompat(window, window.decorView).apply { WindowInsetsControllerCompat(window, window.decorView).apply {
show(WindowInsetsCompat.Type.statusBars()) show(WindowInsetsCompat.Type.systemBars())
show(WindowInsetsCompat.Type.displayCutout()) show(WindowInsetsCompat.Type.displayCutout())
} }
} }