Moved receipt type option

This commit is contained in:
M66B 2020-03-07 08:20:55 +01:00
parent f680633482
commit 90ed27d328
2 changed files with 43 additions and 43 deletions

View File

@ -51,7 +51,6 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private SwitchCompat swExtendedReply;
private SwitchCompat swQuoteReply;
private SwitchCompat swPlainOnly;
private Spinner spReceiptType;
private Spinner spSignatureLocation;
private SwitchCompat swUsenetSignature;
private SwitchCompat swRemoveSignatures;
@ -61,14 +60,16 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private TextView tvAutoResize;
private SwitchCompat swSendReminders;
private SwitchCompat swReceipt;
private Spinner spReceiptType;
private SwitchCompat swLookupMx;
private Spinner spSendDelayed;
private final static String[] RESET_OPTIONS = new String[]{
"keyboard", "suggest_sent", "suggested_received",
"prefix_once", "extended_reply", "quote_reply",
"plain_only", "receipt_type", "signature_location", "usenet_signature", "remove_signatures",
"resize_images", "resize_attachments", "send_reminders", "receipt_default", "resize", "lookup_mx", "send_delayed"
"plain_only", "signature_location", "usenet_signature", "remove_signatures",
"resize_images", "resize_attachments", "resize",
"send_reminders", "receipt_default", "receipt_type", "lookup_mx", "send_delayed"
};
@Override
@ -89,7 +90,6 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swExtendedReply = view.findViewById(R.id.swExtendedReply);
swQuoteReply = view.findViewById(R.id.swQuoteReply);
swPlainOnly = view.findViewById(R.id.swPlainOnly);
spReceiptType = view.findViewById(R.id.spReceiptType);
spSignatureLocation = view.findViewById(R.id.spSignatureLocation);
swUsenetSignature = view.findViewById(R.id.swUsenetSignature);
swRemoveSignatures = view.findViewById(R.id.swRemoveSignatures);
@ -99,6 +99,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
tvAutoResize = view.findViewById(R.id.tvAutoResize);
swSendReminders = view.findViewById(R.id.swSendReminders);
swReceipt = view.findViewById(R.id.swReceipt);
spReceiptType = view.findViewById(R.id.spReceiptType);
swLookupMx = view.findViewById(R.id.swLookupMx);
spSendDelayed = view.findViewById(R.id.spSendDelayed);
@ -165,18 +166,6 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
}
});
spReceiptType.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
prefs.edit().putInt("receipt_type", position).apply();
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
prefs.edit().remove("receipt_type").apply();
}
});
spSignatureLocation.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
@ -240,6 +229,18 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
}
});
spReceiptType.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
prefs.edit().putInt("receipt_type", position).apply();
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
prefs.edit().remove("receipt_type").apply();
}
});
swSendReminders.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -321,9 +322,6 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swQuoteReply.setChecked(prefs.getBoolean("quote_reply", true));
swPlainOnly.setChecked(prefs.getBoolean("plain_only", false));
int receipt_type = prefs.getInt("receipt_type", 2);
spReceiptType.setSelection(receipt_type);
int signature_location = prefs.getInt("signature_location", 1);
spSignatureLocation.setSelection(signature_location);
@ -344,6 +342,8 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
spAutoResize.setEnabled(swResizeImages.isChecked() || swResizeAttachments.isChecked());
swSendReminders.setChecked(prefs.getBoolean("send_reminders", true));
int receipt_type = prefs.getInt("receipt_type", 2);
spReceiptType.setSelection(receipt_type);
swReceipt.setChecked(prefs.getBoolean("receipt_default", false));
swLookupMx.setChecked(prefs.getBoolean("lookup_mx", false));

View File

@ -134,28 +134,6 @@
app:layout_constraintTop_toBottomOf="@id/swQuoteReply"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvReceiptType"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_receipt"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swPlainOnly" />
<Spinner
android:id="@+id/spReceiptType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:entries="@array/receiptNames"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvReceiptType" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvSignatureLocation"
android:layout_width="0dp"
@ -167,7 +145,7 @@
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spReceiptType" />
app:layout_constraintTop_toBottomOf="@id/swPlainOnly" />
<Spinner
android:id="@+id/spSignatureLocation"
@ -288,6 +266,28 @@
app:layout_constraintTop_toBottomOf="@id/tvSendReminders"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvReceiptType"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_receipt"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swReceipt" />
<Spinner
android:id="@+id/spReceiptType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:entries="@array/receiptNames"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvReceiptType" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swLookupMx"
android:layout_width="0dp"
@ -296,7 +296,7 @@
android:text="@string/title_advanced_lookup_mx"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swReceipt"
app:layout_constraintTop_toBottomOf="@id/spReceiptType"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView