File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
java/com/rosan/installer/ui/theme Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 11package com.rosan.installer.ui.theme
22
3+ import android.app.Activity
34import android.os.Build
5+ import android.view.View
46import androidx.activity.ComponentActivity
57import androidx.compose.foundation.isSystemInDarkTheme
68import androidx.compose.material3.MaterialTheme
@@ -55,9 +57,27 @@ fun InstallerTheme(
5557 }
5658 }
5759
60+ DisableNavigationBarContrast (view)
61+
5862 MaterialTheme (
5963 colorScheme = colorScheme,
6064 typography = Typography ,
6165 content = content
6266 )
63- }
67+ }
68+
69+ /* *
70+ * Disable navigation bar contrast enforcement.
71+ * This is useful for devices where the navigation bar color should not be enforced
72+ * to match the system theme, allowing for custom colors.
73+ */
74+ @Composable
75+ fun DisableNavigationBarContrast (view : View ) {
76+ val view = LocalView .current
77+ if (! view.isInEditMode) {
78+ SideEffect {
79+ val window = (view.context as Activity ).window
80+ window.isNavigationBarContrastEnforced = false
81+ }
82+ }
83+ }
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<resources >
33
4- <style name =" Theme.Installer" parent =" Theme.Material3.DayNight" />
4+ <style name =" Theme.Installer" parent =" Theme.Material3.DayNight" >
5+ <!-- Compat Navigation Bar Color when ModalBottomSheet activated -->
6+ <item name =" android:enforceNavigationBarContrast" >false</item >
7+ </style >
58
69 <style name =" Theme.Installer.Translucent" parent =" Theme.Installer" >
710 <item name =" android:windowIsTranslucent" >true</item >
You can’t perform that action at this time.
0 commit comments