From 34d96db14b1b3b57b09d2026e60def63d4742169 Mon Sep 17 00:00:00 2001 From: Moderpach <34941512+Moderpach@users.noreply.github.com> Date: Wed, 23 Aug 2023 17:50:20 +0800 Subject: [PATCH] Make navigation bar transparent in more devices. --- app/src/main/java/me/ash/reader/MainActivity.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/me/ash/reader/MainActivity.kt b/app/src/main/java/me/ash/reader/MainActivity.kt index b5db36442..e92f7d643 100644 --- a/app/src/main/java/me/ash/reader/MainActivity.kt +++ b/app/src/main/java/me/ash/reader/MainActivity.kt @@ -1,7 +1,10 @@ package me.ash.reader +import android.os.Build import android.os.Bundle import android.util.Log +import android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN +import android.view.WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.compose.runtime.CompositionLocalProvider @@ -33,6 +36,9 @@ class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) WindowCompat.setDecorFitsSystemWindows(window, false) + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + window.addFlags(FLAG_LAYOUT_IN_SCREEN or FLAG_LAYOUT_NO_LIMITS) + } Log.i("RLog", "onCreate: ${ProfileInstallerInitializer().create(this)}") // Set the language