mirror of
https://github.com/Corewala/Buran
synced 2025-03-12 07:06:48 +00:00
Removed protocol-breaking inline rendering of non-local links
This commit is contained in:
parent
576e47be4b
commit
8e6ca8461a
1 changed files with 16 additions and 17 deletions
|
@ -177,7 +177,6 @@ class GemtextAdapter(
|
|||
val uri = getUri(lines[holder.adapterPosition])
|
||||
println("User clicked link: $uri")
|
||||
onLink(uri, false, holder.adapterPosition)
|
||||
|
||||
}
|
||||
holder.itemView.gemtext_text_link.setOnLongClickListener {
|
||||
val uri = getUri(lines[holder.adapterPosition])
|
||||
|
@ -189,7 +188,6 @@ class GemtextAdapter(
|
|||
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])
|
||||
|
@ -198,6 +196,7 @@ class GemtextAdapter(
|
|||
true
|
||||
}
|
||||
|
||||
if(getLink(lines[holder.adapterPosition]).first() == '/'){
|
||||
when {
|
||||
inlineImages.containsKey(position) -> {
|
||||
holder.itemView.rounded_image_frame.visible(true)
|
||||
|
@ -211,16 +210,16 @@ class GemtextAdapter(
|
|||
}
|
||||
}
|
||||
}
|
||||
when {
|
||||
showInlineImages -> holder.itemView.rounded_image_frame.visible(true)
|
||||
else -> holder.itemView.rounded_image_frame.visible(false)
|
||||
}
|
||||
}
|
||||
|
||||
when {
|
||||
showInlineIcons -> holder.itemView.gemtext_text_link.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.vector_photo, 0)
|
||||
else -> holder.itemView.gemtext_text_link.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0)
|
||||
}
|
||||
|
||||
when {
|
||||
showInlineImages -> holder.itemView.rounded_image_frame.visible(true)
|
||||
else -> holder.itemView.rounded_image_frame.visible(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue