From edd2c1745f8a1a65cdd1bc1c3331cd28786cdb7f Mon Sep 17 00:00:00 2001 From: eulaly Date: Tue, 19 May 2026 07:58:12 -0400 Subject: [PATCH] fix: restore enableEdgeToEdge, enforce dark status bar icons via WindowCompat API 35 forces edge-to-edge regardless; removing enableEdgeToEdge had no effect. Real fix: keep it, set isAppearanceLightStatusBars=true in SideEffect so clock/battery/wifi icons are dark and visible on the light TopAppBar background. Co-Authored-By: Claude Sonnet 4.6 --- .../src/main/kotlin/me/hgsky/synq/MainActivity.kt | 2 ++ .../main/kotlin/me/hgsky/synq/ui/theme/Theme.kt | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/kotlin/me/hgsky/synq/MainActivity.kt b/android/app/src/main/kotlin/me/hgsky/synq/MainActivity.kt index c909e7e..de2df2a 100644 --- a/android/app/src/main/kotlin/me/hgsky/synq/MainActivity.kt +++ b/android/app/src/main/kotlin/me/hgsky/synq/MainActivity.kt @@ -4,6 +4,7 @@ import android.content.Intent import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge import androidx.compose.runtime.Composable import androidx.navigation.NavType import androidx.navigation.compose.NavHost @@ -20,6 +21,7 @@ import java.net.URLEncoder class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + enableEdgeToEdge() val sharedText = if (intent.action == Intent.ACTION_SEND) intent.getStringExtra(Intent.EXTRA_TEXT) else null diff --git a/android/app/src/main/kotlin/me/hgsky/synq/ui/theme/Theme.kt b/android/app/src/main/kotlin/me/hgsky/synq/ui/theme/Theme.kt index ab2f24c..859b63d 100644 --- a/android/app/src/main/kotlin/me/hgsky/synq/ui/theme/Theme.kt +++ b/android/app/src/main/kotlin/me/hgsky/synq/ui/theme/Theme.kt @@ -1,14 +1,27 @@ package me.hgsky.synq.ui.theme +import android.app.Activity import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.dynamicDarkColorScheme import androidx.compose.material3.dynamicLightColorScheme import androidx.compose.runtime.Composable +import androidx.compose.runtime.SideEffect import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalView +import androidx.core.view.WindowCompat @Composable fun SynqTheme(content: @Composable () -> Unit) { val context = LocalContext.current val colorScheme = dynamicLightColorScheme(context) + + val view = LocalView.current + if (!view.isInEditMode) { + SideEffect { + val window = (view.context as Activity).window + // light theme → dark icons so clock/battery/wifi are visible on light TopAppBar + WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = true + } + } + MaterialTheme(colorScheme = colorScheme, content = content) }