mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-05 00:23:09 +02:00
Added option to display attachments after the message text
This commit is contained in:
@@ -151,6 +151,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
private boolean subject_italic;
|
||||
private boolean flags;
|
||||
private boolean preview;
|
||||
private boolean attachments_alt;
|
||||
private boolean monospaced;
|
||||
private boolean autohtml;
|
||||
private boolean autoimages;
|
||||
@@ -269,6 +270,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
super(itemView);
|
||||
|
||||
view = itemView.findViewById(R.id.clItem);
|
||||
|
||||
vwColor = itemView.findViewById(R.id.vwColor);
|
||||
vwStatus = itemView.findViewById(R.id.vwStatus);
|
||||
ivExpander = itemView.findViewById(R.id.ivExpander);
|
||||
@@ -293,6 +295,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
pbLoading = itemView.findViewById(R.id.pbLoading);
|
||||
vwRipple = itemView.findViewById(R.id.vwRipple);
|
||||
|
||||
ConstraintLayout inAttachments = itemView.findViewById(R.id.inAttachments);
|
||||
ConstraintLayout inAttachmentsAlt = itemView.findViewById(R.id.inAttachmentsAlt);
|
||||
inAttachments.setVisibility(attachments_alt ? View.GONE : View.VISIBLE);
|
||||
inAttachmentsAlt.setVisibility(attachments_alt ? View.VISIBLE : View.GONE);
|
||||
ConstraintLayout attachments = (attachments_alt ? inAttachmentsAlt : inAttachments);
|
||||
|
||||
ivExpanderAddress = itemView.findViewById(R.id.ivExpanderAddress);
|
||||
|
||||
ibSearchContact = itemView.findViewById(R.id.ibSearchContact);
|
||||
@@ -325,7 +333,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
pbHeaders = itemView.findViewById(R.id.pbHeaders);
|
||||
tvNoInternetHeaders = itemView.findViewById(R.id.tvNoInternetHeaders);
|
||||
|
||||
rvAttachment = itemView.findViewById(R.id.rvAttachment);
|
||||
rvAttachment = attachments.findViewById(R.id.rvAttachment);
|
||||
rvAttachment.setHasFixedSize(false);
|
||||
LinearLayoutManager llm = new LinearLayoutManager(context);
|
||||
rvAttachment.setLayoutManager(llm);
|
||||
@@ -334,10 +342,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
adapterAttachment = new AdapterAttachment(context, owner, true);
|
||||
rvAttachment.setAdapter(adapterAttachment);
|
||||
|
||||
cbInline = itemView.findViewById(R.id.cbInline);
|
||||
btnDownloadAttachments = itemView.findViewById(R.id.btnDownloadAttachments);
|
||||
btnSaveAttachments = itemView.findViewById(R.id.btnSaveAttachments);
|
||||
tvNoInternetAttachments = itemView.findViewById(R.id.tvNoInternetAttachments);
|
||||
cbInline = attachments.findViewById(R.id.cbInline);
|
||||
btnDownloadAttachments = attachments.findViewById(R.id.btnDownloadAttachments);
|
||||
btnSaveAttachments = attachments.findViewById(R.id.btnSaveAttachments);
|
||||
tvNoInternetAttachments = attachments.findViewById(R.id.tvNoInternetAttachments);
|
||||
|
||||
bnvActions = itemView.findViewById(R.id.bnvActions);
|
||||
|
||||
@@ -359,7 +367,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
|
||||
grpAddresses = itemView.findViewById(R.id.grpAddresses);
|
||||
grpHeaders = itemView.findViewById(R.id.grpHeaders);
|
||||
grpAttachments = itemView.findViewById(R.id.grpAttachments);
|
||||
grpAttachments = attachments.findViewById(R.id.grpAttachments);
|
||||
grpImages = itemView.findViewById(R.id.grpImages);
|
||||
}
|
||||
|
||||
@@ -3084,6 +3092,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
this.subject_italic = prefs.getBoolean("subject_italic", true);
|
||||
this.flags = prefs.getBoolean("flags", true);
|
||||
this.preview = prefs.getBoolean("preview", false);
|
||||
this.attachments_alt = prefs.getBoolean("attachments_alt", false);
|
||||
this.monospaced = prefs.getBoolean("monospaced", false);
|
||||
this.autohtml = (this.hasWebView && this.contacts && prefs.getBoolean("autohtml", false));
|
||||
this.autoimages = (this.contacts && prefs.getBoolean("autoimages", false));
|
||||
|
||||
@@ -39,7 +39,7 @@ public class FragmentOptions extends FragmentBase {
|
||||
|
||||
static String[] OPTIONS_RESTART = new String[]{
|
||||
"startup", "date", "threading", "avatars", "identicons", "circular", "name_email", "subject_italic", "flags", "preview",
|
||||
"addresses", "monospaced", "autohtml", "autoimages", "actionbar",
|
||||
"addresses", "attachments_alt", "monospaced", "autohtml", "autoimages", "actionbar",
|
||||
"pull", "autoscroll", "swipenav", "autoexpand", "autoclose", "autonext",
|
||||
"subscriptions",
|
||||
"authentication", "debug"
|
||||
|
||||
@@ -48,6 +48,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
private SwitchCompat swFlags;
|
||||
private SwitchCompat swPreview;
|
||||
private SwitchCompat swAddresses;
|
||||
private SwitchCompat swAttachmentsAlt;
|
||||
private SwitchCompat swMonospaced;
|
||||
private SwitchCompat swHtml;
|
||||
private SwitchCompat swImages;
|
||||
@@ -55,7 +56,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"startup", "date", "threading", "avatars", "identicons", "circular", "name_email", "subject_italic",
|
||||
"flags", "preview", "addresses", "monospaced", "autohtml", "autoimages", "actionbar",
|
||||
"flags", "preview", "addresses", "attachments_alt", "monospaced", "autohtml", "autoimages", "actionbar",
|
||||
};
|
||||
|
||||
@Override
|
||||
@@ -79,6 +80,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
swFlags = view.findViewById(R.id.swFlags);
|
||||
swPreview = view.findViewById(R.id.swPreview);
|
||||
swAddresses = view.findViewById(R.id.swAddresses);
|
||||
swAttachmentsAlt = view.findViewById(R.id.swAttachmentsAlt);
|
||||
swMonospaced = view.findViewById(R.id.swMonospaced);
|
||||
swHtml = view.findViewById(R.id.swHtml);
|
||||
swImages = view.findViewById(R.id.swImages);
|
||||
@@ -176,6 +178,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
}
|
||||
});
|
||||
|
||||
swAttachmentsAlt.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("attachments_alt", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swMonospaced.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -268,6 +277,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
swFlags.setChecked(prefs.getBoolean("flags", true));
|
||||
swPreview.setChecked(prefs.getBoolean("preview", false));
|
||||
swAddresses.setChecked(prefs.getBoolean("addresses", false));
|
||||
swAttachmentsAlt.setChecked(prefs.getBoolean("attachments_alt", false));
|
||||
swMonospaced.setChecked(prefs.getBoolean("monospaced", false));
|
||||
swHtml.setChecked(prefs.getBoolean("autohtml", false));
|
||||
swImages.setChecked(prefs.getBoolean("autoimages", false));
|
||||
|
||||
Reference in New Issue
Block a user