From 3b5d7d3f2d49f7e7666334a7dd240461d85deaa8 Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Thu, 13 Jun 2024 21:12:11 +0200 Subject: [PATCH] fix: Disable BackgroundMessageView button when it's clicked (#742) --- .../main/kotlin/app/pachli/core/ui/BackgroundMessageView.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/ui/src/main/kotlin/app/pachli/core/ui/BackgroundMessageView.kt b/core/ui/src/main/kotlin/app/pachli/core/ui/BackgroundMessageView.kt index c3db41cc7..f4000bead 100644 --- a/core/ui/src/main/kotlin/app/pachli/core/ui/BackgroundMessageView.kt +++ b/core/ui/src/main/kotlin/app/pachli/core/ui/BackgroundMessageView.kt @@ -126,7 +126,11 @@ class BackgroundMessageView @JvmOverloads constructor( binding.messageTextView.text = message binding.messageTextView.movementMethod = LinkMovementMethod.getInstance() binding.imageView.setImageResource(imageRes) - binding.button.setOnClickListener(clickListener) + binding.button.setOnClickListener { + it.isEnabled = false + clickListener?.invoke(it) + } + binding.button.isEnabled = true binding.button.visible(clickListener != null) }