Make long press on reply do same action as long press on message

Change-Id: Icfc101e8233ba55d5e95b47dfb2530faadea56df
This commit is contained in:
SpiritCroc 2022-12-04 12:13:54 +01:00
parent 32d076cbdf
commit 048e1edb54
2 changed files with 6 additions and 1 deletions

View file

@ -273,7 +273,7 @@ abstract class AbsMessageItem<H : AbsMessageItem.Holder>(
override fun onStateUpdated(state: PreviewReplyUiState) {
replyPreviewRetriever?.let {
replyView?.render(state, it, attributes.informationData, movementMethod, coroutineScope)
replyView?.render(state, it, attributes.informationData, movementMethod, attributes.itemLongClickListener, coroutineScope)
}
}
}

View file

@ -77,6 +77,7 @@ class InReplyToView @JvmOverloads constructor(
retriever: ReplyPreviewRetriever,
roomInformationData: MessageInformationData,
movementMethod: MovementMethod?,
itemLongClickListener: OnLongClickListener?,
coroutineScope: CoroutineScope,
force: Boolean = false) {
if (newState == state && !force) {
@ -91,6 +92,10 @@ class InReplyToView @JvmOverloads constructor(
is PreviewReplyUiState.Error -> renderError(newState)
is PreviewReplyUiState.InReplyTo -> renderReplyTo(newState, retriever, roomInformationData, movementMethod, coroutineScope)
}
setOnLongClickListener(itemLongClickListener)
// Somehow this one needs it additionally?
views.replyTextView.setOnLongClickListener(itemLongClickListener)
}
override fun onClick(v: View?) {