From 90ed27d328ed65f229590d062fe65cd1bb705e99 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 7 Mar 2020 08:20:55 +0100 Subject: [PATCH] Moved receipt type option --- .../faircode/email/FragmentOptionsSend.java | 38 +++++++-------- .../main/res/layout/fragment_options_send.xml | 48 +++++++++---------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java index 49618c28d0..f7ce36b861 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java @@ -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)); diff --git a/app/src/main/res/layout/fragment_options_send.xml b/app/src/main/res/layout/fragment_options_send.xml index 50ee35ed88..cd5445b9ed 100644 --- a/app/src/main/res/layout/fragment_options_send.xml +++ b/app/src/main/res/layout/fragment_options_send.xml @@ -134,28 +134,6 @@ app:layout_constraintTop_toBottomOf="@id/swQuoteReply" app:switchPadding="12dp" /> - - - - + app:layout_constraintTop_toBottomOf="@id/swPlainOnly" /> + + + +