Added option to disable image thumbnails

This commit is contained in:
M66B
2020-06-29 09:14:52 +02:00
parent 14371f489b
commit e4457d5b9c
5 changed files with 32 additions and 6 deletions

View File

@@ -249,6 +249,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private boolean preview_italic;
private int preview_lines;
private boolean attachments_alt;
private boolean thumbnails;
private boolean contrast;
private boolean monospaced;
private boolean inline;
@@ -2353,9 +2354,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
});
List<EntityAttachment> images = new ArrayList<>();
for (EntityAttachment attachment : attachments)
if (attachment.isAttachment() && attachment.isImage())
images.add(attachment);
if (thumbnails)
for (EntityAttachment attachment : attachments)
if (attachment.isAttachment() && attachment.isImage())
images.add(attachment);
adapterImage.set(images);
grpImages.setVisibility(images.size() > 0 ? View.VISIBLE : View.GONE);
}
@@ -4997,6 +4999,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.preview_italic = prefs.getBoolean("preview_italic", true);
this.preview_lines = prefs.getInt("preview_lines", 2);
this.attachments_alt = prefs.getBoolean("attachments_alt", false);
this.thumbnails = prefs.getBoolean("thumbnails", true);
this.contrast = prefs.getBoolean("contrast", false);
this.monospaced = prefs.getBoolean("monospaced", false);
this.inline = prefs.getBoolean("inline_images", false);