From e87d22d62b9289821e7a5be511cd6bc958e5207f Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Thu, 10 Jun 2021 10:39:15 +1000 Subject: [PATCH] Fix drawable state sharing --- .../securesms/conversation/v2/messages/VisibleMessageView.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageView.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageView.kt index 01a54d4484..55cde4ab14 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageView.kt @@ -33,7 +33,7 @@ import kotlin.math.roundToInt import kotlin.math.sqrt class VisibleMessageView : LinearLayout { - private val swipeToReplyIcon = ContextCompat.getDrawable(context, R.drawable.ic_baseline_reply_24)!! + private val swipeToReplyIcon = ContextCompat.getDrawable(context, R.drawable.ic_baseline_reply_24)!!.mutate() private val swipeToReplyIconRect = Rect() private var dx = 0.0f private var previousTranslationX = 0.0f @@ -179,6 +179,8 @@ class VisibleMessageView : LinearLayout { } fun recycle() { + translationX = 0.0f + swipeToReplyIcon.alpha = 0 profilePictureView.recycle() messageContentView.recycle() }