From 13c7c3e9e2900f4893f8f54bc00e0713ee4ff607 Mon Sep 17 00:00:00 2001 From: Diogo Date: Tue, 24 Sep 2024 16:51:05 +0100 Subject: [PATCH] metadata correct space --- .../common/views/chat/item/CIMetaView.kt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/CIMetaView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/CIMetaView.kt index b039a4483e..57ea4b0f7a 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/CIMetaView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/CIMetaView.kt @@ -129,9 +129,14 @@ fun reserveSpaceForMeta( ): String { val iconSpace = " " var res = "" - if (showEdited && meta.itemEdited) res += iconSpace + var hasIcon = false; + if (showEdited && meta.itemEdited) { + res += iconSpace + hasIcon = true + } if (meta.itemTimed != null) { res += iconSpace + hasIcon = true val ttl = meta.itemTimed.ttl if (ttl != chatTTL) { res += shortTimeText(ttl) @@ -139,19 +144,23 @@ fun reserveSpaceForMeta( } if (showViaProxy && meta.sentViaProxy == true) { res += iconSpace + hasIcon = true } if (showStatus && (meta.statusIcon(secondaryColor) != null || !meta.disappearing)) { res += iconSpace + if (meta.statusIcon(secondaryColor) != null) { + hasIcon = true + } } if (encrypted != null) { res += iconSpace + hasIcon = true } if (showTimestamp) { res += meta.timestampText - } else { - if (showStatus && (meta.statusIcon(secondaryColor) != null)) { - res += iconSpace - } + } else if (hasIcon) { + res += iconSpace + println("reserved: ${res.length} meta: ${meta}") } return res }