Added link listeners to inline images

This commit is contained in:
Corewala 2022-01-09 19:36:53 -05:00
parent 9ac10f13fd
commit 6fb947cbdd
1 changed files with 12 additions and 1 deletions

View File

@ -185,6 +185,18 @@ class GemtextAdapter(
onLink(uri, true, holder.adapterPosition)
true
}
holder.itemView.gemtext_inline_image.setOnClickListener {
val uri = getUri(lines[holder.adapterPosition])
println("User clicked image: $uri")
onLink(uri, false, holder.adapterPosition)
}
holder.itemView.gemtext_inline_image.setOnLongClickListener {
val uri = getUri(lines[holder.adapterPosition])
println("User long-clicked image: $uri")
onLink(uri, true, holder.adapterPosition)
true
}
when {
inlineImages.containsKey(position) -> {
@ -198,7 +210,6 @@ class GemtextAdapter(
println("Inline image rendered: $uri")
inlineImage(uri, holder.adapterPosition)
}
}
}