summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-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;
}