diff options
author | cyBerta <cyberta@riseup.net> | 2021-11-24 10:17:26 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2021-11-24 10:17:26 +0100 |
commit | e3cd28aa6ef16d9bde179a3e1117cdfa585939a4 (patch) | |
tree | dda6f99c2ef2b222d4f07d0ef80d5d0cc373604e /app/src/main | |
parent | 6d24e0c721038bb6f7a5c34703e5cf405166bf6b (diff) |
only show bridges icon in gateway selection list if location supports it AND bridges setting is enabled
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/views/SelectLocationEntry.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/views/SelectLocationEntry.java b/app/src/main/java/se/leap/bitmaskclient/base/views/SelectLocationEntry.java index 204e8692..2a082579 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/views/SelectLocationEntry.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/views/SelectLocationEntry.java @@ -16,6 +16,8 @@ import se.leap.bitmaskclient.R; import se.leap.bitmaskclient.base.models.Location; import se.leap.bitmaskclient.eip.GatewaysManager.Load; +import static de.blinkt.openvpn.core.connection.Connection.TransportType.OBFS4; + public class SelectLocationEntry extends LinearLayout { private static final String TAG = SelectLocationEntry.class.getSimpleName(); @@ -26,8 +28,6 @@ public class SelectLocationEntry extends LinearLayout { LocationIndicator locationIndicator; View divider; - // private OnClickListener onClickListener; - public SelectLocationEntry(Context context) { super(context); initLayout(context); @@ -69,10 +69,9 @@ public class SelectLocationEntry extends LinearLayout { boolean valid = location.hasLocationInfo(); locationText.setVisibility(valid ? VISIBLE : GONE); locationIndicator.setVisibility(valid ? VISIBLE : GONE); - bridgesView.setVisibility(valid ? VISIBLE : GONE); + bridgesView.setVisibility(transportType == OBFS4 && location.supportsTransport(OBFS4) ? VISIBLE : GONE); locationText.setText(location.getName()); locationIndicator.setLoad(Load.getLoadByValue(location.getAverageLoad(transportType))); - bridgesView.setVisibility(location.supportsTransport(Connection.TransportType.OBFS4) ? VISIBLE : GONE); selectedView.setChecked(location.selected); } |