From ac5fb1def46f24296aff348f74468ff7d4895e67 Mon Sep 17 00:00:00 2001 From: darthpaul Date: Sun, 14 Nov 2021 23:35:51 +0000 Subject: [PATCH] handle single click in select mode for attachments --- .../smsmessenger/adapters/ThreadAdapter.kt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ThreadAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ThreadAdapter.kt index 93b5b394..a294afd8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ThreadAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ThreadAdapter.kt @@ -283,7 +283,11 @@ class ThreadAdapter( builder.into(imageView.attachment_image) imageView.attachment_image.setOnClickListener { - launchViewIntent(uri, mimetype, attachment.filename) + if (actModeCallback.isSelectable) { + holder.viewClicked(message) + } else { + launchViewIntent(uri, mimetype, attachment.filename) + } } imageView.setOnLongClickListener { holder.viewLongClicked() @@ -298,7 +302,11 @@ class ThreadAdapter( } setTextColor(textColor) setOnClickListener { - launchViewIntent(uri, mimetype, attachment.filename) + if (actModeCallback.isSelectable) { + holder.viewClicked(message) + } else { + launchViewIntent(uri, mimetype, attachment.filename) + } } setOnLongClickListener { holder.viewLongClicked() @@ -317,7 +325,11 @@ class ThreadAdapter( thread_sent_attachment_label.text = attachment.filename } setOnClickListener { - launchViewIntent(uri, mimetype, attachment.filename) + if (actModeCallback.isSelectable) { + holder.viewClicked(message) + } else { + launchViewIntent(uri, mimetype, attachment.filename) + } } setOnLongClickListener { holder.viewLongClicked()