Added subscribed only filter

This commit is contained in:
M66B
2020-03-31 13:43:58 +02:00
parent 5048b671f4
commit d9d8d6e6f1
9 changed files with 42 additions and 67 deletions

View File

@@ -75,7 +75,6 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
private SwitchCompat swSyncFolders;
private SwitchCompat swSubscriptions;
private TextView tvSubscriptionPro;
private SwitchCompat swSubscribedOnly;
private SwitchCompat swCheckMx;
private SwitchCompat swCheckReply;
private Group grpExempted;
@@ -84,7 +83,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
private final static String[] RESET_OPTIONS = new String[]{
"enabled", "poll_interval", "schedule", "schedule_start", "schedule_end",
"sync_unseen", "sync_flagged", "delete_unseen", "sync_kept", "sync_folders", "subscriptions", "subscribed_only",
"sync_unseen", "sync_flagged", "delete_unseen", "sync_kept", "sync_folders", "subscriptions",
"check_mx", "check_reply"
};
@@ -121,7 +120,6 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
swSyncFolders = view.findViewById(R.id.swSyncFolders);
swSubscriptions = view.findViewById(R.id.swSubscriptions);
tvSubscriptionPro = view.findViewById(R.id.tvSubscriptionPro);
swSubscribedOnly = view.findViewById(R.id.swSubscribedOnly);
swCheckMx = view.findViewById(R.id.swCheckMx);
swCheckReply = view.findViewById(R.id.swCheckReply);
grpExempted = view.findViewById(R.id.grpExempted);
@@ -265,14 +263,6 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
Helper.linkPro(tvSubscriptionPro);
swSubscribedOnly.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("subscribed_only", checked).apply();
ServiceSynchronize.reload(getContext(), null, false, "subscribed_only");
}
});
swCheckMx.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -370,7 +360,6 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
swSyncFolders.setChecked(prefs.getBoolean("sync_folders", true));
swSubscriptions.setChecked(prefs.getBoolean("subscriptions", false) && pro);
swSubscriptions.setEnabled(pro);
swSubscribedOnly.setChecked(prefs.getBoolean("subscribed_only", false));
swCheckMx.setChecked(prefs.getBoolean("check_mx", false));
swCheckReply.setChecked(prefs.getBoolean("check_reply", false));
}