mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-22 15:47:58 +01:00
Tune keep-alive interval by default
This commit is contained in:
@@ -80,6 +80,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
private TextView tvSubscriptionPro;
|
||||
private SwitchCompat swCheckMx;
|
||||
private SwitchCompat swCheckReply;
|
||||
private SwitchCompat swTuneKeepAlive;
|
||||
private Group grpExempted;
|
||||
|
||||
private AdapterAccountExempted adapter;
|
||||
@@ -88,7 +89,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
"enabled", "poll_interval", "schedule", "schedule_start", "schedule_end",
|
||||
"sync_nodate", "sync_unseen", "sync_flagged", "delete_unseen", "sync_kept", "gmail_thread_id",
|
||||
"sync_folders", "sync_shared_folders", "subscriptions",
|
||||
"check_mx", "check_reply"
|
||||
"check_mx", "check_reply", "tune_keep_alive"
|
||||
};
|
||||
|
||||
@Override
|
||||
@@ -129,6 +130,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
tvSubscriptionPro = view.findViewById(R.id.tvSubscriptionPro);
|
||||
swCheckMx = view.findViewById(R.id.swCheckMx);
|
||||
swCheckReply = view.findViewById(R.id.swCheckReply);
|
||||
swTuneKeepAlive = view.findViewById(R.id.swTuneKeepAlive);
|
||||
grpExempted = view.findViewById(R.id.grpExempted);
|
||||
|
||||
setOptions();
|
||||
@@ -308,6 +310,13 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
}
|
||||
});
|
||||
|
||||
swTuneKeepAlive.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("tune_keep_alive", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
DB db = DB.getInstance(getContext());
|
||||
db.account().liveSynchronizingAccounts().observe(getViewLifecycleOwner(), new Observer<List<EntityAccount>>() {
|
||||
@Override
|
||||
@@ -397,6 +406,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
swSubscriptions.setEnabled(pro);
|
||||
swCheckMx.setChecked(prefs.getBoolean("check_mx", false));
|
||||
swCheckReply.setChecked(prefs.getBoolean("check_reply", false));
|
||||
swTuneKeepAlive.setChecked(prefs.getBoolean("tune_keep_alive", true));
|
||||
}
|
||||
|
||||
private String formatHour(Context context, int minutes) {
|
||||
|
||||
Reference in New Issue
Block a user