summaryrefslogtreecommitdiff
path: root/app/src/main/java/se
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2022-11-29 14:01:05 +0100
committercyberta <cyberta@riseup.net>2022-11-30 14:19:39 +0100
commitc2f6bc4e2098265fb1fc8f671dbdecbb5917c6fc (patch)
tree1a1889b6dceebce2e0d63283dd1116b9dc468271 /app/src/main/java/se
parent0cf31d76c9f48cc73446b3fde478a46cd29c7594 (diff)
new EipFragment layout for Bitmask - portrait
Diffstat (limited to 'app/src/main/java/se')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/views/LocationButton.java25
1 files changed, 18 insertions, 7 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/views/LocationButton.java b/app/src/main/java/se/leap/bitmaskclient/base/views/LocationButton.java
index b2182d61..2118ecb5 100644
--- a/app/src/main/java/se/leap/bitmaskclient/base/views/LocationButton.java
+++ b/app/src/main/java/se/leap/bitmaskclient/base/views/LocationButton.java
@@ -1,17 +1,25 @@
package se.leap.bitmaskclient.base.views;
import android.content.Context;
+import android.content.res.ColorStateList;
+import android.graphics.drawable.ColorDrawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.RelativeLayout;
+import androidx.annotation.ColorRes;
+import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.AppCompatTextView;
+import androidx.core.content.ContextCompat;
+import androidx.core.view.LayoutInflaterCompat;
+import androidx.core.view.ViewCompat;
import se.leap.bitmaskclient.R;
+import se.leap.bitmaskclient.databinding.VLocationButtonBinding;
import se.leap.bitmaskclient.eip.GatewaysManager;
public class LocationButton extends RelativeLayout {
@@ -31,13 +39,16 @@ public class LocationButton extends RelativeLayout {
}
private void initLayout(Context context) {
- LayoutInflater inflater = (LayoutInflater) context
- .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- View rootview = inflater.inflate(R.layout.v_location_button, this, true);
- locationIndicator = rootview.findViewById(R.id.load_indicator);
- textView = rootview.findViewById(R.id.text_location);
- bridgeView = rootview.findViewById(R.id.bridge_icn);
- recommendedView = rootview.findViewById(R.id.recommended_icn);
+ VLocationButtonBinding binding = VLocationButtonBinding.inflate(LayoutInflater.from(context), this, true);
+ locationIndicator = binding.loadIndicator;
+ textView = binding.textLocation;
+ bridgeView = binding.bridgeIcn;
+ recommendedView = binding.recommendedIcn;
+
+ }
+
+ public void setTextColor(@ColorRes int color) {
+ textView.setTextColor(ContextCompat.getColor(getContext(), color));
}
public void setLocationLoad(GatewaysManager.Load load) {