Separately confirm moving one / multiple messages

pull/174/head
M66B 5 years ago
parent c63bc01887
commit eed9527bef

@ -230,6 +230,12 @@ public class ApplicationEx extends Application {
boolean large = context.getResources().getConfiguration()
.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE);
editor.putBoolean("landscape3", large);
} else if (version < 949) {
if (prefs.contains("automove")) {
boolean automove = prefs.getBoolean("automove", false);
editor.putBoolean("move_1_confirmed", automove);
editor.remove("automove");
}
}
if (BuildConfig.DEBUG && false) {

@ -3936,8 +3936,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
return;
}
String key = (result.size() == 1 ? "move_1_confirmed" : "move_n_confirmed");
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
if (prefs.getBoolean("automove", false)) {
if (prefs.getBoolean(key, false)) {
if (canUndo)
moveUndo(result);
else
@ -3949,7 +3951,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
aargs.putString("question", getResources()
.getQuantityString(R.plurals.title_moving_messages,
result.size(), result.size(), getDisplay(result)));
aargs.putString("notagain", "automove");
aargs.putString("notagain", key);
aargs.putParcelableArrayList("result", result);
FragmentDialogAsk ask = new FragmentDialogAsk();

@ -59,7 +59,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
private SwitchCompat swAutoRead;
private SwitchCompat swAutoUnflag;
private SwitchCompat swResetImportance;
private SwitchCompat swAutoMove;
private SwitchCompat swDiscardDelete;
private NumberPicker npDefaultSnooze;
@ -67,7 +66,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
"double_back", "pull", "autoscroll", "doubletap", "swipenav", "volumenav", "reversed",
"autoexpand", "expand_all", "expand_one", "collapse_multiple",
"autoclose", "onclose", "quick_filter", "quick_scroll",
"autoread", "autounflag", "reset_importance", "automove", "discard_delete",
"autoread", "autounflag", "reset_importance", "discard_delete",
"default_snooze"
};
@ -99,7 +98,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);
swAutoMove = view.findViewById(R.id.swAutoMove);
swDiscardDelete = view.findViewById(R.id.swDiscardDelete);
npDefaultSnooze = view.findViewById(R.id.npDefaultSnooze);
@ -252,13 +250,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
}
});
swAutoMove.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("automove", !checked).apply();
}
});
swDiscardDelete.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -352,7 +343,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));
swAutoMove.setChecked(!prefs.getBoolean("automove", false));
swDiscardDelete.setChecked(prefs.getBoolean("discard_delete", false));
npDefaultSnooze.setValue(prefs.getInt("default_snooze", 1));

@ -78,7 +78,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private final static String[] RESET_QUESTIONS = new String[]{
"welcome", "crash_reports_asked", "review_asked", "review_later", "why",
"reply_hint", "html_always_images", "print_html_confirmed", "automove",
"reply_hint", "html_always_images", "print_html_confirmed", "move_1_confirmed", "move_n_confirmed",
"identities_asked", "cc_bcc", "inline_image_hint", "compose_reference", "send_dialog",
"setup_advanced"
};

@ -265,17 +265,6 @@
app:layout_constraintTop_toBottomOf="@id/swAutoUnflag"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAutoMove"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_automove"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swResetImportance"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swDiscardDelete"
android:layout_width="0dp"
@ -284,7 +273,7 @@
android:text="@string/title_advanced_discard_delete"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAutoMove"
app:layout_constraintTop_toBottomOf="@id/swResetImportance"
app:switchPadding="12dp" />
<TextView

@ -347,7 +347,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_automove">Confirm moving messages</string>
<string name="title_advanced_discard_delete">On discard draft permanently delete draft</string>
<string name="title_advanced_default_snooze">Default snooze time</string>

Loading…
Cancel
Save