summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2022-12-06 04:22:39 +0100
committercyberta <cyberta@riseup.net>2022-12-06 04:22:39 +0100
commit4c6f49fe5ec695541be06322a1cf227e2d6d083d (patch)
tree3ac508716ac0210603f32f80baf07881c80b3ab1 /app/src/main
parent16d41d3df2c2405c9f716675841c53c41fbf8400 (diff)
restrict transition animation to connected -> disconnected state change
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java8
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java3
2 files changed, 8 insertions, 3 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 69e3aca1..a5ccb81d 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
@@ -113,6 +113,7 @@ public class EipFragment extends Fragment implements Observer {
AppCompatTextView mainDescription;
AppCompatTextView subDescription;
+ private EipStatus.EipLevel previousEipLevel = EipStatus.EipLevel.UNKNOWN;
private EipStatus eipStatus;
private ProviderObservable providerObservable;
private TorStatusObservable torStatusObservable;
@@ -415,6 +416,7 @@ public class EipFragment extends Fragment implements Observer {
@Override
public void update(Observable observable, Object data) {
if (observable instanceof EipStatus) {
+ previousEipLevel = eipStatus.getEipLevel();
eipStatus = (EipStatus) observable;
handleNewStateOnMain();
@@ -537,7 +539,11 @@ public class EipFragment extends Fragment implements Observer {
mainButton.updateState(false, false, false);
mainDescription.setText(R.string.eip_status_unsecured);
background.setImageResource(R.drawable.bg_disconnected);
- animateState(R.drawable.state_transition_connected_disconnected);
+ if (previousEipLevel == EipStatus.EipLevel.CONNECTED) {
+ animateState(R.drawable.state_transition_connected_disconnected);
+ } else {
+ animateState(R.drawable.state_disconnected);
+ }
setActivityBarColor(R.color.bg_disconnected_top, R.color.bg_disconnected_top_light_transparent);
} else if (eipStatus.isBlocking()) {
setMainButtonEnabled(true);
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java
index 003e396f..c9cf6041 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java
@@ -129,8 +129,7 @@ public class EipStatus extends Observable implements VpnStatus.StateListener {
}
}
- @VisibleForTesting
- EipLevel getEipLevel() {
+ public EipLevel getEipLevel() {
return currentEipLevel;
}