diff --git a/manager/app/src/main/java/com/sukisu/ultra/ui/component/profile/RootProfileConfig.kt b/manager/app/src/main/java/com/sukisu/ultra/ui/component/profile/RootProfileConfig.kt index b09c4a35..c507e25c 100644 --- a/manager/app/src/main/java/com/sukisu/ultra/ui/component/profile/RootProfileConfig.kt +++ b/manager/app/src/main/java/com/sukisu/ultra/ui/component/profile/RootProfileConfig.kt @@ -209,11 +209,10 @@ fun GroupsPanel(selected: List, closeSelection: (selection: Set) } val selection = HashSet(selected) - val backgroundColor = if (CardConfig.isCustomBackgroundEnabled) Color.Transparent else MaterialTheme.colorScheme.surfaceContainerHigh MaterialTheme( colorScheme = MaterialTheme.colorScheme.copy( - surface = backgroundColor + surface = MaterialTheme.colorScheme.surfaceContainerHigh ) ) { ListDialog( @@ -289,11 +288,10 @@ fun CapsPanel( } val selection = HashSet(selected) - val backgroundColor = if (CardConfig.isCustomBackgroundEnabled) Color.Transparent else MaterialTheme.colorScheme.surfaceContainerHigh MaterialTheme( colorScheme = MaterialTheme.colorScheme.copy( - surface = backgroundColor + surface = MaterialTheme.colorScheme.surfaceContainerHigh ) ) { ListDialog( @@ -444,11 +442,10 @@ private fun SELinuxPanel( ) ) - val backgroundColor = if (CardConfig.isCustomBackgroundEnabled) Color.Transparent else MaterialTheme.colorScheme.surfaceContainerHigh MaterialTheme( colorScheme = MaterialTheme.colorScheme.copy( - surface = backgroundColor + surface = MaterialTheme.colorScheme.surfaceContainerHigh ) ) { InputDialog( diff --git a/manager/app/src/main/java/com/sukisu/ultra/ui/screen/Install.kt b/manager/app/src/main/java/com/sukisu/ultra/ui/screen/Install.kt index 44d8e808..9c8e212f 100644 --- a/manager/app/src/main/java/com/sukisu/ultra/ui/screen/Install.kt +++ b/manager/app/src/main/java/com/sukisu/ultra/ui/screen/Install.kt @@ -688,11 +688,10 @@ fun rememberSelectKmiDialog(onSelected: (String?) -> Unit): DialogHandle { } var selection by remember { mutableStateOf(null) } - val backgroundColor = MaterialTheme.colorScheme.surfaceContainerHigh MaterialTheme( colorScheme = MaterialTheme.colorScheme.copy( - surface = backgroundColor + surface = MaterialTheme.colorScheme.surfaceContainerHigh ) ) { ListDialog(state = rememberUseCaseState(visible = true, onFinishedRequest = { diff --git a/manager/app/src/main/java/com/sukisu/ultra/ui/screen/Settings.kt b/manager/app/src/main/java/com/sukisu/ultra/ui/screen/Settings.kt index e644d0cd..52140ec4 100644 --- a/manager/app/src/main/java/com/sukisu/ultra/ui/screen/Settings.kt +++ b/manager/app/src/main/java/com/sukisu/ultra/ui/screen/Settings.kt @@ -662,115 +662,121 @@ fun rememberUninstallDialog(onSelected: (UninstallType) -> Unit): DialogHandle { var selectedOption by remember { mutableStateOf(null) } - AlertDialog( - onDismissRequest = { - dismiss() - }, - title = { - Text( - text = stringResource(R.string.settings_uninstall), - style = MaterialTheme.typography.headlineSmall, - ) - }, - text = { - Column( - modifier = Modifier.padding(vertical = 8.dp), - verticalArrangement = Arrangement.spacedBy(16.dp) - ) { - options.forEachIndexed { index, option -> - val isSelected = selectedOption == option - val backgroundColor = if (isSelected) - MaterialTheme.colorScheme.primaryContainer - else - Color.Transparent - val contentColor = if (isSelected) - MaterialTheme.colorScheme.onPrimaryContainer - else - MaterialTheme.colorScheme.onSurface + MaterialTheme( + colorScheme = MaterialTheme.colorScheme.copy( + surface = MaterialTheme.colorScheme.surfaceContainerHigh + ) + ) { + AlertDialog( + onDismissRequest = { + dismiss() + }, + title = { + Text( + text = stringResource(R.string.settings_uninstall), + style = MaterialTheme.typography.headlineSmall, + ) + }, + text = { + Column( + modifier = Modifier.padding(vertical = 8.dp), + verticalArrangement = Arrangement.spacedBy(16.dp) + ) { + options.forEachIndexed { index, option -> + val isSelected = selectedOption == option + val backgroundColor = if (isSelected) + MaterialTheme.colorScheme.primaryContainer + else + Color.Transparent + val contentColor = if (isSelected) + MaterialTheme.colorScheme.onPrimaryContainer + else + MaterialTheme.colorScheme.onSurface - Row( - modifier = Modifier - .fillMaxWidth() - .clip(MaterialTheme.shapes.medium) - .background(backgroundColor) - .clickable { - selectedOption = option - } - .padding(vertical = 12.dp, horizontal = 8.dp), - verticalAlignment = Alignment.CenterVertically - ) { - Icon( - imageVector = option.icon, - contentDescription = null, - tint = MaterialTheme.colorScheme.primary, + Row( modifier = Modifier - .padding(end = 16.dp) - .size(24.dp) - ) - Column( - modifier = Modifier.weight(1f) + .fillMaxWidth() + .clip(MaterialTheme.shapes.medium) + .background(backgroundColor) + .clickable { + selectedOption = option + } + .padding(vertical = 12.dp, horizontal = 8.dp), + verticalAlignment = Alignment.CenterVertically ) { - Text( - text = listOptions[index].titleText, - style = MaterialTheme.typography.titleMedium, + Icon( + imageVector = option.icon, + contentDescription = null, + tint = MaterialTheme.colorScheme.primary, + modifier = Modifier + .padding(end = 16.dp) + .size(24.dp) ) - listOptions[index].subtitleText?.let { + Column( + modifier = Modifier.weight(1f) + ) { Text( - text = it, - style = MaterialTheme.typography.bodyMedium, - color = if (isSelected) - contentColor.copy(alpha = 0.8f) - else - MaterialTheme.colorScheme.onSurfaceVariant + text = listOptions[index].titleText, + style = MaterialTheme.typography.titleMedium, + ) + listOptions[index].subtitleText?.let { + Text( + text = it, + style = MaterialTheme.typography.bodyMedium, + color = if (isSelected) + contentColor.copy(alpha = 0.8f) + else + MaterialTheme.colorScheme.onSurfaceVariant + ) + } + } + if (isSelected) { + Icon( + imageVector = Icons.Default.RadioButtonChecked, + contentDescription = null, + tint = MaterialTheme.colorScheme.primary, + modifier = Modifier.size(24.dp) + ) + } else { + Icon( + imageVector = Icons.Default.RadioButtonUnchecked, + contentDescription = null, + tint = MaterialTheme.colorScheme.onSurfaceVariant, + modifier = Modifier.size(24.dp) ) } } - if (isSelected) { - Icon( - imageVector = Icons.Default.RadioButtonChecked, - contentDescription = null, - tint = MaterialTheme.colorScheme.primary, - modifier = Modifier.size(24.dp) - ) - } else { - Icon( - imageVector = Icons.Default.RadioButtonUnchecked, - contentDescription = null, - tint = MaterialTheme.colorScheme.onSurfaceVariant, - modifier = Modifier.size(24.dp) - ) - } } } - } - }, - confirmButton = { - Button( - onClick = { - selectedOption?.let { onSelected(it) } - dismiss() - }, - enabled = selectedOption != null, - ) { - Text( - text = stringResource(android.R.string.ok) - ) - } - }, - dismissButton = { - TextButton( - onClick = { - dismiss() + }, + confirmButton = { + Button( + onClick = { + selectedOption?.let { onSelected(it) } + dismiss() + }, + enabled = selectedOption != null, + ) { + Text( + text = stringResource(android.R.string.ok) + ) } - ) { - Text( - text = stringResource(android.R.string.cancel), - ) - } - }, - shape = MaterialTheme.shapes.extraLarge, - tonalElevation = 4.dp - ) + }, + dismissButton = { + TextButton( + onClick = { + dismiss() + } + ) { + Text( + text = stringResource(android.R.string.cancel), + ) + } + }, + shape = MaterialTheme.shapes.extraLarge, + tonalElevation = 4.dp + ) + } } }