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,17 +125,17 @@ 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(false, true).forEach { isDm ->
listOf(CallIntent.AUDIO, CallIntent.VIDEO).forEach { callIntent ->
listOf( listOf(
aTimelineRoomInfo() to TimelineItemRtcNotificationContent(CallIntent.AUDIO, RtcNotificationState.Started), RtcNotificationState.Started,
aTimelineRoomInfo() to TimelineItemRtcNotificationContent(CallIntent.VIDEO, RtcNotificationState.Started), RtcNotificationState.Declined(byMe = false),
aTimelineRoomInfo(isDm = true) to TimelineItemRtcNotificationContent(CallIntent.AUDIO, RtcNotificationState.Declined(false)), RtcNotificationState.Declined(byMe = true),
aTimelineRoomInfo(isDm = true) to TimelineItemRtcNotificationContent(CallIntent.VIDEO, RtcNotificationState.Declined(false)), ).forEach { state ->
aTimelineRoomInfo(isDm = true) to TimelineItemRtcNotificationContent(CallIntent.VIDEO, RtcNotificationState.Declined(true)), val content = TimelineItemRtcNotificationContent(callIntent, state)
aTimelineRoomInfo(isDm = false) to TimelineItemRtcNotificationContent(CallIntent.VIDEO, RtcNotificationState.Started),
).forEach { (info, content) ->
TimelineItemCallNotifyView( TimelineItemCallNotifyView(
timelineRoomInfo = info, timelineRoomInfo = aTimelineRoomInfo(isDm = isDm),
event = aTimelineItemEvent(content = content), event = aTimelineItemEvent(content = content),
content = content, content = content,
onLongClick = {}, onLongClick = {},
@ -143,3 +143,5 @@ internal fun TimelineItemCallNotifyViewPreview() = ElementPreview {
} }
} }
} }
}
}