Add MagiskTheme composable wrapping MiuixTheme

Create MagiskTheme that wraps MiuixTheme with light/dark color scheme
based on the existing Config.darkTheme preference setting.

Made-with: Cursor
This commit is contained in:
LoveSy
2026-03-16 02:48:20 -07:00
committed by topjohnwu
parent 9107bb6af3
commit e6c4268694
@@ -0,0 +1,22 @@
package com.topjohnwu.magisk.ui.theme
import androidx.appcompat.app.AppCompatDelegate
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
import com.topjohnwu.magisk.core.Config
import top.yukonga.miuix.kmp.theme.MiuixTheme
import top.yukonga.miuix.kmp.theme.darkColorScheme
import top.yukonga.miuix.kmp.theme.lightColorScheme
@Composable
fun MagiskTheme(
content: @Composable () -> Unit
) {
val darkTheme = when (Config.darkTheme) {
AppCompatDelegate.MODE_NIGHT_YES -> true
AppCompatDelegate.MODE_NIGHT_NO -> false
else -> isSystemInDarkTheme()
}
val colors = if (darkTheme) darkColorScheme() else lightColorScheme()
MiuixTheme(colors = colors, content = content)
}