Merge pull request #251 from KryptKode/feat/longpress-attachment

handle long-press of attachment
This commit is contained in:
Tibor Kaputa 2021-11-15 14:42:57 +01:00 committed by GitHub
commit 3f83c69324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 3 deletions

View File

@ -283,7 +283,15 @@ 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()
true
}
} else {
if (message.isReceivedMessage()) {
@ -294,7 +302,15 @@ 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()
true
}
}
}
@ -309,7 +325,15 @@ 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()
true
}
}
}