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 swSendReminders;
private Spinner spSendDelayed;
private SwitchCompat swAttachNew;
private Spinner spAnswerAction;
private SwitchCompat swSendPending;
private Button btnSound;
private SwitchCompat swAutoSaveParagraph;
@ -95,6 +93,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private SwitchCompat swDiscardDelete;
private SwitchCompat swReplyMove;
private SwitchCompat swAttachNew;
private SwitchCompat swAutoLink;
private SwitchCompat swPlainOnly;
private SwitchCompat swFormatFlowed;
@ -104,19 +103,20 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private Spinner spReceiptType;
private SwitchCompat swReceiptLegacy;
private SwitchCompat swLookupMx;
private SwitchCompat swSendPending;
private final static String[] RESET_OPTIONS = new String[]{
"keyboard", "keyboard_no_fullscreen",
"suggest_names", "suggest_sent", "suggested_received", "suggest_frequently", "auto_identity",
"alt_re", "alt_fwd",
"send_reminders", "send_chips", "send_delayed",
"attach_new", "answer_action", "send_pending", "sound_sent",
"answer_action", "sound_sent",
"auto_save_paragraph", "auto_save_dot",
"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",
"discard_delete", "reply_move",
"auto_link", "plain_only", "format_flowed", "usenet_signature", "remove_signatures",
"receipt_default", "receipt_type", "receipt_legacy", "lookup_mx"
"attach_new", "auto_link", "plain_only", "format_flowed", "usenet_signature", "remove_signatures",
"receipt_default", "receipt_type", "receipt_legacy", "lookup_mx", "send_pending"
};
@Override
@ -146,9 +146,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swSendChips = view.findViewById(R.id.swSendChips);
swSendReminders = view.findViewById(R.id.swSendReminders);
spSendDelayed = view.findViewById(R.id.spSendDelayed);
swAttachNew = view.findViewById(R.id.swAttachNew);
spAnswerAction = view.findViewById(R.id.spAnswerAction);
swSendPending = view.findViewById(R.id.swSendPending);
btnSound = view.findViewById(R.id.btnSound);
swAutoSaveParagraph = view.findViewById(R.id.swAutoSaveParagraph);
@ -169,6 +167,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swDiscardDelete = view.findViewById(R.id.swDiscardDelete);
swReplyMove = view.findViewById(R.id.swReplyMove);
swAttachNew = view.findViewById(R.id.swAttachNew);
swAutoLink = view.findViewById(R.id.swAutoLink);
swPlainOnly = view.findViewById(R.id.swPlainOnly);
swFormatFlowed = view.findViewById(R.id.swFormatFlowed);
@ -178,6 +177,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
spReceiptType = view.findViewById(R.id.spReceiptType);
swReceiptLegacy = view.findViewById(R.id.swReceiptLegacy);
swLookupMx = view.findViewById(R.id.swLookupMx);
swSendPending = view.findViewById(R.id.swSendPending);
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() {
@Override
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() {
@Override
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() {
@Override
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
FragmentDialogTheme.setBackground(getContext(), view, false);
@ -658,8 +658,6 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
break;
}
swAttachNew.setChecked(prefs.getBoolean("attach_new", true));
boolean reply_all = prefs.getBoolean("reply_all", false);
String answer_action = prefs.getString("answer_action", reply_all ? "reply_all" : "reply");
String[] answerValues = getResources().getStringArray(R.array.answerValues);
@ -669,8 +667,6 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
break;
}
swSendPending.setChecked(prefs.getBoolean("send_pending", true));
swAutoSaveParagraph.setChecked(prefs.getBoolean("auto_save_paragraph", true));
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));
swReplyMove.setChecked(prefs.getBoolean("reply_move", false));
swAttachNew.setChecked(prefs.getBoolean("attach_new", true));
swAutoLink.setChecked(prefs.getBoolean("auto_link", false));
swPlainOnly.setChecked(prefs.getBoolean("plain_only", 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));
swLookupMx.setChecked(prefs.getBoolean("lookup_mx", false));
swSendPending.setChecked(prefs.getBoolean("send_pending", true));
}
@Override

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

Loading…
Cancel
Save