Move some send options to advanced

pull/207/head
M66B 3 years ago
parent 3a70a44ccb
commit 709ddd045a

@ -72,9 +72,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private SwitchCompat swSendChips; private SwitchCompat swSendChips;
private SwitchCompat swSendReminders; private SwitchCompat swSendReminders;
private Spinner spSendDelayed; private Spinner spSendDelayed;
private SwitchCompat swAttachNew;
private Spinner spAnswerAction; private Spinner spAnswerAction;
private SwitchCompat swSendPending;
private Button btnSound; private Button btnSound;
private SwitchCompat swAutoSaveParagraph; private SwitchCompat swAutoSaveParagraph;
@ -95,6 +93,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private SwitchCompat swDiscardDelete; private SwitchCompat swDiscardDelete;
private SwitchCompat swReplyMove; private SwitchCompat swReplyMove;
private SwitchCompat swAttachNew;
private SwitchCompat swAutoLink; private SwitchCompat swAutoLink;
private SwitchCompat swPlainOnly; private SwitchCompat swPlainOnly;
private SwitchCompat swFormatFlowed; private SwitchCompat swFormatFlowed;
@ -104,19 +103,20 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private Spinner spReceiptType; private Spinner spReceiptType;
private SwitchCompat swReceiptLegacy; private SwitchCompat swReceiptLegacy;
private SwitchCompat swLookupMx; private SwitchCompat swLookupMx;
private SwitchCompat swSendPending;
private final static String[] RESET_OPTIONS = new String[]{ private final static String[] RESET_OPTIONS = new String[]{
"keyboard", "keyboard_no_fullscreen", "keyboard", "keyboard_no_fullscreen",
"suggest_names", "suggest_sent", "suggested_received", "suggest_frequently", "auto_identity", "suggest_names", "suggest_sent", "suggested_received", "suggest_frequently", "auto_identity",
"alt_re", "alt_fwd", "alt_re", "alt_fwd",
"send_reminders", "send_chips", "send_delayed", "send_reminders", "send_chips", "send_delayed",
"attach_new", "answer_action", "send_pending", "sound_sent", "answer_action", "sound_sent",
"auto_save_paragraph", "auto_save_dot", "auto_save_paragraph", "auto_save_dot",
"compose_font", "prefix_once", "prefix_count", "separate_reply", "extended_reply", "write_below", "quote_reply", "quote_limit", "resize_reply", "compose_font", "prefix_once", "prefix_count", "separate_reply", "extended_reply", "write_below", "quote_reply", "quote_limit", "resize_reply",
"signature_location", "signature_new", "signature_reply", "signature_reply_once", "signature_forward", "signature_location", "signature_new", "signature_reply", "signature_reply_once", "signature_forward",
"discard_delete", "reply_move", "discard_delete", "reply_move",
"auto_link", "plain_only", "format_flowed", "usenet_signature", "remove_signatures", "attach_new", "auto_link", "plain_only", "format_flowed", "usenet_signature", "remove_signatures",
"receipt_default", "receipt_type", "receipt_legacy", "lookup_mx" "receipt_default", "receipt_type", "receipt_legacy", "lookup_mx", "send_pending"
}; };
@Override @Override
@ -146,9 +146,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swSendChips = view.findViewById(R.id.swSendChips); swSendChips = view.findViewById(R.id.swSendChips);
swSendReminders = view.findViewById(R.id.swSendReminders); swSendReminders = view.findViewById(R.id.swSendReminders);
spSendDelayed = view.findViewById(R.id.spSendDelayed); spSendDelayed = view.findViewById(R.id.spSendDelayed);
swAttachNew = view.findViewById(R.id.swAttachNew);
spAnswerAction = view.findViewById(R.id.spAnswerAction); spAnswerAction = view.findViewById(R.id.spAnswerAction);
swSendPending = view.findViewById(R.id.swSendPending);
btnSound = view.findViewById(R.id.btnSound); btnSound = view.findViewById(R.id.btnSound);
swAutoSaveParagraph = view.findViewById(R.id.swAutoSaveParagraph); swAutoSaveParagraph = view.findViewById(R.id.swAutoSaveParagraph);
@ -169,6 +167,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swDiscardDelete = view.findViewById(R.id.swDiscardDelete); swDiscardDelete = view.findViewById(R.id.swDiscardDelete);
swReplyMove = view.findViewById(R.id.swReplyMove); swReplyMove = view.findViewById(R.id.swReplyMove);
swAttachNew = view.findViewById(R.id.swAttachNew);
swAutoLink = view.findViewById(R.id.swAutoLink); swAutoLink = view.findViewById(R.id.swAutoLink);
swPlainOnly = view.findViewById(R.id.swPlainOnly); swPlainOnly = view.findViewById(R.id.swPlainOnly);
swFormatFlowed = view.findViewById(R.id.swFormatFlowed); swFormatFlowed = view.findViewById(R.id.swFormatFlowed);
@ -178,6 +177,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
spReceiptType = view.findViewById(R.id.spReceiptType); spReceiptType = view.findViewById(R.id.spReceiptType);
swReceiptLegacy = view.findViewById(R.id.swReceiptLegacy); swReceiptLegacy = view.findViewById(R.id.swReceiptLegacy);
swLookupMx = view.findViewById(R.id.swLookupMx); swLookupMx = view.findViewById(R.id.swLookupMx);
swSendPending = view.findViewById(R.id.swSendPending);
List<StyleHelper.FontDescriptor> fonts = StyleHelper.getFonts(getContext()); List<StyleHelper.FontDescriptor> fonts = StyleHelper.getFonts(getContext());
@ -333,13 +333,6 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
} }
}); });
swAttachNew.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("attach_new", checked).apply();
}
});
spAnswerAction.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { spAnswerAction.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) {
@ -353,13 +346,6 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
} }
}); });
swSendPending.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("send_pending", checked).apply();
}
});
btnSound.setOnClickListener(new View.OnClickListener() { btnSound.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -508,6 +494,13 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
} }
}); });
swAttachNew.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("attach_new", checked).apply();
}
});
swAutoLink.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swAutoLink.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -578,6 +571,13 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
} }
}); });
swSendPending.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("send_pending", checked).apply();
}
});
// Initialize // Initialize
FragmentDialogTheme.setBackground(getContext(), view, false); FragmentDialogTheme.setBackground(getContext(), view, false);
@ -658,8 +658,6 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
break; break;
} }
swAttachNew.setChecked(prefs.getBoolean("attach_new", true));
boolean reply_all = prefs.getBoolean("reply_all", false); boolean reply_all = prefs.getBoolean("reply_all", false);
String answer_action = prefs.getString("answer_action", reply_all ? "reply_all" : "reply"); String answer_action = prefs.getString("answer_action", reply_all ? "reply_all" : "reply");
String[] answerValues = getResources().getStringArray(R.array.answerValues); String[] answerValues = getResources().getStringArray(R.array.answerValues);
@ -669,8 +667,6 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
break; break;
} }
swSendPending.setChecked(prefs.getBoolean("send_pending", true));
swAutoSaveParagraph.setChecked(prefs.getBoolean("auto_save_paragraph", true)); swAutoSaveParagraph.setChecked(prefs.getBoolean("auto_save_paragraph", true));
swAutoSaveDot.setChecked(prefs.getBoolean("auto_save_dot", false)); swAutoSaveDot.setChecked(prefs.getBoolean("auto_save_dot", false));
@ -702,6 +698,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swDiscardDelete.setChecked(prefs.getBoolean("discard_delete", true)); swDiscardDelete.setChecked(prefs.getBoolean("discard_delete", true));
swReplyMove.setChecked(prefs.getBoolean("reply_move", false)); swReplyMove.setChecked(prefs.getBoolean("reply_move", false));
swAttachNew.setChecked(prefs.getBoolean("attach_new", true));
swAutoLink.setChecked(prefs.getBoolean("auto_link", false)); swAutoLink.setChecked(prefs.getBoolean("auto_link", false));
swPlainOnly.setChecked(prefs.getBoolean("plain_only", false)); swPlainOnly.setChecked(prefs.getBoolean("plain_only", false));
swFormatFlowed.setChecked(prefs.getBoolean("format_flowed", false)); swFormatFlowed.setChecked(prefs.getBoolean("format_flowed", false));
@ -715,6 +712,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swReceiptLegacy.setChecked(prefs.getBoolean("receipt_legacy", false)); swReceiptLegacy.setChecked(prefs.getBoolean("receipt_legacy", false));
swLookupMx.setChecked(prefs.getBoolean("lookup_mx", false)); swLookupMx.setChecked(prefs.getBoolean("lookup_mx", false));
swSendPending.setChecked(prefs.getBoolean("send_pending", true));
} }
@Override @Override

