diff options
author | cyberta <cyberta@riseup.net> | 2022-02-05 05:57:42 +0000 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2022-02-05 05:57:42 +0000 |
commit | 93071764fbc133996d7f7d52db13eea6939a50bf (patch) | |
tree | 971b985f24498d6488c41caba252f64395f25b2f /app/src/main/java/se/leap | |
parent | 09b3c509223cc3dedcc09763b570f5016d73857f (diff) | |
parent | 2375f6a9f2ec395391cca524176d9c54635a14de (diff) |
Merge branch 'improve_load_animation' into 'master'
Improve load animation
Closes #9066 and #9071
See merge request leap/bitmask_android!173
Diffstat (limited to 'app/src/main/java/se/leap')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java | 10 | ||||
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java | 3 |
2 files changed, 8 insertions, 5 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 07057d6e..dfa45614 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 @@ -416,14 +416,14 @@ public class EipFragment extends Fragment implements Observer { } Log.d(TAG, "eip fragment eipStatus state: " + eipStatus.getState() + " - level: " + eipStatus.getLevel() + " - is reconnecting: " + eipStatus.isReconnecting()); - if (eipStatus.isConnecting() ) { + if (eipStatus.isConnecting()) { setMainButtonEnabled(true); showConnectionTransitionLayout(true); locationButton.setText(getString(R.string.eip_status_start_pending)); locationButton.setLocationLoad(UNKNOWN); locationButton.showBridgeIndicator(false); locationButton.showRecommendedIndicator(false); - mainDescription.setText(R.string.eip_state_insecure); + mainDescription.setText(null); subDescription.setText(null); } else if (eipStatus.isConnected()) { setMainButtonEnabled(true); @@ -436,7 +436,7 @@ public class EipFragment extends Fragment implements Observer { mainDescription.setText(R.string.eip_state_connected); subDescription.setText(null); colorBackground(); - } else if(isOpenVpnRunningWithoutNetwork()){ + } else if(isOpenVpnRunningWithoutNetwork()) { Log.d(TAG, "eip fragment eipStatus - isOpenVpnRunningWithoutNetwork"); setMainButtonEnabled(true); mainButton.updateState(true, false, true); @@ -454,7 +454,7 @@ public class EipFragment extends Fragment implements Observer { locationButton.setLocationLoad(UNKNOWN); locationButton.showBridgeIndicator(false); locationButton.showRecommendedIndicator(false); - mainDescription.setText(R.string.eip_state_insecure); + mainDescription.setText(null); subDescription.setText(R.string.reconnecting); } else if (eipStatus.isDisconnecting()) { setMainButtonEnabled(false); @@ -515,7 +515,7 @@ public class EipFragment extends Fragment implements Observer { } private void showConnectionTransitionLayout(boolean isConnecting) { - mainButton.updateState(true, true, false); + mainButton.updateState(true, isConnecting, false); if (isConnecting) { colorBackgroundALittle(); } else { diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java index 060e69f2..0dd4c26c 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java @@ -211,6 +211,9 @@ public class GatewaysManager { public Load getLoadForLocation(@Nullable String name, TransportType transportType) { Location location = getLocation(name); + if (location == null) { + return Load.UNKNOWN; + } return Load.getLoadByValue(location.getAverageLoad(transportType)); } |