From ec5d9e6368b022fe0f7b03fe229db96c6e9457ef Mon Sep 17 00:00:00 2001 From: weishu Date: Tue, 24 Oct 2023 10:39:25 +0800 Subject: [PATCH] manager: sort groups and capabilities --- .../kernelsu/ui/component/profile/RootProfileConfig.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/RootProfileConfig.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/RootProfileConfig.kt index 3e187acc..79a1b1c2 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/RootProfileConfig.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/RootProfileConfig.kt @@ -191,7 +191,9 @@ fun GroupsPanel(selected: List, closeSelection: (selection: Set) var showDialog by remember { mutableStateOf(false) } if (showDialog) { - val groups = Groups.values() + val groups = Groups.values().sortedWith(compareBy { + it != Groups.ROOT + }.then(compareBy { it.name })) val options = groups.map { value -> ListOption( titleText = value.display, @@ -257,7 +259,7 @@ fun CapsPanel( var showDialog by remember { mutableStateOf(false) } if (showDialog) { - val caps = Capabilities.values() + val caps = Capabilities.values().sortedBy { it.name } val options = caps.map { value -> ListOption( titleText = value.display,