@ -382,18 +382,6 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSendDelayed" /> app:layout_constraintTop_toBottomOf="@id/tvSendDelayed" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAttachNew"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_attach_new"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spSendDelayed"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView <eu.faircode.email.FixedTextView
android:id="@+id/tvAnswerAction" android:id="@+id/tvAnswerAction"
android:layout_width="0dp" android:layout_width="0dp"
@ -405,7 +393,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/swAttachNew" /> app:layout_constraintTop_toBottomOf="@id/spSendDelayed" />
<Spinner <Spinner
android:id="@+id/spAnswerAction" android:id="@+id/spAnswerAction"
@ -416,18 +404,6 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvAnswerAction" /> app:layout_constraintTop_toBottomOf="@id/tvAnswerAction" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSendPending"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_send_pending"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spAnswerAction"
app:switchPadding="12dp" />
<Button <Button
android:id="@+id/btnSound" android:id="@+id/btnSound"
style="?android:attr/buttonStyleSmall" style="?android:attr/buttonStyleSmall"
@ -438,7 +414,7 @@
android:drawablePadding="6dp" android:drawablePadding="6dp"
android:text="@string/title_advanced_sound" android:text="@string/title_advanced_sound"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swSendPending" /> app:layout_constraintTop_toBottomOf="@id/spAnswerAction" />
</eu.faircode.email.ConstraintLayoutEx> </eu.faircode.email.ConstraintLayoutEx>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
@ -739,6 +715,18 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAttachNew"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_attach_new"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCaptionAdvanced"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAutoLink" android:id="@+id/swAutoLink"
android:layout_width="0dp" android:layout_width="0dp"
@ -747,7 +735,7 @@
android:text="@string/title_advanced_auto_link" android:text="@string/title_advanced_auto_link"
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/tvCaptionAdvanced" app:layout_constraintTop_toBottomOf="@id/swAttachNew"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
@ -884,6 +872,18 @@
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/swLookupMx" /> app:layout_constraintTop_toBottomOf="@id/swLookupMx" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSendPending"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_send_pending"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCheckMxHint"
app:switchPadding="12dp" />
</eu.faircode.email.ConstraintLayoutEx> </eu.faircode.email.ConstraintLayoutEx>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
</eu.faircode.email.ConstraintLayoutEx> </eu.faircode.email.ConstraintLayoutEx>

Loading…
Cancel
Save