diff options
author | Marcel Hibbe <dev@mhibbe.de> | 2022-10-06 13:45:53 +0300 |
---|---|---|
committer | Marcel Hibbe <dev@mhibbe.de> | 2022-10-06 13:45:53 +0300 |
commit | 66eea709b48b65358b28e7b68d0a2f257a56b786 (patch) | |
tree | a26dbc7f2ce4202ed48375a5b3ac26fdc76aff50 /app | |
parent | 9bc42334d4b7c72094c00c950f147127c0ca5b2e (diff) |
open MessageActionsDialog on long click on link previews.
rename ReactionsInterface.kt to CommonMessageInterface.kt
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Diffstat (limited to 'app')
14 files changed, 81 insertions, 68 deletions
diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/ReactionsInterface.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/CommonMessageInterface.kt index 589c6e363..a40509b30 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/ReactionsInterface.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/CommonMessageInterface.kt @@ -2,7 +2,7 @@ package com.nextcloud.talk.adapters.messages import com.nextcloud.talk.models.json.chat.ChatMessage -interface ReactionsInterface { +interface CommonMessageInterface { fun onClickReactions(chatMessage: ChatMessage) - fun onLongClickReactions(chatMessage: ChatMessage) + fun onOpenMessageActionsDialog(chatMessage: ChatMessage) } diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt index 554b2ec13..14f96025c 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt @@ -68,7 +68,7 @@ class IncomingLinkPreviewMessageViewHolder(incomingView: View, payload: Any) : M lateinit var message: ChatMessage - lateinit var reactionsInterface: ReactionsInterface + lateinit var commonMessageInterface: CommonMessageInterface @SuppressLint("SetTextI18n") override fun onBind(message: ChatMessage) { @@ -91,6 +91,10 @@ class IncomingLinkPreviewMessageViewHolder(incomingView: View, payload: Any) : M binding.referenceInclude, context ) + binding.referenceInclude.referenceWrapper.setOnLongClickListener { l: View? -> + commonMessageInterface.onOpenMessageActionsDialog(message) + true + } Reaction().showReactions( message, @@ -100,10 +104,10 @@ class IncomingLinkPreviewMessageViewHolder(incomingView: View, payload: Any) : M viewThemeUtils ) binding.reactions.reactionsEmojiWrapper.setOnClickListener { - reactionsInterface.onClickReactions(message) + commonMessageInterface.onClickReactions(message) } binding.reactions.reactionsEmojiWrapper.setOnLongClickListener { l: View? -> - reactionsInterface.onLongClickReactions(message) + commonMessageInterface.onOpenMessageActionsDialog(message) true } } @@ -197,8 +201,8 @@ class IncomingLinkPreviewMessageViewHolder(incomingView: View, payload: Any) : M } } - fun assignReactionInterface(reactionsInterface: ReactionsInterface) { - this.reactionsInterface = reactionsInterface + fun assignCommonMessageInterface(commonMessageInterface: CommonMessageInterface) { + this.commonMessageInterface = commonMessageInterface } companion object { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt index d579503c7..64b489216 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt @@ -78,7 +78,7 @@ class IncomingLocationMessageViewHolder(incomingView: View, payload: Any) : Mess @Inject lateinit var viewThemeUtils: ViewThemeUtils - lateinit var reactionsInterface: ReactionsInterface + lateinit var commonMessageInterface: CommonMessageInterface @SuppressLint("SetTextI18n") override fun onBind(message: ChatMessage) { @@ -109,10 +109,10 @@ class IncomingLocationMessageViewHolder(incomingView: View, payload: Any) : Mess viewThemeUtils ) binding.reactions.reactionsEmojiWrapper.setOnClickListener { - reactionsInterface.onClickReactions(message) + commonMessageInterface.onClickReactions(message) } binding.reactions.reactionsEmojiWrapper.setOnLongClickListener { l: View? -> - reactionsInterface.onLongClickReactions(message) + commonMessageInterface.onOpenMessageActionsDialog(message) true } } @@ -267,8 +267,8 @@ class IncomingLocationMessageViewHolder(incomingView: View, payload: Any) : Mess return locationGeoLink.replace("geo:", "geo:0,0?q=") } - fun assignReactionInterface(reactionsInterface: ReactionsInterface) { - this.reactionsInterface = reactionsInterface + fun assignCommonMessageInterface(commonMessageInterface: CommonMessageInterface) { + this.commonMessageInterface = commonMessageInterface } companion object { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt index 937c95ed5..d3e7dcd78 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt @@ -68,7 +68,7 @@ class IncomingPollMessageViewHolder(incomingView: View, payload: Any) : MessageH lateinit var message: ChatMessage - lateinit var reactionsInterface: ReactionsInterface + lateinit var commonMessageInterface: CommonMessageInterface @SuppressLint("SetTextI18n") override fun onBind(message: ChatMessage) { @@ -95,10 +95,10 @@ class IncomingPollMessageViewHolder(incomingView: View, payload: Any) : MessageH viewThemeUtils ) binding.reactions.reactionsEmojiWrapper.setOnClickListener { - reactionsInterface.onClickReactions(message) + commonMessageInterface.onClickReactions(message) } binding.reactions.reactionsEmojiWrapper.setOnLongClickListener { l: View? -> - reactionsInterface.onLongClickReactions(message) + commonMessageInterface.onOpenMessageActionsDialog(message) true } } @@ -228,8 +228,8 @@ class IncomingPollMessageViewHolder(incomingView: View, payload: Any) : MessageH } } - fun assignReactionInterface(reactionsInterface: ReactionsInterface) { - this.reactionsInterface = reactionsInterface + fun assignCommonMessageInterface(commonMessageInterface: CommonMessageInterface) { + this.commonMessageInterface = commonMessageInterface } companion object { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt index a11e737a4..10f6284a9 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt @@ -76,7 +76,7 @@ class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) : Message lateinit var message: ChatMessage lateinit var voiceMessageInterface: VoiceMessageInterface - lateinit var reactionsInterface: ReactionsInterface + lateinit var commonMessageInterface: CommonMessageInterface @SuppressLint("SetTextI18n") override fun onBind(message: ChatMessage) { @@ -153,10 +153,10 @@ class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) : Message viewThemeUtils ) binding.reactions.reactionsEmojiWrapper.setOnClickListener { - reactionsInterface.onClickReactions(message) + commonMessageInterface.onClickReactions(message) } binding.reactions.reactionsEmojiWrapper.setOnLongClickListener { l: View? -> - reactionsInterface.onLongClickReactions(message) + commonMessageInterface.onOpenMessageActionsDialog(message) true } } @@ -307,8 +307,8 @@ class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) : Message this.voiceMessageInterface = voiceMessageInterface } - fun assignReactionInterface(reactionsInterface: ReactionsInterface) { - this.reactionsInterface = reactionsInterface + fun assignCommonMessageInterface(commonMessageInterface: CommonMessageInterface) { + this.commonMessageInterface = commonMessageInterface } companion object { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicIncomingTextMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicIncomingTextMessageViewHolder.kt index db93d9e90..c8f2a7a2e 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicIncomingTextMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicIncomingTextMessageViewHolder.kt @@ -69,7 +69,7 @@ class MagicIncomingTextMessageViewHolder(itemView: View, payload: Any) : Message @Inject lateinit var appPreferences: AppPreferences - lateinit var reactionsInterface: ReactionsInterface + lateinit var commonMessageInterface: CommonMessageInterface override fun onBind(message: ChatMessage) { super.onBind(message) @@ -125,10 +125,10 @@ class MagicIncomingTextMessageViewHolder(itemView: View, payload: Any) : Message viewThemeUtils ) binding.reactions.reactionsEmojiWrapper.setOnClickListener { - reactionsInterface.onClickReactions(message) + commonMessageInterface.onClickReactions(message) } binding.reactions.reactionsEmojiWrapper.setOnLongClickListener { l: View? -> - reactionsInterface.onLongClickReactions(message) + commonMessageInterface.onOpenMessageActionsDialog(message) true } } @@ -249,8 +249,8 @@ class MagicIncomingTextMessageViewHolder(itemView: View, payload: Any) : Message return messageStringInternal } - fun assignReactionInterface(reactionsInterface: ReactionsInterface) { - this.reactionsInterface = reactionsInterface + fun assignCommonMessageInterface(commonMessageInterface: CommonMessageInterface) { + this.commonMessageInterface = commonMessageInterface } companion object { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicOutcomingTextMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicOutcomingTextMessageViewHolder.kt index 4ae870b0f..66a0d4f3f 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicOutcomingTextMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicOutcomingTextMessageViewHolder.kt @@ -60,7 +60,7 @@ class MagicOutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessage @Inject lateinit var viewThemeUtils: ViewThemeUtils - lateinit var reactionsInterface: ReactionsInterface + lateinit var commonMessageInterface: CommonMessageInterface override fun onBind(message: ChatMessage) { super.onBind(message) @@ -123,10 +123,10 @@ class MagicOutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessage Reaction().showReactions(message, binding.reactions, context, true, viewThemeUtils) binding.reactions.reactionsEmojiWrapper.setOnClickListener { - reactionsInterface.onClickReactions(message) + commonMessageInterface.onClickReactions(message) } binding.reactions.reactionsEmojiWrapper.setOnLongClickListener { l: View? -> - reactionsInterface.onLongClickReactions(message) + commonMessageInterface.onOpenMessageActionsDialog(message) true } } @@ -193,8 +193,8 @@ class MagicOutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessage return messageString1 } - fun assignReactionInterface(reactionsInterface: ReactionsInterface) { - this.reactionsInterface = reactionsInterface + fun assignCommonMessageInterface(commonMessageInterface: CommonMessageInterface) { + this.commonMessageInterface = commonMessageInterface } companion object { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicPreviewMessageViewHolder.java b/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicPreviewMessageViewHolder.java index d61e5df5f..ca7394341 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicPreviewMessageViewHolder.java +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicPreviewMessageViewHolder.java @@ -108,7 +108,7 @@ public abstract class MagicPreviewMessageViewHolder extends MessageHolders.Incom View clickView; - ReactionsInterface reactionsInterface; + CommonMessageInterface commonMessageInterface; PreviewMessageInterface previewMessageInterface; public MagicPreviewMessageViewHolder(View itemView, Object payload) { @@ -251,10 +251,10 @@ public abstract class MagicPreviewMessageViewHolder extends MessageHolders.Incom true, viewThemeUtils); reactionsBinding.reactionsEmojiWrapper.setOnClickListener(l -> { - reactionsInterface.onClickReactions(message); + commonMessageInterface.onClickReactions(message); }); reactionsBinding.reactionsEmojiWrapper.setOnLongClickListener(l -> { - reactionsInterface.onLongClickReactions(message); + commonMessageInterface.onOpenMessageActionsDialog(message); return true; }); } @@ -347,8 +347,8 @@ public abstract class MagicPreviewMessageViewHolder extends MessageHolders.Incom }); } - public void assignReactionInterface(ReactionsInterface reactionsInterface) { - this.reactionsInterface = reactionsInterface; + public void assignCommonMessageInterface(CommonMessageInterface commonMessageInterface) { + this.commonMessageInterface = commonMessageInterface; } public void assignPreviewMessageInterface(PreviewMessageInterface previewMessageInterface) { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLinkPreviewMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLinkPreviewMessageViewHolder.kt index 4f1f03a4a..7d501e646 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLinkPreviewMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLinkPreviewMessageViewHolder.kt @@ -63,7 +63,7 @@ class OutcomingLinkPreviewMessageViewHolder(outcomingView: View, payload: Any) : lateinit var message: ChatMessage - lateinit var reactionsInterface: ReactionsInterface + lateinit var commonMessageInterface: CommonMessageInterface @SuppressLint("SetTextI18n") override fun onBind(message: ChatMessage) { @@ -109,6 +109,10 @@ class OutcomingLinkPreviewMessageViewHolder(outcomingView: View, payload: Any) : binding.referenceInclude, context ) + binding.referenceInclude.referenceWrapper.setOnLongClickListener { l: View? -> + commonMessageInterface.onOpenMessageActionsDialog(message) + true + } Reaction().showReactions( message, @@ -118,10 +122,10 @@ class OutcomingLinkPreviewMessageViewHolder(outcomingView: View, payload: Any) : viewThemeUtils ) binding.reactions.reactionsEmojiWrapper.setOnClickListener { - reactionsInterface.onClickReactions(message) + commonMessageInterface.onClickReactions(message) } binding.reactions.reactionsEmojiWrapper.setOnLongClickListener { l: View? -> - reactionsInterface.onLongClickReactions(message) + commonMessageInterface.onOpenMessageActionsDialog(message) true } } @@ -158,8 +162,8 @@ class OutcomingLinkPreviewMessageViewHolder(outcomingView: View, payload: Any) : viewThemeUtils.talk.themeOutgoingMessageBubble(bubble, message.isGrouped, message.isDeleted) } - fun assignReactionInterface(reactionsInterface: ReactionsInterface) { - this.reactionsInterface = reactionsInterface + fun assignCommonMessageInterface(commonMessageInterface: CommonMessageInterface) { + this.commonMessageInterface = commonMessageInterface } companion object { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLocationMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLocationMessageViewHolder.kt index 209b24496..148c45a4d 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLocationMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLocationMessageViewHolder.kt @@ -70,7 +70,7 @@ class OutcomingLocationMessageViewHolder(incomingView: View) : MessageHolders @Inject lateinit var viewThemeUtils: ViewThemeUtils - lateinit var reactionsInterface: ReactionsInterface + lateinit var commonMessageInterface: CommonMessageInterface @SuppressLint("SetTextI18n") override fun onBind(message: ChatMessage) { @@ -128,10 +128,10 @@ class OutcomingLocationMessageViewHolder(incomingView: View) : MessageHolders viewThemeUtils ) binding.reactions.reactionsEmojiWrapper.setOnClickListener { - reactionsInterface.onClickReactions(message) + commonMessageInterface.onClickReactions(message) } binding.reactions.reactionsEmojiWrapper.setOnLongClickListener { l: View? -> - reactionsInterface.onLongClickReactions(message) + commonMessageInterface.onOpenMessageActionsDialog(message) true } } @@ -242,8 +242,8 @@ class OutcomingLocationMessageViewHolder(incomingView: View) : MessageHolders return locationGeoLink.replace("geo:", "geo:0,0?q=") } - fun assignReactionInterface(reactionsInterface: ReactionsInterface) { - this.reactionsInterface = reactionsInterface + fun assignCommonMessageInterface(commonMessageInterface: CommonMessageInterface) { + this.commonMessageInterface = commonMessageInterface } companion object { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingPollMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingPollMessageViewHolder.kt index 47de01e13..0fb552edd 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingPollMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingPollMessageViewHolder.kt @@ -64,7 +64,7 @@ class OutcomingPollMessageViewHolder(outcomingView: View, payload: Any) : Messag lateinit var message: ChatMessage - lateinit var reactionsInterface: ReactionsInterface + lateinit var commonMessageInterface: CommonMessageInterface @SuppressLint("SetTextI18n") override fun onBind(message: ChatMessage) { @@ -114,10 +114,10 @@ class OutcomingPollMessageViewHolder(outcomingView: View, payload: Any) : Messag viewThemeUtils ) binding.reactions.reactionsEmojiWrapper.setOnClickListener { - reactionsInterface.onClickReactions(message) + commonMessageInterface.onClickReactions(message) } binding.reactions.reactionsEmojiWrapper.setOnLongClickListener { l: View? -> - reactionsInterface.onLongClickReactions(message) + commonMessageInterface.onOpenMessageActionsDialog(message) true } } @@ -190,8 +190,8 @@ class OutcomingPollMessageViewHolder(outcomingView: View, payload: Any) : Messag viewThemeUtils.talk.themeOutgoingMessageBubble(bubble, message.isGrouped, message.isDeleted) } - fun assignReactionInterface(reactionsInterface: ReactionsInterface) { - this.reactionsInterface = reactionsInterface + fun assignCommonMessageInterface(commonMessageInterface: CommonMessageInterface) { + this.commonMessageInterface = commonMessageInterface } companion object { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt index 96bed4b6c..845aa20c5 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt @@ -71,7 +71,7 @@ class OutcomingVoiceMessageViewHolder(outcomingView: View) : MessageHolders lateinit var handler: Handler lateinit var voiceMessageInterface: VoiceMessageInterface - lateinit var reactionsInterface: ReactionsInterface + lateinit var commonMessageInterface: CommonMessageInterface @SuppressLint("SetTextI18n") override fun onBind(message: ChatMessage) { @@ -146,10 +146,10 @@ class OutcomingVoiceMessageViewHolder(outcomingView: View) : MessageHolders viewThemeUtils ) binding.reactions.reactionsEmojiWrapper.setOnClickListener { - reactionsInterface.onClickReactions(message) + commonMessageInterface.onClickReactions(message) } binding.reactions.reactionsEmojiWrapper.setOnLongClickListener { l: View? -> - reactionsInterface.onLongClickReactions(message) + commonMessageInterface.onOpenMessageActionsDialog(message) true } } @@ -281,8 +281,8 @@ class OutcomingVoiceMessageViewHolder(outcomingView: View) : MessageHolders this.voiceMessageInterface = voiceMessageInterface } - fun assignReactionInterface(reactionsInterface: ReactionsInterface) { - this.reactionsInterface = reactionsInterface + fun assignCommonMessageInterface(commonMessageInterface: CommonMessageInterface) { + this.commonMessageInterface = commonMessageInterface } companion object { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/TalkMessagesListAdapter.java b/app/src/main/java/com/nextcloud/talk/adapters/messages/TalkMessagesListAdapter.java index 7f5e19f09..2947a2faa 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/TalkMessagesListAdapter.java +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/TalkMessagesListAdapter.java @@ -50,25 +50,30 @@ public class TalkMessagesListAdapter<M extends IMessage> extends MessagesListAda super.onBindViewHolder(holder, position); if (holder instanceof MagicIncomingTextMessageViewHolder) { - ((MagicIncomingTextMessageViewHolder) holder).assignReactionInterface(chatController); + ((MagicIncomingTextMessageViewHolder) holder).assignCommonMessageInterface(chatController); } else if (holder instanceof MagicOutcomingTextMessageViewHolder) { - ((MagicOutcomingTextMessageViewHolder) holder).assignReactionInterface(chatController); + ((MagicOutcomingTextMessageViewHolder) holder).assignCommonMessageInterface(chatController); } else if (holder instanceof IncomingLocationMessageViewHolder) { - ((IncomingLocationMessageViewHolder) holder).assignReactionInterface(chatController); + ((IncomingLocationMessageViewHolder) holder).assignCommonMessageInterface(chatController); } else if (holder instanceof OutcomingLocationMessageViewHolder) { - ((OutcomingLocationMessageViewHolder) holder).assignReactionInterface(chatController); + ((OutcomingLocationMessageViewHolder) holder).assignCommonMessageInterface(chatController); + + } else if (holder instanceof IncomingLinkPreviewMessageViewHolder) { + ((IncomingLinkPreviewMessageViewHolder) holder).assignCommonMessageInterface(chatController); + } else if (holder instanceof OutcomingLinkPreviewMessageViewHolder) { + ((OutcomingLinkPreviewMessageViewHolder) holder).assignCommonMessageInterface(chatController); } else if (holder instanceof IncomingVoiceMessageViewHolder) { ((IncomingVoiceMessageViewHolder) holder).assignVoiceMessageInterface(chatController); - ((IncomingVoiceMessageViewHolder) holder).assignReactionInterface(chatController); + ((IncomingVoiceMessageViewHolder) holder).assignCommonMessageInterface(chatController); } else if (holder instanceof OutcomingVoiceMessageViewHolder) { ((OutcomingVoiceMessageViewHolder) holder).assignVoiceMessageInterface(chatController); - ((OutcomingVoiceMessageViewHolder) holder).assignReactionInterface(chatController); + ((OutcomingVoiceMessageViewHolder) holder).assignCommonMessageInterface(chatController); } else if (holder instanceof MagicPreviewMessageViewHolder) { ((MagicPreviewMessageViewHolder) holder).assignPreviewMessageInterface(chatController); - ((MagicPreviewMessageViewHolder) holder).assignReactionInterface(chatController); + ((MagicPreviewMessageViewHolder) holder).assignCommonMessageInterface(chatController); } } } diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt index ad56bae97..0a227e5f7 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt @@ -106,6 +106,7 @@ import com.nextcloud.talk.R import com.nextcloud.talk.activities.CallActivity import com.nextcloud.talk.activities.MainActivity import com.nextcloud.talk.activities.TakePhotoActivity +import com.nextcloud.talk.adapters.messages.CommonMessageInterface import com.nextcloud.talk.adapters.messages.IncomingLinkPreviewMessageViewHolder import com.nextcloud.talk.adapters.messages.IncomingLocationMessageViewHolder import com.nextcloud.talk.adapters.messages.IncomingPollMessageViewHolder @@ -122,7 +123,6 @@ import com.nextcloud.talk.adapters.messages.OutcomingPollMessageViewHolder import com.nextcloud.talk.adapters.messages.OutcomingPreviewMessageViewHolder import com.nextcloud.talk.adapters.messages.OutcomingVoiceMessageViewHolder import com.nextcloud.talk.adapters.messages.PreviewMessageInterface -import com.nextcloud.talk.adapters.messages.ReactionsInterface import com.nextcloud.talk.adapters.messages.TalkMessagesListAdapter import com.nextcloud.talk.adapters.messages.VoiceMessageInterface import com.nextcloud.talk.api.NcApi @@ -224,7 +224,7 @@ class ChatController(args: Bundle) : MessagesListAdapter.OnMessageViewLongClickListener<IMessage>, ContentChecker<ChatMessage>, VoiceMessageInterface, - ReactionsInterface, + CommonMessageInterface, PreviewMessageInterface { private val binding: ControllerChatBinding by viewBinding(ControllerChatBinding::bind) @@ -2801,7 +2801,7 @@ class ChatController(args: Bundle) : } } - override fun onLongClickReactions(chatMessage: ChatMessage) { + override fun onOpenMessageActionsDialog(chatMessage: ChatMessage) { openMessageActionsDialog(chatMessage) } @@ -2810,7 +2810,7 @@ class ChatController(args: Bundle) : } override fun onPreviewMessageLongClick(chatMessage: ChatMessage) { - openMessageActionsDialog(chatMessage) + onOpenMessageActionsDialog(chatMessage) } private fun openMessageActionsDialog(iMessage: IMessage?) { |