Skip to content

Commit dce4d5e

Browse files
committed
feat: show action log subs version (#1007)
1 parent 44cca36 commit dce4d5e

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

app/src/main/kotlin/li/songe/gkd/ui/ActionLogPage.kt

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import androidx.compose.ui.Modifier
3636
import androidx.compose.ui.draw.clip
3737
import androidx.compose.ui.graphics.Color
3838
import androidx.compose.ui.input.nestedscroll.nestedScroll
39+
import androidx.compose.ui.platform.LocalDensity
3940
import androidx.compose.ui.text.style.TextOverflow
4041
import androidx.compose.ui.unit.dp
4142
import androidx.compose.ui.window.Dialog
@@ -315,16 +316,36 @@ private fun ActionLogCard(
315316
)
316317
}
317318
if (subsId == null) {
318-
Text(
319-
text = subscription?.name ?: "id=${actionLog.subsId}",
319+
Row(
320320
modifier = Modifier.clickable(onClick = throttle {
321321
if (subsItemsFlow.value.any { it.id == actionLog.subsId }) {
322322
mainVm.sheetSubsIdFlow.value = actionLog.subsId
323323
} else {
324324
toast("订阅不存在")
325325
}
326326
})
327-
)
327+
) {
328+
Text(text = subscription?.name ?: "id=${actionLog.subsId}")
329+
val lineHeightDp = LocalDensity.current.run {
330+
LocalTextStyle.current.lineHeight.toDp()
331+
}
332+
Row(
333+
modifier = Modifier
334+
.height(lineHeightDp)
335+
.padding(start = 4.dp),
336+
verticalAlignment = Alignment.CenterVertically
337+
) {
338+
Text(
339+
text = "v${item.first.subsVersion}",
340+
style = MaterialTheme.typography.labelMedium,
341+
color = MaterialTheme.colorScheme.tertiary,
342+
modifier = Modifier
343+
.clip(MaterialTheme.shapes.extraSmall)
344+
.background(MaterialTheme.colorScheme.tertiaryContainer)
345+
.padding(horizontal = 2.dp),
346+
)
347+
}
348+
}
328349
}
329350
Row(
330351
modifier = Modifier.fillMaxWidth()

0 commit comments

Comments
 (0)