set enableEdgeToEdge() directly in Activity´s onCreate() (#4889)

this fixes the black nav bar in some older android devices form factors running api 28
this issue only affects dark theme in my device, in light theme the nav bar is transparent as espected. this commits fixes this by ensuring edge to edge is applied - tested and worked

reference: https://developer.android.com/develop/ui/views/layout/edge-to-edge?hl=en#enable-edge-to-edge-display
This commit is contained in:
Rafael de Moura Dev authored and GitHub committed 2024-10-18 08:46:16 +08:00
1 parent aac1d7e023
commit 159177582f
1 file changed
+11
@@ -19,11 +19,14 @@ package app.lawnchair
import android.app.ActivityOptions
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.graphics.drawable.Drawable
import android.os.Bundle
import android.view.Display
import android.view.View
import android.view.ViewTreeObserver
import androidx.activity.SystemBarStyle
import androidx.activity.enableEdgeToEdge
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsControllerCompat
import androidx.lifecycle.lifecycleScope
@@ -109,6 +112,14 @@ class LawnchairLauncher : QuickstepLauncher() {
val gestureController by unsafeLazy { GestureController(this) }
override fun onCreate(savedInstanceState: Bundle?) {
if (!Utilities.ATLEAST_Q) {
enableEdgeToEdge(
navigationBarStyle = SystemBarStyle.auto(
Color.TRANSPARENT,
Color.TRANSPARENT,
),
)
}
layoutInflater.factory2 = LawnchairLayoutFactory(this)
super.onCreate(savedInstanceState)