diff options
author | cyBerta <cyberta@riseup.net> | 2021-11-20 13:42:59 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2021-11-20 13:42:59 +0100 |
commit | 9cf45bbcc1e707525fecdac5e691adebf0c28cb5 (patch) | |
tree | e848eadcbafe62736b74f66bdac1321a10dd1b22 | |
parent | 329800842ae9a1be97335f7de9c766b6ed728530 (diff) |
show lightning bold instead of text 'You're connected to the recommended location'
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java | 17 | ||||
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/views/LocationButton.java | 7 | ||||
-rw-r--r-- | app/src/main/res/drawable-hdpi/ic_lightning_bolt.png | bin | 0 -> 533 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-ldpi/ic_lightning_bolt.png | bin | 0 -> 418 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-mdpi/ic_lightning_bolt.png | bin | 0 -> 478 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-xhdpi/ic_lightning_bolt.png | bin | 0 -> 679 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-xxhdpi/ic_lightning_bolt.png | bin | 0 -> 821 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-xxxhdpi/ic_lightning_bolt.png | bin | 0 -> 1054 bytes | |||
-rw-r--r-- | app/src/main/res/layout/v_location_button.xml | 19 |
9 files changed, 34 insertions, 9 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 983db3ec..b065486a 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 @@ -418,27 +418,29 @@ public class EipFragment extends Fragment implements Observer { setMainButtonEnabled(true); showConnectionTransitionLayout(true); locationButton.setText(getString(R.string.finding_best_connection)); - mainDescription.setText(R.string.eip_state_insecure); - subDescription.setText(null); locationButton.setLocationLoad(UNKNOWN); locationButton.showBridgeIndicator(false); + locationButton.showRecommendedIndicator(false); + mainDescription.setText(R.string.eip_state_insecure); + subDescription.setText(null); } else if (eipStatus.isConnected()) { setMainButtonEnabled(true); mainButton.updateState(true, false, false); locationButton.setLocationLoad(gatewaysManager.getLoadForLocation(VpnStatus.getLastConnectedVpnName())); locationButton.setText(VpnStatus.getLastConnectedVpnName()); locationButton.showBridgeIndicator(VpnStatus.isUsingBridges()); - colorBackground(); + locationButton.showRecommendedIndicator(getPreferredCity(getContext())== null); mainDescription.setText(R.string.eip_state_connected); - subDescription.setText(getPreferredCity(getContext()) == null ? - R.string.eip_state_connected_recommended : - R.string.eip_state_connected_manual); + subDescription.setText(null); + colorBackground(); } else if(isOpenVpnRunningWithoutNetwork()){ Log.d(TAG, "eip fragment eipStatus - isOpenVpnRunningWithoutNetwork"); setMainButtonEnabled(true); mainButton.updateState(true, false, true); locationButton.setText(VpnStatus.getCurrentlyConnectingVpnName()); locationButton.showBridgeIndicator(VpnStatus.isUsingBridges()); + locationButton.showBridgeIndicator(VpnStatus.isUsingBridges()); + locationButton.showRecommendedIndicator(getPreferredCity(getContext())== null); colorBackgroundALittle(); mainDescription.setText(R.string.eip_state_connected); subDescription.setText(R.string.eip_state_no_network); @@ -448,6 +450,7 @@ public class EipFragment extends Fragment implements Observer { locationButton.setText(getString(R.string.finding_best_connection)); locationButton.setLocationLoad(UNKNOWN); locationButton.showBridgeIndicator(false); + locationButton.showRecommendedIndicator(false); mainDescription.setText(R.string.eip_state_insecure); subDescription.setText(R.string.reconnecting); } else if (eipStatus.isDisconnecting()) { @@ -461,6 +464,7 @@ public class EipFragment extends Fragment implements Observer { locationButton.setText(getString(R.string.finding_best_connection)); locationButton.setLocationLoad(UNKNOWN); locationButton.showBridgeIndicator(false); + locationButton.showRecommendedIndicator(false); mainDescription.setText(R.string.eip_state_connected); subDescription.setText(getString(R.string.eip_state_blocking, getString(R.string.app_name))); } else { @@ -471,6 +475,7 @@ public class EipFragment extends Fragment implements Observer { locationButton.setLocationLoad(UNKNOWN); locationButton.showBridgeIndicator(false); locationButton.setText(getString(R.string.gateway_selection_title)); + locationButton.showRecommendedIndicator(false); mainDescription.setText(R.string.eip_state_insecure); subDescription.setText(R.string.connection_not_connected); } 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 11ea198c..b2182d61 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 @@ -10,7 +10,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.AppCompatImageView; import androidx.appcompat.widget.AppCompatTextView; -import androidx.appcompat.widget.LinearLayoutCompat; import se.leap.bitmaskclient.R; import se.leap.bitmaskclient.eip.GatewaysManager; @@ -19,6 +18,7 @@ public class LocationButton extends RelativeLayout { private LocationIndicator locationIndicator; private AppCompatTextView textView; private AppCompatImageView bridgeView; + private AppCompatImageView recommendedView; public LocationButton(@NonNull Context context) { super(context); @@ -37,6 +37,7 @@ public class LocationButton extends RelativeLayout { 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); } public void setLocationLoad(GatewaysManager.Load load) { @@ -50,4 +51,8 @@ public class LocationButton extends RelativeLayout { public void showBridgeIndicator(boolean show) { bridgeView.setVisibility(show ? VISIBLE : GONE); } + + public void showRecommendedIndicator(boolean show) { + recommendedView.setVisibility(show? VISIBLE : GONE ); + } } diff --git a/app/src/main/res/drawable-hdpi/ic_lightning_bolt.png b/app/src/main/res/drawable-hdpi/ic_lightning_bolt.png Binary files differnew file mode 100644 index 00000000..ade9565c --- /dev/null +++ b/app/src/main/res/drawable-hdpi/ic_lightning_bolt.png diff --git a/app/src/main/res/drawable-ldpi/ic_lightning_bolt.png b/app/src/main/res/drawable-ldpi/ic_lightning_bolt.png Binary files differnew file mode 100644 index 00000000..8209e93f --- /dev/null +++ b/app/src/main/res/drawable-ldpi/ic_lightning_bolt.png diff --git a/app/src/main/res/drawable-mdpi/ic_lightning_bolt.png b/app/src/main/res/drawable-mdpi/ic_lightning_bolt.png Binary files differnew file mode 100644 index 00000000..021cd490 --- /dev/null +++ b/app/src/main/res/drawable-mdpi/ic_lightning_bolt.png diff --git a/app/src/main/res/drawable-xhdpi/ic_lightning_bolt.png b/app/src/main/res/drawable-xhdpi/ic_lightning_bolt.png Binary files differnew file mode 100644 index 00000000..f1852f68 --- /dev/null +++ b/app/src/main/res/drawable-xhdpi/ic_lightning_bolt.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_lightning_bolt.png b/app/src/main/res/drawable-xxhdpi/ic_lightning_bolt.png Binary files differnew file mode 100644 index 00000000..23914343 --- /dev/null +++ b/app/src/main/res/drawable-xxhdpi/ic_lightning_bolt.png diff --git a/app/src/main/res/drawable-xxxhdpi/ic_lightning_bolt.png b/app/src/main/res/drawable-xxxhdpi/ic_lightning_bolt.png Binary files differnew file mode 100644 index 00000000..53ed1873 --- /dev/null +++ b/app/src/main/res/drawable-xxxhdpi/ic_lightning_bolt.png diff --git a/app/src/main/res/layout/v_location_button.xml b/app/src/main/res/layout/v_location_button.xml index 6a7214c8..8cba9d70 100644 --- a/app/src/main/res/layout/v_location_button.xml +++ b/app/src/main/res/layout/v_location_button.xml @@ -18,6 +18,21 @@ android:src="@drawable/ic_web" android:layout_gravity="center" /> + <androidx.appcompat.widget.AppCompatImageView + android:id="@+id/recommended_icn" + android:scaleType="fitXY" + android:layout_marginRight="-13dp" + android:layout_marginEnd="-13dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignTop="@id/text_location" + android:layout_alignBottom="@+id/text_location" + android:layout_toEndOf="@id/world_icn" + android:layout_toRightOf="@id/world_icn" + android:src="@drawable/ic_lightning_bolt" + android:visibility="gone" + tools:visibility="visible" + /> <androidx.appcompat.widget.AppCompatTextView android:id="@+id/text_location" android:paddingStart="@dimen/stdpadding" @@ -28,8 +43,8 @@ android:ellipsize="end" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:layout_toEndOf="@id/world_icn" - android:layout_toRightOf="@+id/world_icn" + android:layout_toEndOf="@id/recommended_icn" + android:layout_toRightOf="@+id/recommended_icn" android:layout_toLeftOf="@+id/bridge_icn" android:layout_toStartOf="@+id/bridge_icn" android:layout_gravity="center_vertical" |