manager: ui changes
This commit is contained in:
@@ -72,6 +72,8 @@ dependencies {
|
||||
implementation "androidx.navigation:navigation-compose:$nav_version"
|
||||
|
||||
implementation "com.google.accompanist:accompanist-drawablepainter:0.28.0"
|
||||
implementation "com.google.accompanist:accompanist-systemuicontroller:0.28.0"
|
||||
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1"
|
||||
|
||||
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
val systemUiController = rememberSystemUiController()
|
||||
SideEffect {
|
||||
(view.context as Activity).window.statusBarColor = colorScheme.primary.toArgb()
|
||||
ViewCompat.getWindowInsetsController(view)?.isAppearanceLightStatusBars = darkTheme
|
||||
}
|
||||
systemUiController.setStatusBarColor(
|
||||
color = colorScheme.surface,
|
||||
darkIcons = !darkTheme
|
||||
)
|
||||
}
|
||||
|
||||
MaterialTheme(
|
||||
|
||||
Reference in New Issue
Block a user