mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Fix display in Bubble mode
This commit is contained in:
parent
077977b8bf
commit
b577f6ab8e
@ -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()
|
||||
}
|
||||
}
|
||||
|
@ -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(
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user