Moved setting

This commit is contained in:
M66B 2023-07-12 07:27:26 +02:00
parent 08b8d7162c
commit 9fc6183e3b
3 changed files with 29 additions and 25 deletions

View File

@ -93,7 +93,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
private SwitchCompat swAutoRead;
private SwitchCompat swAutoUnflag;
private SwitchCompat swResetImportance;
private SwitchCompat swThreadSentTrash;
private SwitchCompat swPhotoPicker;
private SwitchCompat swFlagSnoozed;
private SwitchCompat swAutoImportant;
@ -102,6 +101,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
private SwitchCompat swAutoHideAnswer;
private SwitchCompat swSwipeReply;
private SwitchCompat swMoveThreadSent;
private SwitchCompat swThreadSentTrash;
private Button btnDefaultFolder;
private TextView tvDefaultFolder;
@ -120,8 +120,10 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
"autoexpand", "expand_first", "expand_all", "expand_one", "collapse_multiple",
"autoclose", "onclose", "autoclose_unseen", "autoclose_send", "collapse_marked",
"undo_timeout",
"autoread", "flag_snoozed", "autounflag", "auto_important", "reset_importance", "thread_sent_trash",
"reset_snooze", "auto_block_sender", "auto_hide_answer", "swipe_reply", "move_thread_sent", "default_folder"
"autoread", "flag_snoozed", "autounflag", "auto_important", "reset_importance",
"reset_snooze", "auto_block_sender", "auto_hide_answer", "swipe_reply",
"move_thread_sent", "thread_sent_trash",
"default_folder"
};
@Override
@ -174,7 +176,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swAutoRead = view.findViewById(R.id.swAutoRead);
swAutoUnflag = view.findViewById(R.id.swAutoUnflag);
swResetImportance = view.findViewById(R.id.swResetImportance);
swThreadSentTrash = view.findViewById(R.id.swThreadSentTrash);
swPhotoPicker = view.findViewById(R.id.swPhotoPicker);
swFlagSnoozed = view.findViewById(R.id.swFlagSnoozed);
swAutoImportant = view.findViewById(R.id.swAutoImportant);
@ -183,6 +184,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swAutoHideAnswer = view.findViewById(R.id.swAutoHideAnswer);
swSwipeReply = view.findViewById(R.id.swSwipeReply);
swMoveThreadSent = view.findViewById(R.id.swMoveThreadSent);
swThreadSentTrash = view.findViewById(R.id.swThreadSentTrash);
btnDefaultFolder = view.findViewById(R.id.btnDefaultFolder);
tvDefaultFolder = view.findViewById(R.id.tvDefaultFolder);
@ -517,13 +519,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
}
});
swThreadSentTrash.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("thread_sent_trash", checked).apply();
}
});
swPhotoPicker.setVisibility(Helper.hasPhotoPicker() ? View.VISIBLE : View.GONE);
swPhotoPicker.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
@ -581,6 +576,13 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
}
});
swThreadSentTrash.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("thread_sent_trash", checked).apply();
}
});
Intent tree = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
Helper.openAdvanced(getContext(), tree);
PackageManager pm = getContext().getPackageManager();
@ -723,7 +725,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swAutoRead.setChecked(prefs.getBoolean("autoread", false));
swAutoUnflag.setChecked(prefs.getBoolean("autounflag", false));
swResetImportance.setChecked(prefs.getBoolean("reset_importance", false));
swThreadSentTrash.setChecked(prefs.getBoolean("thread_sent_trash", true));
swPhotoPicker.setChecked(prefs.getBoolean("photo_picker", true));
swFlagSnoozed.setChecked(prefs.getBoolean("flag_snoozed", false));
@ -732,7 +733,10 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swAutoBlockSender.setChecked(prefs.getBoolean("auto_block_sender", true));
swAutoHideAnswer.setChecked(prefs.getBoolean("auto_hide_answer", !accessibility));
swSwipeReply.setChecked(prefs.getBoolean("swipe_reply", false));
swMoveThreadSent.setChecked(prefs.getBoolean("move_thread_sent", false));
swThreadSentTrash.setChecked(prefs.getBoolean("thread_sent_trash", true));
tvDefaultFolder.setText(prefs.getString("default_folder", null));
} catch (Throwable ex) {
Log.e(ex);

View File

@ -715,17 +715,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAutoUnflag"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swThreadSentTrash"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_thread_sent_trash"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swResetImportance"
app:switchPadding="12dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
@ -855,6 +844,17 @@
app:layout_constraintTop_toBottomOf="@id/swSwipeReply"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swThreadSentTrash"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_thread_sent_trash"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swMoveThreadSent"
app:switchPadding="12dp" />
<Button
android:id="@+id/btnDefaultFolder"
style="?android:attr/buttonStyleSmall"
@ -866,7 +866,7 @@
android:tag="disable"
android:text="@string/title_advanced_default_folder"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swMoveThreadSent" />
app:layout_constraintTop_toBottomOf="@id/swThreadSentTrash" />
<TextView
android:id="@+id/tvDefaultFolderHint"

View File

@ -680,7 +680,6 @@
<string name="title_advanced_autoread">Automatically mark messages read on moving messages</string>
<string name="title_advanced_autounstar">Automatically remove stars from messages on moving messages</string>
<string name="title_advanced_reset_importance">Reset importance on moving messages</string>
<string name="title_advanced_thread_sent_trash">When trashing a conversation, also trash sent messages</string>
<string name="title_advanced_star_snoozed">Automatically add star on snoozing messages</string>
<string name="title_advanced_auto_important">Automatically make starred messages important</string>
<string name="title_advanced_cancel_snooze">Cancel snooze on moving messages</string>
@ -688,6 +687,7 @@
<string name="title_advanced_auto_hide_answer">Automatically hide the answer button when scrolling</string>
<string name="title_advanced_swipe_reply">Swipe expanded messages to the right to reply</string>
<string name="title_advanced_move_thread_sent">When moving a conversation, also move sent messages</string>
<string name="title_advanced_thread_sent_trash">When trashing a conversation, also trash sent messages</string>
<string name="title_advanced_default_snooze">Default snooze/delay time</string>
<string name="title_advanced_default_folder">Select default folder</string>