From 648691656a9e0dff24001126f4bb624cdb72058a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 18 Dec 2019 19:20:44 +0100 Subject: [PATCH] Disable click on Stickers (#703) --- CHANGES.md | 1 + .../detail/timeline/factory/MessageItemFactory.kt | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 50279bcf0e..133dba8909 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,7 @@ Bugfix 🐛: - Render default room name when it starts with an emoji (#477) - Do not display " (IRC)" in display names https://github.com/vector-im/riot-android/issues/444 - Fix rendering issue with HTML formatted body + - Disable click on Stickers (#703) Translations 🗣: - diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt index 30f4e94cfb..c2b2b67129 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt @@ -181,10 +181,14 @@ class MessageItemFactory @Inject constructor( .playable(messageContent.info?.mimeType == "image/gif") .highlighted(highlight) .mediaData(data) - .clickListener( - DebouncedClickListener(View.OnClickListener { view -> - callback?.onImageMessageClicked(messageContent, data, view) - })) + .apply { + if (messageContent.type != MessageType.MSGTYPE_STICKER_LOCAL) { + clickListener( + DebouncedClickListener(View.OnClickListener { view -> + callback?.onImageMessageClicked(messageContent, data, view) + })) + } + } } private fun buildVideoMessageItem(messageContent: MessageVideoContent,