mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Fix preview issue.
TimelineItemEventForTimestampViewProvider can now have event content which is not TimelineItemTextContent
This commit is contained in:
+18
-11
@@ -22,18 +22,25 @@ internal fun TimelineItemEventRowTimestampPreview(
|
|||||||
@PreviewParameter(TimelineItemEventForTimestampViewProvider::class) event: TimelineItem.Event
|
@PreviewParameter(TimelineItemEventForTimestampViewProvider::class) event: TimelineItem.Event
|
||||||
) = ElementPreview {
|
) = ElementPreview {
|
||||||
Column {
|
Column {
|
||||||
val oldContent = event.content as TimelineItemTextContent
|
when (event.content) {
|
||||||
listOf(
|
is TimelineItemTextContent -> listOf(
|
||||||
"Text",
|
"Text",
|
||||||
"Text longer, displayed on 1 line",
|
"Text longer, displayed on 1 line",
|
||||||
"Text which should be rendered on several lines",
|
"Text which should be rendered on several lines",
|
||||||
).forEach { str ->
|
).forEach { str ->
|
||||||
ATimelineItemEventRow(
|
ATimelineItemEventRow(
|
||||||
event = event.copy(
|
event = event.copy(
|
||||||
content = oldContent.copy(
|
content = event.content.copy(
|
||||||
body = str,
|
body = str,
|
||||||
pillifiedBody = str,
|
pillifiedBody = str,
|
||||||
|
),
|
||||||
|
reactionsState = aTimelineItemReactions(count = 0),
|
||||||
),
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
else -> ATimelineItemEventRow(
|
||||||
|
event = event.copy(
|
||||||
|
content = event.content,
|
||||||
reactionsState = aTimelineItemReactions(count = 0),
|
reactionsState = aTimelineItemReactions(count = 0),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user