From a1c0161d8c43f63184ef6ebc1b88e3ae211ac11e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E5=88=BA=E8=9E=88?= Date: Thu, 26 Dec 2024 21:40:12 +0800 Subject: [PATCH] perf: add GlobalGroupType icon --- .../main/kotlin/li/songe/gkd/ui/ActionLogPage.kt | 14 ++++++++++++++ .../li/songe/gkd/ui/component/AppNameText.kt | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/li/songe/gkd/ui/ActionLogPage.kt b/app/src/main/kotlin/li/songe/gkd/ui/ActionLogPage.kt index 02e61205e..c77fcae57 100644 --- a/app/src/main/kotlin/li/songe/gkd/ui/ActionLogPage.kt +++ b/app/src/main/kotlin/li/songe/gkd/ui/ActionLogPage.kt @@ -10,11 +10,13 @@ import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.ArrowBack +import androidx.compose.material.icons.filled.SportsBasketball import androidx.compose.material.icons.outlined.Delete import androidx.compose.material3.Card import androidx.compose.material3.Icon @@ -378,6 +380,18 @@ private fun ActionLogCard( modifier = Modifier.fillMaxWidth() ) { val groupDesc = group?.name.toString() + if (actionLog.groupType == SubsConfig.GlobalGroupType) { + Icon( + imageVector = Icons.Default.SportsBasketball, + contentDescription = null, + modifier = Modifier + .clickable(onClick = throttle { + toast("${group?.name ?: "当前规则组"} 是全局规则组") + }) + .size(LocalTextStyle.current.lineHeight.value.dp) + ) + Spacer(modifier = Modifier.width(4.dp)) + } Text( text = groupDesc, color = LocalContentColor.current.let { diff --git a/app/src/main/kotlin/li/songe/gkd/ui/component/AppNameText.kt b/app/src/main/kotlin/li/songe/gkd/ui/component/AppNameText.kt index f8f960696..9ed3f6852 100644 --- a/app/src/main/kotlin/li/songe/gkd/ui/component/AppNameText.kt +++ b/app/src/main/kotlin/li/songe/gkd/ui/component/AppNameText.kt @@ -2,7 +2,9 @@ package li.songe.gkd.ui.component import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.VerifiedUser import androidx.compose.material3.Icon @@ -35,9 +37,10 @@ fun AppNameText( imageVector = Icons.Outlined.VerifiedUser, contentDescription = null, modifier = Modifier - .clickable(onClick = throttle(fn = { toast("${info.name} 是一个系统应用") })) + .clickable(onClick = throttle(fn = { toast("${info.name} 是系统应用") })) .size(style.fontSize.value.dp) ) + Spacer(modifier = Modifier.width(4.dp)) Text( text = info.name, maxLines = 1,