Added notification move action

This commit is contained in:
M66B
2019-10-23 12:51:20 +02:00
parent ee39642758
commit f262eb3e3e
11 changed files with 2084 additions and 28 deletions

View File

@@ -60,6 +60,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
private CheckBox cbNotifyActionTrash;
private CheckBox cbNotifyActionJunk;
private CheckBox cbNotifyActionArchive;
private CheckBox cbNotifyActionMove;
private CheckBox cbNotifyActionReply;
private CheckBox cbNotifyActionReplyDirect;
private CheckBox cbNotifyActionFlag;
@@ -81,7 +82,8 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
private final static String[] RESET_OPTIONS = new String[]{
"badge", "unseen_ignored",
"notify_summary", "notify_remove", "notify_preview", "wearable_preview",
"notify_trash", "notify_junk", "notify_archive", "notify_reply", "notify_reply_direct",
"notify_trash", "notify_junk", "notify_archive", "notify_move",
"notify_reply", "notify_reply_direct",
"notify_flag", "notify_seen", "notify_snooze",
"biometrics_notify",
"light", "sound", "alert_once"
@@ -106,6 +108,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
cbNotifyActionTrash = view.findViewById(R.id.cbNotifyActionTrash);
cbNotifyActionJunk = view.findViewById(R.id.cbNotifyActionJunk);
cbNotifyActionArchive = view.findViewById(R.id.cbNotifyActionArchive);
cbNotifyActionMove = view.findViewById(R.id.cbNotifyActionMove);
cbNotifyActionReply = view.findViewById(R.id.cbNotifyActionReply);
cbNotifyActionReplyDirect = view.findViewById(R.id.cbNotifyActionReplyDirect);
cbNotifyActionFlag = view.findViewById(R.id.cbNotifyActionFlag);
@@ -198,6 +201,13 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
}
});
cbNotifyActionMove.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean checked) {
prefs.edit().putBoolean("notify_move", checked).apply();
}
});
cbNotifyActionReply.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean checked) {
@@ -358,6 +368,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
cbNotifyActionTrash.setChecked(prefs.getBoolean("notify_trash", true) || !pro);
cbNotifyActionJunk.setChecked(prefs.getBoolean("notify_junk", false) && pro);
cbNotifyActionArchive.setChecked(prefs.getBoolean("notify_archive", true) || !pro);
cbNotifyActionMove.setChecked(prefs.getBoolean("notify_move", false) && pro);
cbNotifyActionReply.setChecked(prefs.getBoolean("notify_reply", false) && pro);
cbNotifyActionReplyDirect.setChecked(prefs.getBoolean("notify_reply_direct", false) && pro);
cbNotifyActionFlag.setChecked(prefs.getBoolean("notify_flag", false) && pro);
@@ -375,19 +386,20 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
private void enableOptions() {
boolean pro = ActivityBilling.isPro(getContext());
boolean checked = swNotifySummary.isChecked();
boolean summary = swNotifySummary.isChecked();
swNotifyPreview.setEnabled(!checked);
swWearablePreview.setEnabled(!checked && swNotifyPreview.isChecked());
cbNotifyActionTrash.setEnabled(pro && !checked);
cbNotifyActionJunk.setEnabled(pro && !checked);
cbNotifyActionArchive.setEnabled(pro && !checked);
cbNotifyActionReply.setEnabled(pro && !checked);
cbNotifyActionReplyDirect.setEnabled(pro && !checked);
cbNotifyActionFlag.setEnabled(pro && !checked);
cbNotifyActionSeen.setEnabled(pro && !checked);
cbNotifyActionSnooze.setEnabled(pro && !checked);
swBiometricsNotify.setEnabled(!checked);
swNotifyPreview.setEnabled(!summary);
swWearablePreview.setEnabled(!summary && swNotifyPreview.isChecked());
cbNotifyActionTrash.setEnabled(pro && !summary);
cbNotifyActionJunk.setEnabled(pro && !summary);
cbNotifyActionArchive.setEnabled(pro && !summary);
cbNotifyActionMove.setEnabled(pro && !summary);
cbNotifyActionReply.setEnabled(pro && !summary);
cbNotifyActionReplyDirect.setEnabled(pro && !summary);
cbNotifyActionFlag.setEnabled(pro && !summary);
cbNotifyActionSeen.setEnabled(pro && !summary);
cbNotifyActionSnooze.setEnabled(pro && !summary);
swBiometricsNotify.setEnabled(!summary);
}
@Override