summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java12
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());
}