Hide playContentView for autoplayed animated stickers

This commit is contained in:
sim 2022-08-31 22:44:04 +02:00
parent b5debe92c0
commit 8e362f6919
2 changed files with 4 additions and 2 deletions

View File

@ -34,9 +34,11 @@ import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.content.EncryptedEventContent
import org.matrix.android.sdk.api.session.events.model.getMsgType
import org.matrix.android.sdk.api.session.events.model.isAttachmentMessage
import org.matrix.android.sdk.api.session.events.model.isSticker
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.model.ReferencesAggregatedContent
import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.matrix.android.sdk.api.session.room.model.message.MessageType
import org.matrix.android.sdk.api.session.room.model.message.MessageVerificationRequestContent
import org.matrix.android.sdk.api.session.room.send.SendState
import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent
@ -122,7 +124,7 @@ class MessageInformationDataFactory @Inject constructor(
isLastFromThisSender = isLastFromThisSender,
e2eDecoration = e2eDecoration,
sendStateDecoration = sendStateDecoration,
messageType = event.root.getMsgType()
messageType = if (event.root.isSticker()) { MessageType.MSGTYPE_STICKER_LOCAL } else { event.root.getMsgType() }
)
}

View File

@ -82,7 +82,7 @@ abstract class MessageImageVideoItem : AbsMessageItem<MessageImageVideoItem.Hold
holder.mediaContentView.onClick(attributes.itemClickListener)
holder.mediaContentView.setOnLongClickListener(attributes.itemLongClickListener)
val isImageMessage = attributes.informationData.messageType == MessageType.MSGTYPE_IMAGE
val isImageMessage = attributes.informationData.messageType in listOf(MessageType.MSGTYPE_IMAGE, MessageType.MSGTYPE_STICKER_LOCAL)
val autoplayAnimatedImages = attributes.autoplayAnimatedImages
holder.playContentView.visibility = if (playable && isImageMessage && autoplayAnimatedImages) {