From 519f86c47e867c68e4e0965bb14522d531e51d01 Mon Sep 17 00:00:00 2001 From: Der_Googler <54764558+DerGoogler@users.noreply.github.com> Date: Mon, 19 May 2025 18:50:11 +0200 Subject: [PATCH] manager: refactor label item in superuser list (#403) --- .../com/rifsxd/ksunext/ui/screen/SuperUser.kt | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/SuperUser.kt b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/SuperUser.kt index be369b1b..04d41da5 100644 --- a/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/SuperUser.kt +++ b/manager/app/src/main/java/com/rifsxd/ksunext/ui/screen/SuperUser.kt @@ -26,6 +26,8 @@ import androidx.lifecycle.viewmodel.compose.viewModel import coil.compose.AsyncImage import coil.request.ImageRequest import com.dergoogler.mmrl.platform.Platform +import com.dergoogler.mmrl.ui.component.LabelItem +import com.dergoogler.mmrl.ui.component.LabelItemDefaults import com.ramcosta.composedestinations.annotation.Destination import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.generated.destinations.AppProfileScreenDestination @@ -150,16 +152,32 @@ private fun AppItem( supportingContent = { Column { Text(app.packageName) - FlowRow { + FlowRow( + horizontalArrangement = Arrangement.spacedBy(4.dp) + ) { if (app.allowSu) { - LabelText(label = "ROOT") + LabelItem( + text = "ROOT", + ) } else { if (Natives.uidShouldUmount(app.uid)) { - LabelText(label = "UMOUNT") + LabelItem( + text = "UNMOUNT", + style = LabelItemDefaults.style.copy( + containerColor = MaterialTheme.colorScheme.secondaryContainer, + contentColor = MaterialTheme.colorScheme.onSecondaryContainer + ) + ) } } if (app.hasCustomProfile) { - LabelText(label = "CUSTOM") + LabelItem( + text = "CUSTOM", + style = LabelItemDefaults.style.copy( + containerColor = MaterialTheme.colorScheme.onTertiary, + contentColor = MaterialTheme.colorScheme.onTertiaryContainer, + ) + ) } } }