diff options
author | cyBerta <cyberta@riseup.net> | 2021-11-26 12:37:32 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2021-11-26 12:37:32 +0100 |
commit | cf3e52d0b4add8d805ac7a9e0b5e6e340106265e (patch) | |
tree | 770c482cdf30fc343894521c860c015bca74f7e1 /app/src/main/java/se/leap | |
parent | 7e55369cb99cf8362072a0d4fc78bdd238bc24f4 (diff) |
disable UDP UI settings while using bridges
Diffstat (limited to 'app/src/main/java/se/leap')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java index a695fcb2..d4f142ef 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java @@ -134,10 +134,10 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh } private void initPreferUDPEntry(View rootView) { - IconSwitchEntry useSnowflake = rootView.findViewById(R.id.prefer_udp); - useSnowflake.setVisibility(VISIBLE); - useSnowflake.setChecked(getPreferUDP(getContext())); - useSnowflake.setOnCheckedChangeListener((buttonView, isChecked) -> { + IconSwitchEntry useUdpEntry = rootView.findViewById(R.id.prefer_udp); + useUdpEntry.setVisibility(VISIBLE); + useUdpEntry.setChecked(getPreferUDP(getContext())); + useUdpEntry.setOnCheckedChangeListener((buttonView, isChecked) -> { if (!buttonView.isPressed()) { return; } @@ -147,6 +147,9 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh Toast.makeText(getContext(), R.string.reconnecting, Toast.LENGTH_LONG).show(); } }); + boolean bridgesEnabled = getUseBridges(getContext()); + useUdpEntry.setEnabled(!bridgesEnabled); + useUdpEntry.setSubtitle(getString(bridgesEnabled ? R.string.disabled_while_bridges_on : R.string.prefer_udp_subtitle)); } private void initExcludeAppsEntry(View rootView) { @@ -234,6 +237,7 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh } if (key.equals(USE_BRIDGES)) { initUseBridgesEntry(rootView); + initPreferUDPEntry(rootView); } else if (key.equals(USE_IPv6_FIREWALL)) { initFirewallEntry(getView()); } |