Individual account management - to be tested

This commit is contained in:
M66B
2019-12-07 15:14:35 +01:00
parent 35602ef17c
commit 2591dc9011
33 changed files with 378 additions and 717 deletions

View File

@@ -106,7 +106,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("enabled", checked).apply();
ServiceSynchronize.reload(getContext(), true, "enabled=" + checked);
ServiceSynchronize.eval(getContext(), false, "enabled=" + checked);
}
});
@@ -120,16 +120,18 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
if (value != current) {
adapterView.setTag(value);
prefs.edit().putInt("poll_interval", value).apply();
if (value == 0)
ServiceSynchronize.eval(getContext(), false, "poll_interval");
WorkerPoll.init(getContext());
ServiceSynchronize.reload(getContext(), "poll");
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
public void onNothingSelected(AdapterView<?> adapterView) {
adapterView.setTag(null);
prefs.edit().remove("poll_interval").apply();
ServiceSynchronize.eval(getContext(), false, "poll_interval");
WorkerPoll.init(getContext());
ServiceSynchronize.reload(getContext(), "poll");
}
});
@@ -170,7 +172,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("sync_unseen", checked).apply();
ServiceSynchronize.reload(getContext(), false, "sync_unseen=" + checked);
ServiceSynchronize.eval(getContext(), true, "sync_unseen=" + checked);
}
});
@@ -178,7 +180,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("sync_flagged", checked).apply();
ServiceSynchronize.reload(getContext(), false, "sync_flagged=" + checked);
ServiceSynchronize.eval(getContext(), true, "sync_flagged=" + checked);
}
});
@@ -186,7 +188,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("delete_unseen", checked).apply();
ServiceSynchronize.reload(getContext(), false, "delete_unseen=" + checked);
ServiceSynchronize.eval(getContext(), true, "delete_unseen=" + checked);
}
});
@@ -194,7 +196,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("sync_kept", checked).apply();
ServiceSynchronize.reload(getContext(), false, "sync_kept=" + checked);
ServiceSynchronize.eval(getContext(), true, "sync_kept=" + checked);
}
});
@@ -202,7 +204,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("sync_folders", checked).apply();
ServiceSynchronize.reload(getContext(), false, "sync_folders=" + checked);
ServiceSynchronize.eval(getContext(), true, "sync_folders=" + checked);
}
});
@@ -219,7 +221,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("subscribed_only", checked).apply();
ServiceSynchronize.reload(getContext(), "subscribed_only");
ServiceSynchronize.eval(getContext(), true, "subscribed_only");
}
});