From 517539a8376b3f8d04c84fe17c2515d1cdf377e8 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 21 Jun 2021 14:00:48 +1000 Subject: [PATCH] Fix cell re-use issue --- .../conversation/v2/ConversationActivityV2.kt | 1 - .../v2/messages/ControlMessageView.kt | 16 ++++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt index 1a11d12ed9..d64d75a82d 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt @@ -64,7 +64,6 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe handleLongPress(message, position) } ) - adapter.setHasStableIds(true) adapter } diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/ControlMessageView.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/ControlMessageView.kt index 630fdadfa9..490272d8e4 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/ControlMessageView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/ControlMessageView.kt @@ -13,19 +13,11 @@ import org.thoughtcrime.securesms.database.model.MessageRecord class ControlMessageView : LinearLayout { // region Lifecycle - constructor(context: Context) : super(context) { - setUpViewHierarchy() - } + constructor(context: Context) : super(context) { initialize() } + constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { initialize() } + constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { initialize() } - constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { - setUpViewHierarchy() - } - - constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { - setUpViewHierarchy() - } - - private fun setUpViewHierarchy() { + private fun initialize() { LayoutInflater.from(context).inflate(R.layout.view_control_message, this) } // endregion