Skip to content

Commit

Permalink
perf: add GlobalGroupType icon
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Dec 26, 2024
1 parent cc60998 commit a1c0161
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
14 changes: 14 additions & 0 deletions app/src/main/kotlin/li/songe/gkd/ui/ActionLogPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/kotlin/li/songe/gkd/ui/component/AppNameText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a1c0161

Please sign in to comment.