mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-04 06:20:26 +00:00
Use inline image viewer for unlinked images only
This commit is contained in:
parent
aa463b3701
commit
8543f43c0f
1 changed files with 10 additions and 11 deletions
|
@ -1769,24 +1769,23 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
int line = layout.getLineForVertical(y);
|
||||
int off = layout.getOffsetForHorizontal(line, x);
|
||||
|
||||
boolean show_images = properties.getValue("images", id);
|
||||
URLSpan[] link = buffer.getSpans(off, off, URLSpan.class);
|
||||
if (link.length > 0) {
|
||||
String url = link[0].getURL();
|
||||
Uri uri = Uri.parse(url);
|
||||
if (uri.getScheme() == null)
|
||||
uri = Uri.parse("https://" + url);
|
||||
onOpenLink(uri);
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean show_images = properties.getValue("images", id);
|
||||
if (show_images) {
|
||||
ImageSpan[] image = buffer.getSpans(off, off, ImageSpan.class);
|
||||
if (image.length > 0) {
|
||||
onOpenImage(image[0].getDrawable(), image[0].getSource());
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
URLSpan[] link = buffer.getSpans(off, off, URLSpan.class);
|
||||
if (link.length > 0) {
|
||||
String url = link[0].getURL();
|
||||
Uri uri = Uri.parse(url);
|
||||
if (uri.getScheme() == null)
|
||||
uri = Uri.parse("https://" + url);
|
||||
onOpenLink(uri);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue