diff options
author | cyberta <cyberta@riseup.net> | 2022-12-02 16:02:26 +0100 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2022-12-02 20:27:39 +0100 |
commit | 4647d86693065a5a52558cc8f8e340cb48f5353d (patch) | |
tree | ec81988dd34e51a999beebab186a429eefaa0c27 /app/src/main/java/se/leap | |
parent | 1709558fd2025a62931248b4c021f379172de70f (diff) |
add another setText() method in LocationButton that allows to pass a string resource id instead of a string
Diffstat (limited to 'app/src/main/java/se/leap')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java | 4 | ||||
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/views/LocationButton.java | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java index 4df568b9..d63d9c72 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java @@ -542,7 +542,7 @@ public class EipFragment extends Fragment implements Observer { } else if (eipStatus.isBlocking()) { setMainButtonEnabled(true); mainButton.updateState(true, false, true); - locationButton.setText(getString(R.string.no_location)); + locationButton.setText(R.string.no_location); locationButton.setLocationLoad(UNKNOWN); locationButton.showBridgeIndicator(false); locationButton.showRecommendedIndicator(false); @@ -552,7 +552,7 @@ public class EipFragment extends Fragment implements Observer { animateState(R.drawable.state_disconnected); setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent); } else { - locationButton.setText(getContext().getString(R.string.vpn_button_turn_on)); + locationButton.setText(R.string.vpn_button_turn_on); setMainButtonEnabled(true); mainButton.updateState(false, false, false); locationButton.setLocationLoad(UNKNOWN); 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 7ad044bd..ae77d60e 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 @@ -8,6 +8,7 @@ import android.widget.RelativeLayout; import androidx.annotation.ColorRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.annotation.StringRes; import androidx.appcompat.widget.AppCompatImageView; import androidx.appcompat.widget.AppCompatTextView; import androidx.core.content.ContextCompat; @@ -52,6 +53,10 @@ public class LocationButton extends RelativeLayout { textView.setText(text); } + public void setText(@StringRes int resId) { + textView.setText(resId); + } + public void showBridgeIndicator(boolean show) { bridgeView.setVisibility(show ? VISIBLE : GONE); } |