manager: ui changes

This commit is contained in:
tiann
2022-12-10 23:40:31 +08:00
parent e77ac86e95
commit b2e6f5cace
3 changed files with 14 additions and 9 deletions

View File

@@ -24,16 +24,17 @@ import me.weishu.kernelsu.getKernelVersion
@Composable
fun Info(label: String, value: String) {
Text(
buildAnnotatedString {
text = buildAnnotatedString {
append("$label: ")
withStyle(
style = SpanStyle(
fontWeight = FontWeight.W900,
fontWeight = FontWeight.W500,
)
) {
append(value)
}
}
},
softWrap = true,
)
}

View File

@@ -11,6 +11,7 @@ import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import androidx.core.view.ViewCompat
import com.google.accompanist.systemuicontroller.rememberSystemUiController
private val DarkColorScheme = darkColorScheme(
primary = YELLOW,
@@ -39,12 +40,13 @@ fun KernelSUTheme(
darkTheme -> DarkColorScheme
else -> LightColorScheme
}
val view = LocalView.current
if (!view.isInEditMode) {
SideEffect {
(view.context as Activity).window.statusBarColor = colorScheme.primary.toArgb()
ViewCompat.getWindowInsetsController(view)?.isAppearanceLightStatusBars = darkTheme
}
val systemUiController = rememberSystemUiController()
SideEffect {
systemUiController.setStatusBarColor(
color = colorScheme.surface,
darkIcons = !darkTheme
)
}
MaterialTheme(