merge: status bar icon fix
This commit is contained in:
@@ -4,6 +4,7 @@ import android.content.Intent
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.navigation.NavType
|
import androidx.navigation.NavType
|
||||||
import androidx.navigation.compose.NavHost
|
import androidx.navigation.compose.NavHost
|
||||||
@@ -20,6 +21,7 @@ import java.net.URLEncoder
|
|||||||
class MainActivity : ComponentActivity() {
|
class MainActivity : ComponentActivity() {
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
enableEdgeToEdge()
|
||||||
val sharedText = if (intent.action == Intent.ACTION_SEND)
|
val sharedText = if (intent.action == Intent.ACTION_SEND)
|
||||||
intent.getStringExtra(Intent.EXTRA_TEXT) else null
|
intent.getStringExtra(Intent.EXTRA_TEXT) else null
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,27 @@
|
|||||||
package me.hgsky.synq.ui.theme
|
package me.hgsky.synq.ui.theme
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.dynamicDarkColorScheme
|
|
||||||
import androidx.compose.material3.dynamicLightColorScheme
|
import androidx.compose.material3.dynamicLightColorScheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.SideEffect
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.platform.LocalView
|
||||||
|
import androidx.core.view.WindowCompat
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SynqTheme(content: @Composable () -> Unit) {
|
fun SynqTheme(content: @Composable () -> Unit) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val colorScheme = dynamicLightColorScheme(context)
|
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)
|
MaterialTheme(colorScheme = colorScheme, content = content)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user