fix: Disable BackgroundMessageView button when it's clicked (#742)

This commit is contained in:
Nik Clayton 2024-06-13 21:12:11 +02:00 committed by GitHub
parent d6b36bf976
commit 3b5d7d3f2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -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)
}