Added reply button option

This commit is contained in:
M66B
2024-03-26 07:28:59 +01:00
parent 3667bc468e
commit ac5830d111
3 changed files with 25 additions and 2 deletions

View File

@@ -67,6 +67,7 @@ public class FragmentDialogButtons extends FragmentDialogBase {
final CheckBox cbHtml = dview.findViewById(R.id.cbHtml);
final CheckBox cbRaw = dview.findViewById(R.id.cbRaw);
final CheckBox cbUnsubscribe = dview.findViewById(R.id.cbUnsubscribe);
final CheckBox cbAnswer = dview.findViewById(R.id.cbAnswer);
cbTranslate.setVisibility(DeepL.isAvailable(context) ? View.VISIBLE : View.GONE);
cbPin.setVisibility(Shortcuts.can(context) ? View.VISIBLE : View.GONE);
@@ -96,6 +97,13 @@ public class FragmentDialogButtons extends FragmentDialogBase {
cbHtml.setChecked(prefs.getBoolean("button_html", false));
cbRaw.setChecked(prefs.getBoolean("button_raw", false));
cbUnsubscribe.setChecked(prefs.getBoolean("button_unsubscribe", true));
cbAnswer.setChecked(prefs.getBoolean("button_answer", false));
boolean expand_all = prefs.getBoolean("expand_all", false);
boolean expand_one = prefs.getBoolean("expand_one", true);
boolean threading = prefs.getBoolean("threading", true);
boolean swipe_reply = prefs.getBoolean("swipe_reply", false);
cbAnswer.setVisibility((!expand_all && expand_one) || !threading || swipe_reply ? View.VISIBLE : View.GONE);
return new AlertDialog.Builder(getContext())
.setView(dview)
@@ -128,6 +136,7 @@ public class FragmentDialogButtons extends FragmentDialogBase {
editor.putBoolean("button_html", cbHtml.isChecked());
editor.putBoolean("button_raw", cbRaw.isChecked());
editor.putBoolean("button_unsubscribe", cbUnsubscribe.isChecked());
editor.putBoolean("button_answer", cbAnswer.isChecked());
editor.apply();
sendResult(Activity.RESULT_OK);
}