Added option long press reply/all

pull/204/head
M66B 3 years ago
parent 2e7c612979
commit c820e15a42

@ -2535,9 +2535,11 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
if (message == null)
return;
if (sender && message.content)
onMenuReply(message, "reply", selected);
else
if (sender && message.content) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean reply_all = prefs.getBoolean("reply_all", false);
onMenuReply(message, reply_all ? "reply_all" : "reply", selected);
} else
onReply(message, selected, fabReply);
}
}

@ -91,6 +91,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
private SwitchCompat swAutoUnflag;
private SwitchCompat swAutoImportant;
private SwitchCompat swResetImportance;
private SwitchCompat swReplyAll;
final static int MAX_SWIPE_SENSITIVITY = 10;
final static int DEFAULT_SWIPE_SENSITIVITY = 7;
@ -103,7 +104,8 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
"autoexpand", "expand_first", "expand_all", "expand_one", "collapse_multiple",
"autoclose", "onclose", "autoclose_unseen",
"undo_timeout",
"autoread", "flag_snoozed", "autounflag", "auto_important", "reset_importance"
"autoread", "flag_snoozed", "autounflag", "auto_important", "reset_importance",
"reply_all"
};
@Override
@ -150,6 +152,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swAutoUnflag = view.findViewById(R.id.swAutoUnflag);
swAutoImportant = view.findViewById(R.id.swAutoImportant);
swResetImportance = view.findViewById(R.id.swResetImportance);
swReplyAll = view.findViewById(R.id.swReplyAll);
setOptions();
@ -445,6 +448,13 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
}
});
swReplyAll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("reply_all", checked).apply();
}
});
// Initialize
FragmentDialogTheme.setBackground(getContext(), view, false);
@ -549,6 +559,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swAutoUnflag.setChecked(prefs.getBoolean("autounflag", false));
swAutoImportant.setChecked(prefs.getBoolean("auto_important", false));
swResetImportance.setChecked(prefs.getBoolean("reset_importance", false));
swReplyAll.setChecked(prefs.getBoolean("reply_all", false));
}
public static class FragmentDialogSwipes extends FragmentDialogBase {

@ -616,6 +616,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAutoImportant"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swReplyAll"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_reply_all"
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>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -510,6 +510,7 @@
<string name="title_advanced_autounstar">Automatically remove stars from messages on moving messages</string>
<string name="title_advanced_auto_important">Automatically make starred messages important</string>
<string name="title_advanced_reset_importance">Reset importance on moving messages</string>
<string name="title_advanced_reply_all">Long press the answer button to reply to all</string>
<string name="title_advanced_default_snooze">Default snooze time</string>
<string name="title_advanced_notifications">Manage notifications</string>

Loading…
Cancel
Save