mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 11:28:41 +01:00
Added setting to disable downloading while roaming
This commit is contained in:
@@ -71,6 +71,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
private TextView tvConnectionRoaming;
|
||||
private SwitchCompat swMetered;
|
||||
private Spinner spDownload;
|
||||
private SwitchCompat swRoaming;
|
||||
|
||||
private Spinner spStartup;
|
||||
private SwitchCompat swDate;
|
||||
@@ -126,7 +127,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
|
||||
private final static String[] ADVANCED_OPTIONS = new String[]{
|
||||
"enabled", "schedule_start", "schedule_end",
|
||||
"metered", "download",
|
||||
"metered", "download", "roaming",
|
||||
"startup", "date", "threading", "avatars", "identicons", "name_email", "subject_italic", "flags", "preview",
|
||||
"addresses", "monospaced", "autohtml", "autoimages", "actionbar",
|
||||
"pull", "swipenav", "autoexpand", "autoclose", "autonext", "collapse", "autoread", "automove",
|
||||
@@ -155,6 +156,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
tvConnectionRoaming = view.findViewById(R.id.tvConnectionRoaming);
|
||||
swMetered = view.findViewById(R.id.swMetered);
|
||||
spDownload = view.findViewById(R.id.spDownload);
|
||||
swRoaming = view.findViewById(R.id.swRoaming);
|
||||
|
||||
spStartup = view.findViewById(R.id.spStartup);
|
||||
swDate = view.findViewById(R.id.swDate);
|
||||
@@ -281,6 +283,14 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
}
|
||||
});
|
||||
|
||||
swRoaming.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("roaming", checked).apply();
|
||||
ServiceSynchronize.reload(getContext(), "roaming=" + checked);
|
||||
}
|
||||
});
|
||||
|
||||
spStartup.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
|
||||
@@ -652,6 +662,8 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
break;
|
||||
}
|
||||
|
||||
swRoaming.setChecked(prefs.getBoolean("roaming", true));
|
||||
|
||||
boolean compact = prefs.getBoolean("compact", false);
|
||||
|
||||
String startup = prefs.getString("startup", "unified");
|
||||
|
||||
Reference in New Issue
Block a user