Added option to show recipient for sent messages

This commit is contained in:
M66B 2023-10-24 07:46:20 +02:00
parent 8c42e336a4
commit 68427ca6f1
8 changed files with 39 additions and 10 deletions

View File

@ -9,6 +9,7 @@ For support you can use [the contact form](https://contact.faircode.eu/?product=
### Next version
* 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
* Updated [translations](https://crowdin.com/project/open-source-email)

View File

@ -9,6 +9,7 @@ For support you can use [the contact form](https://contact.faircode.eu/?product=
### Next version
* 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
* Updated [translations](https://crowdin.com/project/open-source-email)

View File

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

View File

@ -146,7 +146,7 @@ public class FragmentOptions extends FragmentBase {
"avatars", "bimi", "gravatars", "libravatars", "favicons", "favicons_partial", "favicons_manifest", "generated_icons", "identicons",
"circular", "saturation", "brightness", "threshold",
"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",
"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",

View File

@ -141,6 +141,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swOnlyContact;
private SwitchCompat swDistinguishContacts;
private SwitchCompat swShowRecipients;
private SwitchCompat swReverseAddresses;
private Spinner spFontSizeSender;
private Spinner spSenderEllipsize;
@ -211,7 +212,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"highlight_unread", "highlight_color", "color_stripe", "color_stripe_wide",
"avatars", "bimi", "gravatars", "libravatars", "favicons", "favicons_partial", "favicons_manifest", "generated_icons", "identicons",
"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",
"subject_top", "subject_italic", "highlight_subject", "font_size_subject", "subject_ellipsize",
"keywords_header", "labels_header", "flags", "flags_background",
@ -314,6 +315,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swOnlyContact = view.findViewById(R.id.swOnlyContact);
swDistinguishContacts = view.findViewById(R.id.swDistinguishContacts);
swShowRecipients = view.findViewById(R.id.swShowRecipients);
swReverseAddresses = view.findViewById(R.id.swReverseAddresses);
spFontSizeSender = view.findViewById(R.id.spFontSizeSender);
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() {
@Override
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));
swDistinguishContacts.setChecked(prefs.getBoolean("distinguish_contacts", false));
swShowRecipients.setChecked(prefs.getBoolean("show_recipients", false));
swReverseAddresses.setChecked(prefs.getBoolean("reverse_addresses", true));
swSubjectTop.setChecked(prefs.getBoolean("subject_top", false));
swSubjectItalic.setChecked(prefs.getBoolean("subject_italic", true));

View File

@ -1341,6 +1341,18 @@
app:layout_constraintTop_toBottomOf="@id/swDistinguishContacts"
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
android:id="@+id/tvFontSizeSender"
android:layout_width="0dp"
@ -1352,7 +1364,7 @@
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swShowRecipients" />
app:layout_constraintTop_toBottomOf="@id/swReverseAddresses" />
<Spinner
android:id="@+id/spFontSizeSender"

View File

@ -591,6 +591,7 @@
<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_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_sender_ellipsize">If needed, shorten the sender</string>

View File

@ -9,6 +9,7 @@ Vallibonavenatrix
Next version
* 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
* Updated translations