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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user