Added option to sync subscribed folders

This commit is contained in:
M66B
2020-11-15 16:01:18 +01:00
parent b05ef291e5
commit b6964662d1
4 changed files with 28 additions and 3 deletions

View File

@@ -81,6 +81,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
private SwitchCompat swSyncFolders;
private SwitchCompat swSyncSharedFolders;
private SwitchCompat swSubscriptions;
private SwitchCompat swSyncSubscribed;
private SwitchCompat swCheckMx;
private SwitchCompat swCheckReply;
private SwitchCompat swTuneKeepAlive;
@@ -91,7 +92,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
private final static String[] RESET_OPTIONS = new String[]{
"enabled", "poll_interval", "auto_optimize", "schedule", "schedule_start", "schedule_end",
"sync_nodate", "sync_unseen", "sync_flagged", "delete_unseen", "sync_kept", "gmail_thread_id",
"sync_folders", "sync_shared_folders", "subscriptions",
"sync_folders", "sync_shared_folders", "subscriptions", "sync_subscribed",
"check_mx", "check_reply", "tune_keep_alive"
};
@@ -135,6 +136,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
swSyncFolders = view.findViewById(R.id.swSyncFolders);
swSyncSharedFolders = view.findViewById(R.id.swSyncSharedFolders);
swSubscriptions = view.findViewById(R.id.swSubscriptions);
swSyncSubscribed = view.findViewById(R.id.swSyncSubscribed);
swCheckMx = view.findViewById(R.id.swCheckMx);
swCheckReply = view.findViewById(R.id.swCheckReply);
swTuneKeepAlive = view.findViewById(R.id.swTuneKeepAlive);
@@ -308,6 +310,14 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("subscriptions", checked).apply();
swSyncSubscribed.setEnabled(checked);
}
});
swSyncSubscribed.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("sync_subscribed", checked).apply();
}
});
@@ -420,6 +430,8 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
swSyncSharedFolders.setChecked(prefs.getBoolean("sync_shared_folders", false));
swSyncSharedFolders.setEnabled(swSyncFolders.isChecked());
swSubscriptions.setChecked(prefs.getBoolean("subscriptions", false));
swSyncSubscribed.setChecked(prefs.getBoolean("sync_subscribed", false));
swSyncSubscribed.setEnabled(swSubscriptions.isChecked());
swCheckMx.setChecked(prefs.getBoolean("check_mx", false));
swCheckReply.setChecked(prefs.getBoolean("check_reply", false));
swTuneKeepAlive.setChecked(prefs.getBoolean("tune_keep_alive", true));