mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Merge pull request #6982 from p1gp1g/fix/autoplay-sticker
Fix autoplayed animated sticker
This commit is contained in:
commit
ed13177376
5 changed files with 8 additions and 4 deletions
2
changelog.d/6982.bugfix
Normal file
2
changelog.d/6982.bugfix
Normal file
|
@ -0,0 +1,2 @@
|
|||
Fix autoplayed animated stickers
|
||||
Increase sticker size
|
|
@ -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() }
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -68,6 +68,7 @@ class TimelineMessageLayoutFactory @Inject constructor(
|
|||
private val MSG_TYPES_WITH_TIMESTAMP_INSIDE_MESSAGE = setOf(
|
||||
MessageType.MSGTYPE_IMAGE,
|
||||
MessageType.MSGTYPE_VIDEO,
|
||||
MessageType.MSGTYPE_STICKER_LOCAL,
|
||||
MessageType.MSGTYPE_BEACON_INFO,
|
||||
MessageType.MSGTYPE_LOCATION,
|
||||
MessageType.MSGTYPE_BEACON_LOCATION_DATA,
|
||||
|
|
|
@ -275,8 +275,7 @@ class ImageContentRenderer @Inject constructor(
|
|||
}
|
||||
Mode.STICKER -> {
|
||||
// limit on width
|
||||
val maxWidthDp = min(dimensionConverter.dpToPx(120), maxImageWidth / 2)
|
||||
finalWidth = min(dimensionConverter.dpToPx(width), maxWidthDp)
|
||||
finalWidth = min(dimensionConverter.dpToPx(width), maxImageWidth * 3 / 4)
|
||||
finalHeight = finalWidth * height / width
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue