From ff9c70e9e2d7726698dc70158e25127eb92000f0 Mon Sep 17 00:00:00 2001 From: lisonge Date: Mon, 6 Nov 2023 21:15:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=82=B9=E5=87=BB=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/li/songe/gkd/ui/ClickLogPage.kt | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/li/songe/gkd/ui/ClickLogPage.kt b/app/src/main/java/li/songe/gkd/ui/ClickLogPage.kt index e1c220cf9..85c7931b3 100644 --- a/app/src/main/java/li/songe/gkd/ui/ClickLogPage.kt +++ b/app/src/main/java/li/songe/gkd/ui/ClickLogPage.kt @@ -4,7 +4,6 @@ import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding @@ -35,14 +34,12 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp import androidx.compose.ui.window.Dialog import androidx.hilt.navigation.compose.hiltViewModel -import com.blankj.utilcode.util.LogUtils import com.ramcosta.composedestinations.annotation.Destination import com.ramcosta.composedestinations.annotation.RootNavGraph import kotlinx.coroutines.Dispatchers @@ -119,11 +116,27 @@ fun ClickLogPage() { Spacer(modifier = Modifier.width(10.dp)) Text( text = appInfoCache[triggerLog.appId]?.name ?: triggerLog.appId - ?: "" + ?: "null" ) } Spacer(modifier = Modifier.width(10.dp)) - Text(text = triggerLog.activityId ?: "") + val showActivityId = if (triggerLog.activityId != null) { + if (triggerLog.appId != null && triggerLog.activityId.startsWith( + triggerLog.appId + ) + ) { + triggerLog.activityId.substring(triggerLog.appId.length) + } else { + triggerLog.activityId + } + } else { + null + } + Text( + text = showActivityId ?: "null", + overflow = TextOverflow.Ellipsis, + maxLines = 1, + ) val group = vm.getGroup(triggerLog) if (group?.name != null) { Spacer(modifier = Modifier.width(10.dp)) @@ -136,6 +149,9 @@ fun ClickLogPage() { if (rule?.name != null) { Spacer(modifier = Modifier.width(10.dp)) Text(text = rule.name) + } else if ((group?.rules?.size ?: 0) > 1) { + Spacer(modifier = Modifier.width(10.dp)) + Text(text = (if (triggerLog.ruleKey != null) "key=${triggerLog.ruleKey}, " else "") + "index=${triggerLog.ruleIndex}") } } Divider()