Added auto list option

pull/182/head
M66B 4 years ago
parent a57ed6d927
commit 6513454f68

@ -50,6 +50,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private SwitchCompat swSendReminders;
private Spinner spSendDelayed;
private SwitchCompat swAutoList;
private SwitchCompat swPrefixOnce;
private SwitchCompat swExtendedReply;
private SwitchCompat swQuoteReply;
@ -69,7 +70,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private final static String[] RESET_OPTIONS = new String[]{
"keyboard", "suggest_sent", "suggested_received", "suggest_frequently",
"send_reminders", "send_delayed",
"prefix_once", "extended_reply", "quote_reply", "resize_reply",
"autolist", "prefix_once", "extended_reply", "quote_reply", "resize_reply",
"signature_location", "signature_reply", "signature_forward",
"plain_only", "format_flowed", "usenet_signature", "remove_signatures",
"receipt_default", "receipt_type", "lookup_mx"
@ -93,6 +94,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swSendReminders = view.findViewById(R.id.swSendReminders);
spSendDelayed = view.findViewById(R.id.spSendDelayed);
swAutoList = view.findViewById(R.id.swAutoList);
swPrefixOnce = view.findViewById(R.id.swPrefixOnce);
swExtendedReply = view.findViewById(R.id.swExtendedReply);
swQuoteReply = view.findViewById(R.id.swQuoteReply);
@ -173,6 +175,13 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
}
});
swAutoList.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("autolist", checked).apply();
}
});
swPrefixOnce.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -342,6 +351,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
break;
}
swAutoList.setChecked(prefs.getBoolean("autolist", true));
swPrefixOnce.setChecked(prefs.getBoolean("prefix_once", true));
swExtendedReply.setChecked(prefs.getBoolean("extended_reply", false));
swQuoteReply.setChecked(prefs.getBoolean("quote_reply", true));

@ -538,12 +538,17 @@ public class MessageHelper {
return;
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean autolist = prefs.getBoolean("autolist", true);
boolean format_flowed = prefs.getBoolean("format_flowed", false);
// Build html body
Document document = JsoupEx.parse(message.getFile(context));
// When sending message
if (identity != null) {
HtmlHelper.convertLists(document);
if (autolist)
HtmlHelper.convertLists(document);
if (send) {
document.select("div[fairemail=signature]").removeAttr("fairemail");
@ -605,9 +610,6 @@ public class MessageHelper {
}
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean format_flowed = prefs.getBoolean("format_flowed", false);
// multipart/mixed
// multipart/related
// multipart/alternative

@ -168,6 +168,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spSendDelayed" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAutoList"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_auto_list"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCaptionMessage"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swPrefixOnce"
android:layout_width="0dp"
@ -177,7 +189,7 @@
android:text="@string/title_advanced_prefix_once"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCaptionMessage"
app:layout_constraintTop_toBottomOf="@id/swAutoList"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat

@ -287,6 +287,7 @@
<string name="title_advanced_suggest_sent">Suggest addresses found in sent messages</string>
<string name="title_advanced_suggest_received">Suggest addresses found in received messages</string>
<string name="title_advanced_suggest_frequently">Sort suggested addresses on frequency of use</string>
<string name="title_advanced_auto_list">Automatically create lists</string>
<string name="title_advanced_prefix_once">Prefix subject only once on replying or forwarding</string>
<string name="title_advanced_extended_reply">Use extended reply/forward header</string>
<string name="title_advanced_quote_reply">Quote replied text</string>

Loading…
Cancel
Save