mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-30 05:44:51 +02:00
Added option to limit unmetered data usage
This commit is contained in:
@@ -81,6 +81,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||
private ImageButton ibHelp;
|
||||
private SwitchCompat swMetered;
|
||||
private Spinner spDownload;
|
||||
private SwitchCompat swDownloadLimited;
|
||||
private SwitchCompat swRoaming;
|
||||
private SwitchCompat swRlah;
|
||||
private SwitchCompat swDownloadHeaders;
|
||||
@@ -118,7 +119,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||
private Group grpValidated;
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"metered", "download", "roaming", "rlah",
|
||||
"metered", "download", "download_limited", "roaming", "rlah",
|
||||
"download_headers", "download_eml", "download_plain",
|
||||
"require_validated", "require_validated_captive", "vpn_only",
|
||||
"timeout", "prefer_ip4", "bind_socket", "standalone_vpn", "tcp_keep_alive",
|
||||
@@ -139,6 +140,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||
ibHelp = view.findViewById(R.id.ibHelp);
|
||||
swMetered = view.findViewById(R.id.swMetered);
|
||||
spDownload = view.findViewById(R.id.spDownload);
|
||||
swDownloadLimited = view.findViewById(R.id.swDownloadLimited);
|
||||
swRoaming = view.findViewById(R.id.swRoaming);
|
||||
swRlah = view.findViewById(R.id.swRlah);
|
||||
swDownloadHeaders = view.findViewById(R.id.swDownloadHeaders);
|
||||
@@ -211,6 +213,13 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||
}
|
||||
});
|
||||
|
||||
swDownloadLimited.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("download_limited", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swRoaming.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -655,6 +664,8 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||
break;
|
||||
}
|
||||
|
||||
swDownloadLimited.setChecked(prefs.getBoolean("download_limited", false));
|
||||
|
||||
swRoaming.setChecked(prefs.getBoolean("roaming", true));
|
||||
swRlah.setChecked(prefs.getBoolean("rlah", true));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user