Fix display in Bubble mode

This commit is contained in:
Maxime NATUREL 2022-05-02 14:42:24 +02:00
parent 077977b8bf
commit b577f6ab8e
3 changed files with 7 additions and 2 deletions

View File

@ -30,6 +30,7 @@ import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.model.EventAnnotationsSummary
import org.matrix.android.sdk.api.session.room.model.ReadReceipt
import org.matrix.android.sdk.api.session.room.model.message.MessageBeaconInfoContent
import org.matrix.android.sdk.api.session.room.model.message.MessageBeaconLocationDataContent
import org.matrix.android.sdk.api.session.room.model.message.MessageContent
import org.matrix.android.sdk.api.session.room.model.message.MessagePollContent
import org.matrix.android.sdk.api.session.room.model.message.MessageStickerContent
@ -140,6 +141,7 @@ fun TimelineEvent.getLastMessageContent(): MessageContent? {
EventType.STICKER -> root.getClearContent().toModel<MessageStickerContent>()
in EventType.POLL_START -> (annotations?.editSummary?.latestContent ?: root.getClearContent()).toModel<MessagePollContent>()
in EventType.STATE_ROOM_BEACON_INFO -> (annotations?.editSummary?.latestContent ?: root.getClearContent()).toModel<MessageBeaconInfoContent>()
in EventType.BEACON_LOCATION_DATA -> (annotations?.editSummary?.latestContent ?: root.getClearContent()).toModel<MessageBeaconLocationDataContent>()
else -> (annotations?.editSummary?.latestContent ?: root.getClearContent()).toModel()
}
}

View File

@ -53,12 +53,15 @@ class LiveLocationShareMessageItemFactory @Inject constructor(
highlight: Boolean,
attributes: AbsMessageItem.Attributes,
): VectorEpoxyModel<*>? {
return when (val currentState = getViewState(liveLocationShareSummaryData)) {
val item = when (val currentState = getViewState(liveLocationShareSummaryData)) {
LiveLocationShareViewState.Loading -> buildLoadingItem(highlight, attributes)
LiveLocationShareViewState.Inactive -> buildInactiveItem()
is LiveLocationShareViewState.Running -> buildRunningItem(highlight, attributes, currentState)
LiveLocationShareViewState.Unkwown -> null
}
item?.layout(attributes.informationData.messageLayout.layoutRes)
return item
}
private fun buildLoadingItem(

View File

@ -146,7 +146,7 @@ class TimelineMessageLayoutFactory @Inject constructor(private val session: Sess
private fun MessageContent?.timestampInsideMessage(): Boolean {
if (this == null) return false
if (msgType == MessageType.MSGTYPE_LOCATION) return vectorPreferences.labsRenderLocationsInTimeline()
if (msgType == MessageType.MSGTYPE_LOCATION || msgType == MessageType.MSGTYPE_BEACON_LOCATION_DATA) return vectorPreferences.labsRenderLocationsInTimeline()
return this.msgType in MSG_TYPES_WITH_TIMESTAMP_INSIDE_MESSAGE
}