manager: Updated colors and styles
- Adapted from reference style Co-authored-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com> Co-authored-by: Der_Googler <54764558+DerGoogler@users.noreply.github.com> Co-authored-by: rifsxd <rifat.44.azad.rifs@gmail.com> Signed-off-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com>
This commit is contained in:
@@ -8,24 +8,13 @@ import android.system.Os
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
data class KernelVersion(val major: Int, val patchLevel: Int, val subLevel: Int) {
|
data class KernelVersion(val major: Int, val patchLevel: Int, val subLevel: Int) {
|
||||||
override fun toString(): String {
|
override fun toString(): String = "$major.$patchLevel.$subLevel"
|
||||||
return "$major.$patchLevel.$subLevel"
|
fun isGKI(): Boolean = when {
|
||||||
}
|
major > 5 -> true
|
||||||
|
major == 5 && patchLevel >= 10 -> true
|
||||||
fun isGKI(): Boolean {
|
else -> false
|
||||||
|
|
||||||
// kernel 6.x
|
|
||||||
if (major > 5) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// kernel 5.10.x
|
|
||||||
if (major == 5) {
|
|
||||||
return patchLevel >= 10
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
fun isGKI1(): Boolean = (major == 4 && patchLevel >= 19) || (major == 5 && patchLevel < 10)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun parseKernelVersion(version: String): KernelVersion {
|
fun parseKernelVersion(version: String): KernelVersion {
|
||||||
|
|||||||
@@ -239,8 +239,7 @@ private fun BottomBar(navController: NavHostController) {
|
|||||||
val isManager = Natives.becomeManager(ksuApp.packageName)
|
val isManager = Natives.becomeManager(ksuApp.packageName)
|
||||||
val fullFeatured = isManager && !Natives.requireNewKernel() && rootAvailable()
|
val fullFeatured = isManager && !Natives.requireNewKernel() && rootAvailable()
|
||||||
val kpmVersion = getKpmVersion()
|
val kpmVersion = getKpmVersion()
|
||||||
val containerColor = MaterialTheme.colorScheme.surfaceVariant
|
val cardColor = MaterialTheme.colorScheme.surfaceContainer
|
||||||
val cardColor = MaterialTheme.colorScheme.surfaceVariant
|
|
||||||
|
|
||||||
// 检查是否显示KPM
|
// 检查是否显示KPM
|
||||||
val showKpmInfo = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
val showKpmInfo = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||||
@@ -252,7 +251,7 @@ private fun BottomBar(navController: NavHostController) {
|
|||||||
),
|
),
|
||||||
containerColor = TopAppBarDefaults.topAppBarColors(
|
containerColor = TopAppBarDefaults.topAppBarColors(
|
||||||
containerColor = cardColor.copy(alpha = cardAlpha),
|
containerColor = cardColor.copy(alpha = cardAlpha),
|
||||||
scrolledContainerColor = containerColor.copy(alpha = cardAlpha)
|
scrolledContainerColor = cardColor.copy(alpha = cardAlpha)
|
||||||
).containerColor,
|
).containerColor,
|
||||||
tonalElevation = cardElevation
|
tonalElevation = cardElevation
|
||||||
) {
|
) {
|
||||||
@@ -265,32 +264,25 @@ private fun BottomBar(navController: NavHostController) {
|
|||||||
selected = isCurrentDestOnBackStack,
|
selected = isCurrentDestOnBackStack,
|
||||||
onClick = {
|
onClick = {
|
||||||
if (!isCurrentDestOnBackStack) {
|
if (!isCurrentDestOnBackStack) {
|
||||||
navigator.navigate(destination.direction) {
|
navigator.popBackStack(destination.direction, false)
|
||||||
popUpTo(NavGraphs.root as RouteOrDirection) {
|
}
|
||||||
saveState = true
|
navigator.navigate(destination.direction) {
|
||||||
}
|
popUpTo(NavGraphs.root as RouteOrDirection) {
|
||||||
launchSingleTop = true
|
saveState = true
|
||||||
restoreState = true
|
|
||||||
}
|
}
|
||||||
|
launchSingleTop = true
|
||||||
|
restoreState = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
icon = {
|
icon = {
|
||||||
Icon(
|
if (isCurrentDestOnBackStack) {
|
||||||
imageVector = if (isCurrentDestOnBackStack) {
|
Icon(destination.iconSelected, stringResource(destination.label))
|
||||||
destination.iconSelected
|
} else {
|
||||||
} else {
|
Icon(destination.iconNotSelected, stringResource(destination.label))
|
||||||
destination.iconNotSelected
|
}
|
||||||
},
|
|
||||||
contentDescription = stringResource(destination.label),
|
|
||||||
tint = if (isCurrentDestOnBackStack) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onSurfaceVariant
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
label = {
|
label = { Text(stringResource(destination.label),style = MaterialTheme.typography.labelMedium) },
|
||||||
Text(
|
alwaysShowLabel = false
|
||||||
text = stringResource(destination.label),
|
|
||||||
style = MaterialTheme.typography.labelMedium
|
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -299,33 +291,26 @@ private fun BottomBar(navController: NavHostController) {
|
|||||||
NavigationBarItem(
|
NavigationBarItem(
|
||||||
selected = isCurrentDestOnBackStack,
|
selected = isCurrentDestOnBackStack,
|
||||||
onClick = {
|
onClick = {
|
||||||
if (!isCurrentDestOnBackStack) {
|
if (isCurrentDestOnBackStack) {
|
||||||
navigator.navigate(destination.direction) {
|
navigator.popBackStack(destination.direction, false)
|
||||||
popUpTo(NavGraphs.root as RouteOrDirection) {
|
}
|
||||||
saveState = true
|
navigator.navigate(destination.direction) {
|
||||||
}
|
popUpTo(NavGraphs.root) {
|
||||||
launchSingleTop = true
|
saveState = true
|
||||||
restoreState = true
|
|
||||||
}
|
}
|
||||||
|
launchSingleTop = true
|
||||||
|
restoreState = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
icon = {
|
icon = {
|
||||||
Icon(
|
if (isCurrentDestOnBackStack) {
|
||||||
imageVector = if (isCurrentDestOnBackStack) {
|
Icon(destination.iconSelected, stringResource(destination.label))
|
||||||
destination.iconSelected
|
} else {
|
||||||
} else {
|
Icon(destination.iconNotSelected, stringResource(destination.label))
|
||||||
destination.iconNotSelected
|
}
|
||||||
},
|
|
||||||
contentDescription = stringResource(destination.label),
|
|
||||||
tint = if (isCurrentDestOnBackStack) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onSurfaceVariant
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
label = {
|
label = { Text(stringResource(destination.label),style = MaterialTheme.typography.labelMedium) },
|
||||||
Text(
|
alwaysShowLabel = false
|
||||||
text = stringResource(destination.label),
|
|
||||||
style = MaterialTheme.typography.labelMedium
|
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ fun SearchAppBar(
|
|||||||
var onSearch by remember { mutableStateOf(false) }
|
var onSearch by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
// 获取卡片颜色和透明度
|
// 获取卡片颜色和透明度
|
||||||
val cardColor = MaterialTheme.colorScheme.surfaceVariant
|
val cardColor = MaterialTheme.colorScheme.surfaceContainer
|
||||||
val cardAlpha = CardConfig.cardAlpha
|
val cardAlpha = CardConfig.cardAlpha
|
||||||
|
|
||||||
if (onSearch) {
|
if (onSearch) {
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ fun AppProfileScreen(
|
|||||||
mutableStateOf(initialProfile)
|
mutableStateOf(initialProfile)
|
||||||
}
|
}
|
||||||
|
|
||||||
val cardColor = MaterialTheme.colorScheme.surfaceVariant
|
val cardColor = MaterialTheme.colorScheme.surfaceContainer
|
||||||
val cardAlpha = CardConfig.cardAlpha
|
val cardAlpha = CardConfig.cardAlpha
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ enum class BottomBarDestination(
|
|||||||
) {
|
) {
|
||||||
Home(HomeScreenDestination, R.string.home, Icons.Filled.Home, Icons.Outlined.Home, false),
|
Home(HomeScreenDestination, R.string.home, Icons.Filled.Home, Icons.Outlined.Home, false),
|
||||||
Kpm(KpmScreenDestination, R.string.kpm_title, Icons.Filled.Build, Icons.Outlined.Build, true),
|
Kpm(KpmScreenDestination, R.string.kpm_title, Icons.Filled.Build, Icons.Outlined.Build, true),
|
||||||
SuperUser(SuperUserScreenDestination, R.string.superuser, Icons.Filled.Security, Icons.Outlined.Security, true),
|
SuperUser(SuperUserScreenDestination, R.string.superuser, Icons.Filled.AdminPanelSettings, Icons.Outlined.AdminPanelSettings, true),
|
||||||
Module(ModuleScreenDestination, R.string.module, Icons.Filled.Apps, Icons.Outlined.Apps, true),
|
Module(ModuleScreenDestination, R.string.module, Icons.Filled.Apps, Icons.Outlined.Apps, true),
|
||||||
Settings(SettingScreenDestination, R.string.settings, Icons.Filled.Settings, Icons.Outlined.Settings, false),
|
Settings(SettingScreenDestination, R.string.settings, Icons.Filled.Settings, Icons.Outlined.Settings, false),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -435,7 +435,7 @@ private fun TopBar(
|
|||||||
onSave: () -> Unit = {},
|
onSave: () -> Unit = {},
|
||||||
scrollBehavior: TopAppBarScrollBehavior? = null
|
scrollBehavior: TopAppBarScrollBehavior? = null
|
||||||
) {
|
) {
|
||||||
val cardColor = MaterialTheme.colorScheme.surfaceVariant
|
val cardColor = MaterialTheme.colorScheme.surfaceContainer
|
||||||
val cardAlpha = CardConfig.cardAlpha
|
val cardAlpha = CardConfig.cardAlpha
|
||||||
|
|
||||||
val statusColor = when(status) {
|
val statusColor = when(status) {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import androidx.compose.animation.expandVertically
|
|||||||
import androidx.compose.animation.fadeIn
|
import androidx.compose.animation.fadeIn
|
||||||
import androidx.compose.animation.fadeOut
|
import androidx.compose.animation.fadeOut
|
||||||
import androidx.compose.animation.shrinkVertically
|
import androidx.compose.animation.shrinkVertically
|
||||||
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
@@ -29,6 +30,7 @@ import androidx.compose.foundation.layout.size
|
|||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.layout.wrapContentHeight
|
import androidx.compose.foundation.layout.wrapContentHeight
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.verticalScroll
|
import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.Android
|
import androidx.compose.material.icons.filled.Android
|
||||||
@@ -55,6 +57,7 @@ import androidx.compose.material3.Icon
|
|||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Scaffold
|
import androidx.compose.material3.Scaffold
|
||||||
|
import androidx.compose.material3.Surface
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material3.TopAppBar
|
import androidx.compose.material3.TopAppBar
|
||||||
import androidx.compose.material3.TopAppBarDefaults
|
import androidx.compose.material3.TopAppBarDefaults
|
||||||
@@ -225,7 +228,7 @@ fun HomeScreen(navigator: DestinationsNavigator) {
|
|||||||
exit = shrinkVertically() + fadeOut()
|
exit = shrinkVertically() + fadeOut()
|
||||||
) {
|
) {
|
||||||
ElevatedCard(
|
ElevatedCard(
|
||||||
colors = getCardColors(MaterialTheme.colorScheme.secondaryContainer),
|
colors = getCardColors(MaterialTheme.colorScheme.surfaceVariant),
|
||||||
elevation = CardDefaults.cardElevation(defaultElevation = cardElevation),
|
elevation = CardDefaults.cardElevation(defaultElevation = cardElevation),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(MaterialTheme.shapes.medium)
|
.clip(MaterialTheme.shapes.medium)
|
||||||
@@ -245,11 +248,6 @@ fun HomeScreen(navigator: DestinationsNavigator) {
|
|||||||
.padding(16.dp),
|
.padding(16.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
Icon(
|
|
||||||
imageVector = Icons.Outlined.Info,
|
|
||||||
contentDescription = null,
|
|
||||||
modifier = Modifier.padding(end = 12.dp)
|
|
||||||
)
|
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.using_mksu_manager),
|
text = stringResource(R.string.using_mksu_manager),
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
@@ -319,7 +317,7 @@ fun UpdateCard() {
|
|||||||
val updateDialog = rememberConfirmDialog(onConfirm = { uriHandler.openUri(newVersionUrl) })
|
val updateDialog = rememberConfirmDialog(onConfirm = { uriHandler.openUri(newVersionUrl) })
|
||||||
WarningCard(
|
WarningCard(
|
||||||
message = stringResource(id = R.string.new_version_available).format(newVersionCode),
|
message = stringResource(id = R.string.new_version_available).format(newVersionCode),
|
||||||
color = MaterialTheme.colorScheme.tertiaryContainer,
|
color = MaterialTheme.colorScheme.surfaceVariant,
|
||||||
onClick = {
|
onClick = {
|
||||||
if (changelog.isEmpty()) {
|
if (changelog.isEmpty()) {
|
||||||
uriHandler.openUri(newVersionUrl)
|
uriHandler.openUri(newVersionUrl)
|
||||||
@@ -357,7 +355,7 @@ private fun TopBar(
|
|||||||
onInstallClick: () -> Unit,
|
onInstallClick: () -> Unit,
|
||||||
scrollBehavior: TopAppBarScrollBehavior? = null
|
scrollBehavior: TopAppBarScrollBehavior? = null
|
||||||
) {
|
) {
|
||||||
val cardColor = MaterialTheme.colorScheme.surfaceVariant
|
val cardColor = MaterialTheme.colorScheme.surfaceContainer
|
||||||
val cardAlpha = CardConfig.cardAlpha
|
val cardAlpha = CardConfig.cardAlpha
|
||||||
|
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
@@ -422,7 +420,7 @@ private fun StatusCard(
|
|||||||
onClickInstall: () -> Unit = {}
|
onClickInstall: () -> Unit = {}
|
||||||
) {
|
) {
|
||||||
ElevatedCard(
|
ElevatedCard(
|
||||||
colors = getCardColors(MaterialTheme.colorScheme.surfaceVariant),
|
colors = getCardColors(MaterialTheme.colorScheme.secondaryContainer),
|
||||||
elevation = CardDefaults.cardElevation(defaultElevation = cardElevation),
|
elevation = CardDefaults.cardElevation(defaultElevation = cardElevation),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
@@ -451,26 +449,13 @@ private fun StatusCard(
|
|||||||
else -> ""
|
else -> ""
|
||||||
}
|
}
|
||||||
|
|
||||||
val workingMode = when (lkmMode) {
|
val workingModeText = when {
|
||||||
null -> " <Non-GKI>"
|
lkmMode == true -> "LKM"
|
||||||
true -> " <LKM>"
|
lkmMode == null && kernelVersion.isGKI1() -> "GKI1.0"
|
||||||
else -> " <GKI>"
|
lkmMode == false || kernelVersion.isGKI() -> "GKI2.0"
|
||||||
|
else -> "N-GKI"
|
||||||
}
|
}
|
||||||
|
|
||||||
val workingText = "${stringResource(id = R.string.home_working)}$workingMode$safeMode"
|
|
||||||
|
|
||||||
val isHideVersion = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
|
||||||
.getBoolean("is_hide_version", false)
|
|
||||||
|
|
||||||
val isHideOtherInfo = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
|
||||||
.getBoolean("is_hide_other_info", false)
|
|
||||||
|
|
||||||
val isHideSusfsStatus = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
|
||||||
.getBoolean("is_hide_susfs_status", false)
|
|
||||||
|
|
||||||
val showKpmInfo = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
|
||||||
.getBoolean("show_kpm_info", true)
|
|
||||||
|
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Outlined.CheckCircle,
|
Icons.Outlined.CheckCircle,
|
||||||
contentDescription = stringResource(R.string.home_working),
|
contentDescription = stringResource(R.string.home_working),
|
||||||
@@ -479,11 +464,74 @@ private fun StatusCard(
|
|||||||
)
|
)
|
||||||
|
|
||||||
Column(Modifier.padding(start = 20.dp)) {
|
Column(Modifier.padding(start = 20.dp)) {
|
||||||
Text(
|
Row(
|
||||||
text = workingText,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
style = MaterialTheme.typography.titleMedium,
|
modifier = Modifier.fillMaxWidth()
|
||||||
color = MaterialTheme.colorScheme.onSurface
|
) {
|
||||||
)
|
Text(
|
||||||
|
text = stringResource(id = R.string.home_working),
|
||||||
|
style = MaterialTheme.typography.titleMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurface
|
||||||
|
)
|
||||||
|
|
||||||
|
Spacer(Modifier.width(8.dp))
|
||||||
|
|
||||||
|
// 工作模式标签
|
||||||
|
Surface(
|
||||||
|
shape = RoundedCornerShape(4.dp),
|
||||||
|
color = MaterialTheme.colorScheme.primary,
|
||||||
|
modifier = Modifier
|
||||||
|
.border(
|
||||||
|
width = 1.dp,
|
||||||
|
color = MaterialTheme.colorScheme.secondary,
|
||||||
|
shape = RoundedCornerShape(4.dp)
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = workingModeText,
|
||||||
|
style = MaterialTheme.typography.labelMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSecondary,
|
||||||
|
modifier = Modifier.padding(horizontal = 6.dp, vertical = 2.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Spacer(Modifier.width(6.dp))
|
||||||
|
|
||||||
|
// 机器架构标签
|
||||||
|
Surface(
|
||||||
|
shape = RoundedCornerShape(4.dp),
|
||||||
|
color = MaterialTheme.colorScheme.primary,
|
||||||
|
modifier = Modifier
|
||||||
|
.border(
|
||||||
|
width = 1.dp,
|
||||||
|
color = MaterialTheme.colorScheme.secondary,
|
||||||
|
shape = RoundedCornerShape(4.dp)
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = Os.uname().machine,
|
||||||
|
style = MaterialTheme.typography.labelMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSecondary,
|
||||||
|
modifier = Modifier.padding(horizontal = 6.dp, vertical = 2.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (safeMode.isNotEmpty()) {
|
||||||
|
Text(
|
||||||
|
text = safeMode,
|
||||||
|
style = MaterialTheme.typography.titleMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurface
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val isHideVersion = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||||
|
.getBoolean("is_hide_version", false)
|
||||||
|
|
||||||
|
val isHideOtherInfo = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||||
|
.getBoolean("is_hide_other_info", false)
|
||||||
|
|
||||||
|
val showKpmInfo = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||||
|
.getBoolean("show_kpm_info", true)
|
||||||
|
|
||||||
if (!isHideVersion) {
|
if (!isHideVersion) {
|
||||||
Spacer(Modifier.height(4.dp))
|
Spacer(Modifier.height(4.dp))
|
||||||
@@ -519,25 +567,6 @@ private fun StatusCard(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isHideSusfsStatus) {
|
|
||||||
Spacer(modifier = Modifier.height(4.dp))
|
|
||||||
|
|
||||||
val suSFS = getSuSFS()
|
|
||||||
if (lkmMode != true) {
|
|
||||||
val translatedStatus = when (suSFS) {
|
|
||||||
"Supported" -> stringResource(R.string.status_supported)
|
|
||||||
"Not Supported" -> stringResource(R.string.status_not_supported)
|
|
||||||
else -> stringResource(R.string.status_unknown)
|
|
||||||
}
|
|
||||||
|
|
||||||
Text(
|
|
||||||
text = stringResource(R.string.home_susfs, translatedStatus),
|
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -596,7 +625,7 @@ private fun StatusCard(
|
|||||||
@Composable
|
@Composable
|
||||||
fun WarningCard(
|
fun WarningCard(
|
||||||
message: String,
|
message: String,
|
||||||
color: Color = MaterialTheme.colorScheme.errorContainer,
|
color: Color = MaterialTheme.colorScheme.error,
|
||||||
onClick: (() -> Unit)? = null
|
onClick: (() -> Unit)? = null
|
||||||
) {
|
) {
|
||||||
ElevatedCard(
|
ElevatedCard(
|
||||||
@@ -608,7 +637,6 @@ fun WarningCard(
|
|||||||
.shadow(
|
.shadow(
|
||||||
elevation = cardElevation,
|
elevation = cardElevation,
|
||||||
shape = MaterialTheme.shapes.large,
|
shape = MaterialTheme.shapes.large,
|
||||||
spotColor = MaterialTheme.colorScheme.error.copy(alpha = 0.1f)
|
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
@@ -618,14 +646,6 @@ fun WarningCard(
|
|||||||
.padding(24.dp),
|
.padding(24.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
Icon(
|
|
||||||
imageVector = Icons.Filled.Warning,
|
|
||||||
contentDescription = null,
|
|
||||||
tint = MaterialTheme.colorScheme.onErrorContainer,
|
|
||||||
modifier = Modifier
|
|
||||||
.padding(end = 16.dp)
|
|
||||||
.size(28.dp)
|
|
||||||
)
|
|
||||||
Text(
|
Text(
|
||||||
text = message,
|
text = message,
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
@@ -641,7 +661,7 @@ fun ContributionCard() {
|
|||||||
val links = listOf("https://github.com/ShirkNeko", "https://github.com/udochina")
|
val links = listOf("https://github.com/ShirkNeko", "https://github.com/udochina")
|
||||||
|
|
||||||
ElevatedCard(
|
ElevatedCard(
|
||||||
colors = getCardColors(MaterialTheme.colorScheme.surfaceContainerHigh),
|
colors = getCardColors(MaterialTheme.colorScheme.surfaceContainer),
|
||||||
elevation = CardDefaults.cardElevation(defaultElevation = cardElevation),
|
elevation = CardDefaults.cardElevation(defaultElevation = cardElevation),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
@@ -687,7 +707,7 @@ fun LearnMoreCard() {
|
|||||||
val url = stringResource(R.string.home_learn_kernelsu_url)
|
val url = stringResource(R.string.home_learn_kernelsu_url)
|
||||||
|
|
||||||
ElevatedCard(
|
ElevatedCard(
|
||||||
colors = getCardColors(MaterialTheme.colorScheme.surfaceContainerHigh),
|
colors = getCardColors(MaterialTheme.colorScheme.surfaceContainer),
|
||||||
elevation = CardDefaults.cardElevation(defaultElevation = cardElevation),
|
elevation = CardDefaults.cardElevation(defaultElevation = cardElevation),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
@@ -730,7 +750,7 @@ fun DonateCard() {
|
|||||||
val uriHandler = LocalUriHandler.current
|
val uriHandler = LocalUriHandler.current
|
||||||
|
|
||||||
ElevatedCard(
|
ElevatedCard(
|
||||||
colors = getCardColors(MaterialTheme.colorScheme.surfaceContainerHigh),
|
colors = getCardColors(MaterialTheme.colorScheme.surfaceContainer),
|
||||||
elevation = CardDefaults.cardElevation(defaultElevation = cardElevation),
|
elevation = CardDefaults.cardElevation(defaultElevation = cardElevation),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
@@ -778,7 +798,7 @@ private fun InfoCard() {
|
|||||||
.getBoolean("show_kpm_info", true)
|
.getBoolean("show_kpm_info", true)
|
||||||
|
|
||||||
ElevatedCard(
|
ElevatedCard(
|
||||||
colors = getCardColors(MaterialTheme.colorScheme.surfaceContainerHighest),
|
colors = getCardColors(MaterialTheme.colorScheme.surfaceContainer),
|
||||||
elevation = CardDefaults.cardElevation(defaultElevation = cardElevation),
|
elevation = CardDefaults.cardElevation(defaultElevation = cardElevation),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
@@ -839,7 +859,7 @@ private fun InfoCard() {
|
|||||||
|
|
||||||
InfoCardItem(
|
InfoCardItem(
|
||||||
stringResource(R.string.home_kernel),
|
stringResource(R.string.home_kernel),
|
||||||
"${uname.release} (${uname.machine})",
|
uname.release,
|
||||||
icon = Icons.Default.Memory,
|
icon = Icons.Default.Memory,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -893,7 +913,7 @@ private fun InfoCard() {
|
|||||||
InfoCardItem(
|
InfoCardItem(
|
||||||
stringResource(R.string.home_kpm_version),
|
stringResource(R.string.home_kpm_version),
|
||||||
displayVersion,
|
displayVersion,
|
||||||
icon = Icons.Default.Code
|
icon = Icons.Default.Settings
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -955,7 +975,7 @@ private fun WarningCardPreview() {
|
|||||||
WarningCard(message = "Warning message")
|
WarningCard(message = "Warning message")
|
||||||
WarningCard(
|
WarningCard(
|
||||||
message = "Warning message ",
|
message = "Warning message ",
|
||||||
MaterialTheme.colorScheme.tertiaryContainer,
|
MaterialTheme.colorScheme.outlineVariant,
|
||||||
onClick = {})
|
onClick = {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -752,7 +752,7 @@ private fun TopBar(
|
|||||||
onLkmUpload: () -> Unit = {},
|
onLkmUpload: () -> Unit = {},
|
||||||
scrollBehavior: TopAppBarScrollBehavior? = null
|
scrollBehavior: TopAppBarScrollBehavior? = null
|
||||||
) {
|
) {
|
||||||
val cardColor = MaterialTheme.colorScheme.surfaceVariant
|
val cardColor = MaterialTheme.colorScheme.surfaceContainer
|
||||||
val cardAlpha = cardAlpha
|
val cardAlpha = cardAlpha
|
||||||
|
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
|
|||||||
@@ -846,6 +846,9 @@ fun ModuleItem(
|
|||||||
onClick = { onUpdate(module) },
|
onClick = { onUpdate(module) },
|
||||||
shape = ButtonDefaults.textShape,
|
shape = ButtonDefaults.textShape,
|
||||||
contentPadding = ButtonDefaults.TextButtonContentPadding,
|
contentPadding = ButtonDefaults.TextButtonContentPadding,
|
||||||
|
colors = ButtonDefaults.buttonColors(
|
||||||
|
containerColor = MaterialTheme.colorScheme.secondaryContainer
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier.size(20.dp),
|
modifier = Modifier.size(20.dp),
|
||||||
|
|||||||
@@ -506,7 +506,7 @@ fun MoreSettingsScreen(navigator: DestinationsNavigator) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val cardColor = MaterialTheme.colorScheme.surfaceVariant
|
val cardColor = MaterialTheme.colorScheme.surfaceContainer
|
||||||
val cardAlphaUse = CardConfig.cardAlpha
|
val cardAlphaUse = CardConfig.cardAlpha
|
||||||
val isDarkTheme = isSystemInDarkTheme()
|
val isDarkTheme = isSystemInDarkTheme()
|
||||||
|
|
||||||
|
|||||||
@@ -789,7 +789,7 @@ private fun TopBar(
|
|||||||
scrollBehavior: TopAppBarScrollBehavior? = null
|
scrollBehavior: TopAppBarScrollBehavior? = null
|
||||||
) {
|
) {
|
||||||
val systemIsDark = isSystemInDarkTheme()
|
val systemIsDark = isSystemInDarkTheme()
|
||||||
val cardColor = MaterialTheme.colorScheme.surfaceVariant
|
val cardColor = MaterialTheme.colorScheme.surfaceContainer
|
||||||
val cardAlpha = if (ThemeConfig.customBackgroundUri != null) {
|
val cardAlpha = if (ThemeConfig.customBackgroundUri != null) {
|
||||||
cardAlpha
|
cardAlpha
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ private fun TopBar(
|
|||||||
colors: TopAppBarColors,
|
colors: TopAppBarColors,
|
||||||
scrollBehavior: TopAppBarScrollBehavior? = null
|
scrollBehavior: TopAppBarScrollBehavior? = null
|
||||||
) {
|
) {
|
||||||
val cardColor = MaterialTheme.colorScheme.surfaceVariant
|
val cardColor = MaterialTheme.colorScheme.surfaceContainer
|
||||||
val cardAlpha = CardConfig.cardAlpha
|
val cardAlpha = CardConfig.cardAlpha
|
||||||
|
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
|
|||||||
Reference in New Issue
Block a user