From e3cd28aa6ef16d9bde179a3e1117cdfa585939a4 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Wed, 24 Nov 2021 10:17:26 +0100 Subject: only show bridges icon in gateway selection list if location supports it AND bridges setting is enabled --- .../java/se/leap/bitmaskclient/base/views/SelectLocationEntry.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app') 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); } -- cgit v1.2.3