manager: refactor label item in superuser list (#403)

This commit is contained in:
Der_Googler
2025-05-19 18:50:11 +02:00
committed by GitHub
parent 980f71c1bd
commit 519f86c47e

View File

@@ -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,
)
)
}
}
}