Timothy Joseph
05/06/2025, 1:50 PMval inNightMode = LocalNightMode.current
val context = LocalContext.current
val mContext = remember (inNightMode){ context.withForcedNightMode(inNightMode) }
val ctxThemeWrapper = remember(mContext) {
ContextThemeWrapper(mContext,R.style.Theme_PROlauncher)
}
AndroidView(factory = { ctx ->
TextView(ctxThemeWrapper)
})
,...... so that's fixed too The app supports edge to edge, but I added some margin to the bottom of the composables to make it seem as if it's above the navigation bar and Now I have to set a translucent navigation Bar and change the navigation bar icon to based on the theme mode since that was part of the attributes in the themes.xml, and anytime I set the custom theme mode to light and toggle the nav bar icons based on this, instead of starting at the edge of the screen, the margins I added start from the top of the nav bar and also the transluscent bg becomes completely white
val insetsController = WindowCompat.getInsetsController(window, window.decorView)
insetsController.isAppearanceLightNavigationBars = isLightTheme
the full method
@Composable
fun ApplyEdgeToEdge(isLightTheme: Boolean) {
val view = LocalView.current val activity = view.context as Activity
SideEffect {
val window = activity.window
// Ensure edge-to-edge layout
WindowCompat.setDecorFitsSystemWindows(window, false)
// Transparent system bars
window.navigationBarColor = Color.Transparent.toArgb()
// Disable nav bar contrast (API 29+)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
window.isNavigationBarContrastEnforced = false
}
// Optional (legacy translucent fallback)
@Suppress("DEPRECATION")
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
// Control icons
val insetsController = WindowCompat.getInsetsController(window, window.decorView)
insetsController.isAppearanceLightNavigationBars = isLightTheme
}
}
is there a way I could fix this???