review: Refactor preview, show all variants

This commit is contained in:
Valere 2026-05-11 11:20:10 +02:00
parent f34c1fbf0a
commit 3552e59098

View file

@ -125,21 +125,23 @@ private fun getIcon(
@PreviewsDayNight @PreviewsDayNight
@Composable @Composable
internal fun TimelineItemCallNotifyViewPreview() = ElementPreview { internal fun TimelineItemCallNotifyViewPreview() = ElementPreview {
Column(modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(16.dp)) { Column(modifier = Modifier.padding(2.dp), verticalArrangement = Arrangement.spacedBy(2.dp)) {
listOf( listOf(false, true).forEach { isDm ->
aTimelineRoomInfo() to TimelineItemRtcNotificationContent(CallIntent.AUDIO, RtcNotificationState.Started), listOf(CallIntent.AUDIO, CallIntent.VIDEO).forEach { callIntent ->
aTimelineRoomInfo() to TimelineItemRtcNotificationContent(CallIntent.VIDEO, RtcNotificationState.Started), listOf(
aTimelineRoomInfo(isDm = true) to TimelineItemRtcNotificationContent(CallIntent.AUDIO, RtcNotificationState.Declined(false)), RtcNotificationState.Started,
aTimelineRoomInfo(isDm = true) to TimelineItemRtcNotificationContent(CallIntent.VIDEO, RtcNotificationState.Declined(false)), RtcNotificationState.Declined(byMe = false),
aTimelineRoomInfo(isDm = true) to TimelineItemRtcNotificationContent(CallIntent.VIDEO, RtcNotificationState.Declined(true)), RtcNotificationState.Declined(byMe = true),
aTimelineRoomInfo(isDm = false) to TimelineItemRtcNotificationContent(CallIntent.VIDEO, RtcNotificationState.Started), ).forEach { state ->
).forEach { (info, content) -> val content = TimelineItemRtcNotificationContent(callIntent, state)
TimelineItemCallNotifyView( TimelineItemCallNotifyView(
timelineRoomInfo = info, timelineRoomInfo = aTimelineRoomInfo(isDm = isDm),
event = aTimelineItemEvent(content = content), event = aTimelineItemEvent(content = content),
content = content, content = content,
onLongClick = {}, onLongClick = {},
) )
}
}
} }
} }
} }