Added option to show recipient for sent messages

pull/214/head
M66B 1 year ago
parent 8c42e336a4
commit 68427ca6f1

@ -9,6 +9,7 @@ For support you can use [the contact form](https://contact.faircode.eu/?product=
### Next version ### Next version
* Added tap on title/subtitle to open/switch to inbox * Added tap on title/subtitle to open/switch to inbox
* Addded option to disable showing recipient for sent messages
* Small improvements and minor bug fixes * Small improvements and minor bug fixes
* Updated [translations](https://crowdin.com/project/open-source-email) * Updated [translations](https://crowdin.com/project/open-source-email)

@ -9,6 +9,7 @@ For support you can use [the contact form](https://contact.faircode.eu/?product=
### Next version ### Next version
* Added tap on title/subtitle to open/switch to inbox * Added tap on title/subtitle to open/switch to inbox
* Addded option to disable showing recipient for sent messages
* Small improvements and minor bug fixes * Small improvements and minor bug fixes
* Updated [translations](https://crowdin.com/project/open-source-email) * Updated [translations](https://crowdin.com/project/open-source-email)

@ -283,6 +283,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private boolean only_contact; private boolean only_contact;
private boolean distinguish_contacts; private boolean distinguish_contacts;
private boolean show_recipients; private boolean show_recipients;
private boolean reverse_addresses;
private Float font_size_sender; private Float font_size_sender;
private Float font_size_subject; private Float font_size_subject;
private boolean subject_top; private boolean subject_top;
@ -1255,13 +1256,14 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
boolean inbox = EntityFolder.INBOX.equals(message.folderType); boolean inbox = EntityFolder.INBOX.equals(message.folderType);
boolean outbox = EntityFolder.OUTBOX.equals(message.folderType); boolean outbox = EntityFolder.OUTBOX.equals(message.folderType);
boolean outgoing = isOutgoing(message); boolean outgoing = isOutgoing(message);
boolean reverse = (outgoing && viewType != ViewType.THREAD && boolean reverse = reverse_addresses &&
(EntityFolder.isOutgoing(type) || viewType == ViewType.SEARCH)) || ((outgoing && viewType != ViewType.THREAD &&
(viewType == ViewType.UNIFIED && type == null && (EntityFolder.isOutgoing(type) || viewType == ViewType.SEARCH)) ||
message.folderUnified && outgoing) || (viewType == ViewType.UNIFIED && type == null &&
(viewType == ViewType.FOLDER && message.folderUnified && outgoing) ||
message.folderUnified && outgoing) || (viewType == ViewType.FOLDER &&
EntityFolder.isOutgoing(message.folderInheritedType); message.folderUnified && outgoing) ||
EntityFolder.isOutgoing(message.folderInheritedType));
String selector = (reverse ? null : message.bimi_selector); String selector = (reverse ? null : message.bimi_selector);
Address[] addresses = (reverse ? message.to : (message.isForwarder() ? message.submitter : message.from)); Address[] addresses = (reverse ? message.to : (message.isForwarder() ? message.submitter : message.from));
Address[] senders = ContactInfo.fillIn( Address[] senders = ContactInfo.fillIn(
@ -7950,6 +7952,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.only_contact = prefs.getBoolean("only_contact", false); this.only_contact = prefs.getBoolean("only_contact", false);
this.distinguish_contacts = prefs.getBoolean("distinguish_contacts", false); this.distinguish_contacts = prefs.getBoolean("distinguish_contacts", false);
this.show_recipients = prefs.getBoolean("show_recipients", false); this.show_recipients = prefs.getBoolean("show_recipients", false);
this.reverse_addresses = prefs.getBoolean("reverse_addresses", true);
this.subject_top = prefs.getBoolean("subject_top", false); this.subject_top = prefs.getBoolean("subject_top", false);

@ -146,7 +146,7 @@ public class FragmentOptions extends FragmentBase {
"avatars", "bimi", "gravatars", "libravatars", "favicons", "favicons_partial", "favicons_manifest", "generated_icons", "identicons", "avatars", "bimi", "gravatars", "libravatars", "favicons", "favicons_partial", "favicons_manifest", "generated_icons", "identicons",
"circular", "saturation", "brightness", "threshold", "circular", "saturation", "brightness", "threshold",
"authentication", "authentication_indicator", "authentication", "authentication_indicator",
"email_format", "prefer_contact", "only_contact", "distinguish_contacts", "show_recipients", "email_format", "prefer_contact", "only_contact", "distinguish_contacts", "show_recipients", "reverse_addresses",
"font_size_sender", "sender_ellipsize", "font_size_sender", "sender_ellipsize",
"subject_top", "subject_italic", "highlight_subject", "font_size_subject", "subject_ellipsize", "subject_top", "subject_italic", "highlight_subject", "font_size_subject", "subject_ellipsize",
"keywords_header", "labels_header", "flags", "flags_background", "preview", "preview_italic", "preview_lines", "align_header", "keywords_header", "labels_header", "flags", "flags_background", "preview", "preview_italic", "preview_lines", "align_header",

@ -141,6 +141,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swOnlyContact; private SwitchCompat swOnlyContact;
private SwitchCompat swDistinguishContacts; private SwitchCompat swDistinguishContacts;
private SwitchCompat swShowRecipients; private SwitchCompat swShowRecipients;
private SwitchCompat swReverseAddresses;
private Spinner spFontSizeSender; private Spinner spFontSizeSender;
private Spinner spSenderEllipsize; private Spinner spSenderEllipsize;
@ -211,7 +212,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"highlight_unread", "highlight_color", "color_stripe", "color_stripe_wide", "highlight_unread", "highlight_color", "color_stripe", "color_stripe_wide",
"avatars", "bimi", "gravatars", "libravatars", "favicons", "favicons_partial", "favicons_manifest", "generated_icons", "identicons", "avatars", "bimi", "gravatars", "libravatars", "favicons", "favicons_partial", "favicons_manifest", "generated_icons", "identicons",
"circular", "saturation", "brightness", "threshold", "circular", "saturation", "brightness", "threshold",
"email_format", "prefer_contact", "only_contact", "distinguish_contacts", "show_recipients", "email_format", "prefer_contact", "only_contact", "distinguish_contacts", "show_recipients", "reverse_addresses",
"font_size_sender", "sender_ellipsize", "font_size_sender", "sender_ellipsize",
"subject_top", "subject_italic", "highlight_subject", "font_size_subject", "subject_ellipsize", "subject_top", "subject_italic", "highlight_subject", "font_size_subject", "subject_ellipsize",
"keywords_header", "labels_header", "flags", "flags_background", "keywords_header", "labels_header", "flags", "flags_background",
@ -314,6 +315,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swOnlyContact = view.findViewById(R.id.swOnlyContact); swOnlyContact = view.findViewById(R.id.swOnlyContact);
swDistinguishContacts = view.findViewById(R.id.swDistinguishContacts); swDistinguishContacts = view.findViewById(R.id.swDistinguishContacts);
swShowRecipients = view.findViewById(R.id.swShowRecipients); swShowRecipients = view.findViewById(R.id.swShowRecipients);
swReverseAddresses = view.findViewById(R.id.swReverseAddresses);
spFontSizeSender = view.findViewById(R.id.spFontSizeSender); spFontSizeSender = view.findViewById(R.id.spFontSizeSender);
spSenderEllipsize = view.findViewById(R.id.spSenderEllipsize); spSenderEllipsize = view.findViewById(R.id.spSenderEllipsize);
@ -1017,6 +1019,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
} }
}); });
swReverseAddresses.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("reverse_addresses", checked).apply();
}
});
spFontSizeSender.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { spFontSizeSender.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override @Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) { public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
@ -1574,6 +1583,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swOnlyContact.setChecked(prefs.getBoolean("only_contact", false)); swOnlyContact.setChecked(prefs.getBoolean("only_contact", false));
swDistinguishContacts.setChecked(prefs.getBoolean("distinguish_contacts", false)); swDistinguishContacts.setChecked(prefs.getBoolean("distinguish_contacts", false));
swShowRecipients.setChecked(prefs.getBoolean("show_recipients", false)); swShowRecipients.setChecked(prefs.getBoolean("show_recipients", false));
swReverseAddresses.setChecked(prefs.getBoolean("reverse_addresses", true));
swSubjectTop.setChecked(prefs.getBoolean("subject_top", false)); swSubjectTop.setChecked(prefs.getBoolean("subject_top", false));
swSubjectItalic.setChecked(prefs.getBoolean("subject_italic", true)); swSubjectItalic.setChecked(prefs.getBoolean("subject_italic", true));

@ -1341,6 +1341,18 @@
app:layout_constraintTop_toBottomOf="@id/swDistinguishContacts" app:layout_constraintTop_toBottomOf="@id/swDistinguishContacts"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swReverseAddresses"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_reverse_addresses"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swShowRecipients"
app:switchPadding="12dp" />
<TextView <TextView
android:id="@+id/tvFontSizeSender" android:id="@+id/tvFontSizeSender"
android:layout_width="0dp" android:layout_width="0dp"
@ -1352,7 +1364,7 @@
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swShowRecipients" /> app:layout_constraintTop_toBottomOf="@id/swReverseAddresses" />
<Spinner <Spinner
android:id="@+id/spFontSizeSender" android:id="@+id/spFontSizeSender"

@ -591,6 +591,7 @@
<string name="title_advanced_only_name">Display contact names only</string> <string name="title_advanced_only_name">Display contact names only</string>
<string name="title_advanced_distinguish_contacts">Underline the sender when the sender is known as local \'to\' contact</string> <string name="title_advanced_distinguish_contacts">Underline the sender when the sender is known as local \'to\' contact</string>
<string name="title_advanced_show_recipients">Show recipients in message header</string> <string name="title_advanced_show_recipients">Show recipients in message header</string>
<string name="title_advanced_reverse_addresses">Show recipient for sent messages</string>
<string name="title_advanced_font_size_sender">Text size sender</string> <string name="title_advanced_font_size_sender">Text size sender</string>
<string name="title_advanced_sender_ellipsize">If needed, shorten the sender</string> <string name="title_advanced_sender_ellipsize">If needed, shorten the sender</string>

@ -9,6 +9,7 @@ Vallibonavenatrix
Next version Next version
* Added tap on title/subtitle to open/switch to inbox * Added tap on title/subtitle to open/switch to inbox
* Addded option to disable showing recipient for sent messages
* Small improvements and minor bug fixes * Small improvements and minor bug fixes
* Updated translations * Updated translations

Loading…
Cancel
Save