Reply move/inbox

This commit is contained in:
M66B 2022-08-26 18:19:14 +02:00
parent 813ee4b3cc
commit 424c702266
4 changed files with 30 additions and 4 deletions

View File

@ -104,6 +104,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private SwitchCompat swForwardNew;
private SwitchCompat swLookupMx;
private SwitchCompat swReplyMove;
private SwitchCompat swReplyMoveInbox;
private final static String[] RESET_OPTIONS = new String[]{
"keyboard", "keyboard_no_fullscreen",
@ -120,7 +121,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
"attach_new", "auto_link", "plain_only", "format_flowed", "usenet_signature", "remove_signatures",
"receipt_default", "receipt_type", "receipt_legacy",
"forward_new",
"lookup_mx", "reply_move"
"lookup_mx", "reply_move", "reply_move_inbox"
};
@Override
@ -182,6 +183,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swForwardNew = view.findViewById(R.id.swForwardNew);
swLookupMx = view.findViewById(R.id.swLookupMx);
swReplyMove = view.findViewById(R.id.swReplyMove);
swReplyMoveInbox = view.findViewById(R.id.swReplyMoveInbox);
List<StyleHelper.FontDescriptor> fonts = StyleHelper.getFonts(getContext());
@ -577,6 +579,14 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("reply_move", checked).apply();
swReplyMoveInbox.setEnabled(checked);
}
});
swReplyMoveInbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("reply_move_inbox", checked).apply();
}
});
@ -716,6 +726,8 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swForwardNew.setChecked(prefs.getBoolean("forward_new", true));
swLookupMx.setChecked(prefs.getBoolean("lookup_mx", false));
swReplyMove.setChecked(prefs.getBoolean("reply_move", false));
swReplyMoveInbox.setChecked(prefs.getBoolean("reply_move_inbox", true));
swReplyMoveInbox.setEnabled(swReplyMove.isChecked());
}
@Override

View File

@ -529,6 +529,7 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean reply_move = prefs.getBoolean("reply_move", false);
boolean reply_move_inbox = prefs.getBoolean("reply_move_inbox", true);
boolean protocol = prefs.getBoolean("protocol", false);
boolean debug = (prefs.getBoolean("debug", false) || BuildConfig.DEBUG);
@ -573,7 +574,7 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
if (!m.ui_hide) {
EntityFolder folder = db.folder().getFolder(m.folder);
if (folder != null &&
(EntityFolder.INBOX.equals(folder.type) ||
((EntityFolder.INBOX.equals(folder.type) && reply_move_inbox) ||
EntityFolder.ARCHIVE.equals(folder.type) ||
EntityFolder.USER.equals(folder.type))) {
sent = folder;

View File

@ -681,12 +681,12 @@
android:layout_height="wrap_content"
android:drawableStart="@drawable/twotone_warning_24"
android:drawablePadding="6dp"
app:drawableTint="?attr/colorWarning"
android:gravity="center"
android:text="@string/title_setup_advanced"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="?attr/colorWarning"
android:textStyle="bold"
app:drawableTint="?attr/colorWarning"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@ -872,6 +872,18 @@
app:layout_constraintTop_toBottomOf="@id/tvCheckMxHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swReplyMoveInbox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_reply_move_inbox"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swReplyMove"
app:switchPadding="12dp" />
<TextView
android:id="@+id/tvReplyMoveHint"
android:layout_width="wrap_content"
@ -881,7 +893,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swReplyMove" />
app:layout_constraintTop_toBottomOf="@id/swReplyMoveInbox" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -447,6 +447,7 @@
<string name="title_advanced_signature_forward">Use signature when forwarding</string>
<string name="title_advanced_discard_delete">On discard draft permanently delete draft</string>
<string name="title_advanced_reply_move">On replying to a message, save the reply in the same folder</string>
<string name="title_advanced_reply_move_inbox">Also for messages in the inbox</string>
<string name="title_advanced_auto_link">Automatically create links</string>
<string name="title_advanced_plain_only">Send plain text only by default</string>