summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/base/fragments
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-07-29 18:23:55 +0200
committercyBerta <cyberta@riseup.net>2021-11-15 16:13:41 +0100
commit9818a16e510d42fec32aef5a6efcd6d2ae4aa110 (patch)
tree40c5918898b2a4bb5d6c936f3648edd15800fc72 /app/src/main/java/se/leap/bitmaskclient/base/fragments
parenta45f69a96ccdcc0f1d1aae18c9dcf17bf9d15e73 (diff)
implement location load indicator in gateway selection cell
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/base/fragments')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/fragments/GatewaySelectionFragment.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/GatewaySelectionFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/GatewaySelectionFragment.java
index d1222cd7..e4d8ca8b 100644
--- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/GatewaySelectionFragment.java
+++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/GatewaySelectionFragment.java
@@ -46,6 +46,7 @@ import se.leap.bitmaskclient.base.MainActivity;
import se.leap.bitmaskclient.base.models.Location;
import se.leap.bitmaskclient.base.utils.PreferenceHelper;
import se.leap.bitmaskclient.base.views.IconSwitchEntry;
+import se.leap.bitmaskclient.base.views.LocationIndicator;
import se.leap.bitmaskclient.eip.EipCommand;
import se.leap.bitmaskclient.eip.EipStatus;
import se.leap.bitmaskclient.eip.GatewaysManager;
@@ -189,7 +190,7 @@ public class GatewaySelectionFragment extends Fragment implements SharedPreferen
static class ViewHolder extends RecyclerView.ViewHolder {
public AppCompatTextView locationLabel;
- public AppCompatTextView qualityLabel;
+ public LocationIndicator locationIndicator;
public AppCompatImageView checkedIcon;
public View layout;
@@ -197,7 +198,7 @@ public class GatewaySelectionFragment extends Fragment implements SharedPreferen
super(v);
layout = v;
locationLabel = (AppCompatTextView) v.findViewById(R.id.location);
- qualityLabel = (AppCompatTextView) v.findViewById(R.id.quality);
+ locationIndicator = (LocationIndicator) v.findViewById(R.id.quality);
checkedIcon = (AppCompatImageView) v.findViewById(R.id.checked_icon);
}
}
@@ -263,7 +264,7 @@ public class GatewaySelectionFragment extends Fragment implements SharedPreferen
DrawableCompat.setTint(checkIcon, ContextCompat.getColor(holder.layout.getContext(), R.color.colorSuccess));
holder.checkedIcon.setImageDrawable(checkIcon);
holder.checkedIcon.setVisibility(location.selected ? VISIBLE : INVISIBLE);
- holder.qualityLabel.setText(getQualityString(location.averageLoad));
+ holder.locationIndicator.setLoad(GatewaysManager.Load.getLoadByValue(location.averageLoad));
if (location.selected) {
selectedLocation = location;
}