-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trust & Decoration | Support new expected UTD causes
- Loading branch information
1 parent
3d0ae04
commit c82357c
Showing
9 changed files
with
168 additions
and
11 deletions.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
...ment/android/features/messages/impl/timeline/components/TimelineItemEventRowUtdPreview.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright 2024 New Vector Ltd. | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* Please see LICENSE in the repository root for full details. | ||
*/ | ||
|
||
package io.element.android.features.messages.impl.timeline.components | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.runtime.Composable | ||
import io.element.android.features.messages.impl.timeline.aTimelineItemEvent | ||
import io.element.android.features.messages.impl.timeline.aTimelineItemReactions | ||
import io.element.android.features.messages.impl.timeline.model.TimelineItemGroupPosition | ||
import io.element.android.features.messages.impl.timeline.model.event.TimelineItemEncryptedContent | ||
import io.element.android.libraries.designsystem.preview.ElementPreview | ||
import io.element.android.libraries.designsystem.preview.PreviewsDayNight | ||
import io.element.android.libraries.matrix.api.timeline.item.event.UnableToDecryptContent | ||
import io.element.android.libraries.matrix.api.timeline.item.event.UtdCause | ||
|
||
@PreviewsDayNight | ||
@Composable | ||
internal fun TimelineItemEventRowUtdPreview() = ElementPreview { | ||
Column { | ||
ATimelineItemEventRow( | ||
event = aTimelineItemEvent( | ||
senderDisplayName = "Alice", | ||
isMine = false, | ||
content = TimelineItemEncryptedContent( | ||
data = UnableToDecryptContent.Data.MegolmV1AesSha2( | ||
sessionId = "sessionId", | ||
utdCause = UtdCause.UnsignedDevice, | ||
) | ||
), | ||
timelineItemReactions = aTimelineItemReactions(count = 0), | ||
groupPosition = TimelineItemGroupPosition.First, | ||
), | ||
) | ||
ATimelineItemEventRow( | ||
event = aTimelineItemEvent( | ||
senderDisplayName = "Bob", | ||
isMine = false, | ||
content = TimelineItemEncryptedContent( | ||
data = UnableToDecryptContent.Data.MegolmV1AesSha2( | ||
sessionId = "sessionId", | ||
utdCause = UtdCause.VerificationViolation, | ||
) | ||
), | ||
groupPosition = TimelineItemGroupPosition.First, | ||
timelineItemReactions = aTimelineItemReactions(count = 0) | ||
), | ||
) | ||
|
||
ATimelineItemEventRow( | ||
event = aTimelineItemEvent( | ||
senderDisplayName = "Bob", | ||
isMine = false, | ||
content = TimelineItemEncryptedContent( | ||
data = UnableToDecryptContent.Data.MegolmV1AesSha2( | ||
sessionId = "sessionId", | ||
utdCause = UtdCause.SentBeforeWeJoined, | ||
) | ||
), | ||
groupPosition = TimelineItemGroupPosition.Last, | ||
timelineItemReactions = aTimelineItemReactions(count = 0) | ||
), | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters