[Message actions] New UI for replies (#545)

* Add 'reply to' UI to the message composer.

* Move the `BlurHashAsyncImage` to `:libraries:designsystem` as it is now used in several modules.

*  Create reusable `AttachmentThumbnail` and associated data classes and enums, it's now added to `:libraries:matrixui`.

* Re-use `AttachmentThumbnail` in a `ActionListView` and `TextComposer`.

* Add 'inReplyTo' models and UI.

* Add min size for images

* Create a separate layout for media items with no reply to info. Also, separate `Timeline__Row` components from `TimelineView`, as it was getting too large.

* Added `EqualWidthColumn` to use inside message bubbles. Also fixed some modifiers for media items replying to other messages.

* Disable `inReplyToClicked`.

* Remove unused resources and libraries.

* Remove any traces of `BlurHashAsyncImage` in `:features:messages`, since it was moved to the design system.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
Jorge Martin Espinosa 2023-06-08 12:15:13 +02:00 committed by GitHub
parent 1ea4e96497
commit c176eab4a3
56 changed files with 1253 additions and 1008 deletions

View file

@ -28,11 +28,25 @@ sealed interface EventContent
data class MessageContent(
val body: String,
val inReplyTo: EventId?,
val inReplyTo: InReplyTo?,
val isEdited: Boolean,
val type: MessageType?
) : EventContent
sealed interface InReplyTo {
data class NotLoaded(val eventId: EventId) : InReplyTo
data class Ready(
val eventId: EventId,
val content: MessageContent,
val senderId: UserId,
val senderDisplayName: String?,
val senderAvatarUrl: String?,
) : InReplyTo
object Error : InReplyTo
}
object RedactedContent : EventContent
data class StickerContent(

View file

@ -32,4 +32,12 @@ data class EventTimelineItem(
val senderProfile: ProfileTimelineDetails,
val timestamp: Long,
val content: EventContent
)
) {
fun inReplyTo(): InReplyTo? {
return (content as? MessageContent)?.inReplyTo
}
fun hasNotLoadedInReplyTo(): Boolean {
val details = inReplyTo()
return details is InReplyTo.NotLoaded || details is InReplyTo.Error
}
}