Fix bullet points not having leading margin on timeline items (#4536)

* Fix bullet points not having leading margin on timeline items

* Remove other usages of `SpannableString` constructor, use either `valueOf` to reuse the existing value or `SpannedString` instead if the spans don't have to change
This commit is contained in:
Jorge Martin Espinosa 2025-04-07 10:50:45 +02:00 committed by GitHub
parent a63dffdcef
commit dac0eb6762
5 changed files with 8 additions and 10 deletions

View file

@ -7,7 +7,7 @@
package io.element.android.features.messages.impl.timeline.components.event
import android.text.SpannableString
import android.text.SpannedString
import androidx.annotation.VisibleForTesting
import androidx.compose.foundation.layout.Box
import androidx.compose.material3.LocalContentColor
@ -71,7 +71,7 @@ fun TimelineItemTextView(
internal fun getTextWithResolvedMentions(content: TimelineItemTextBasedContent): CharSequence {
val mentionSpanUpdater = LocalMentionSpanUpdater.current
val bodyWithResolvedMentions = mentionSpanUpdater.rememberMentionSpans(content.formattedBody)
return SpannableString(bodyWithResolvedMentions)
return SpannedString.valueOf(bodyWithResolvedMentions)
}
@PreviewsDayNight