summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-11-06 00:24:08 +0100
committercyBerta <cyberta@riseup.net>2021-11-06 00:24:08 +0100
commit7b2f2432edf3f2b4c66aa95d398c65de63da6f46 (patch)
treecac6baad03751347ca55044a380e8a30c220e262 /app/src/main/java
parentaecd8ca5ecf984b581e0b0165cd168976dc6c0f2 (diff)
hide connection detail UI on error handling
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ConfigWizardBaseActivity.java15
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ProviderSetupBaseActivity.java4
2 files changed, 16 insertions, 3 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ConfigWizardBaseActivity.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ConfigWizardBaseActivity.java
index a0c046de..930c0f73 100644
--- a/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ConfigWizardBaseActivity.java
+++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ConfigWizardBaseActivity.java
@@ -31,6 +31,7 @@ import java.util.Observable;
import java.util.Observer;
import butterknife.BindView;
+import se.leap.bitmaskclient.BuildConfig;
import se.leap.bitmaskclient.R;
import se.leap.bitmaskclient.base.models.Provider;
import se.leap.bitmaskclient.base.views.ProviderHeaderView;
@@ -218,6 +219,16 @@ public abstract class ConfigWizardBaseActivity extends ButterKnifeActivity imple
providerHeaderView.setTitle(providerHeaderText);
}
+ protected void hideConnectionDetails() {
+ if (loadingScreen == null) {
+ return;
+ }
+
+ connectionDetailBtn.setVisibility(VISIBLE);
+ connectionDetailContainer.setVisibility(GONE);
+ logsContainer.setVisibility(GONE);
+ }
+
protected void showConnectionDetails() {
if (loadingScreen == null) {
return;
@@ -257,9 +268,7 @@ public abstract class ConfigWizardBaseActivity extends ButterKnifeActivity imple
if (loadingScreen == null) {
return;
}
- connectionDetailBtn.setVisibility(VISIBLE);
- connectionDetailContainer.setVisibility(GONE);
- logsContainer.setVisibility(GONE);
+ hideConnectionDetails();
loadingScreen.setVisibility(GONE);
content.setVisibility(VISIBLE);
}
diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ProviderSetupBaseActivity.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ProviderSetupBaseActivity.java
index 7628dfcb..a9f773c3 100644
--- a/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ProviderSetupBaseActivity.java
+++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ProviderSetupBaseActivity.java
@@ -20,6 +20,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Log;
+import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -89,9 +90,11 @@ public abstract class ProviderSetupBaseActivity extends ConfigWizardBaseActivity
showProgressBar();
} else if (PENDING_SHOW_FAILED_DIALOG == providerConfigState) {
showProgressBar();
+ hideConnectionDetails();
showDownloadFailedDialog();
} else if (SHOW_FAILED_DIALOG == providerConfigState) {
showProgressBar();
+ hideConnectionDetails();
} else if (SHOWING_PROVIDER_DETAILS == providerConfigState) {
cancelSettingUpProvider(false);
} else if (PENDING_SHOW_PROVIDER_DETAILS == providerConfigState) {
@@ -229,6 +232,7 @@ public abstract class ProviderSetupBaseActivity extends ConfigWizardBaseActivity
public void showDownloadFailedDialog() {
try {
providerConfigState = SHOW_FAILED_DIALOG;
+ hideConnectionDetails();
FragmentTransaction fragmentTransaction = fragmentManager.removePreviousFragment(ProviderSetupFailedDialog.TAG);
DialogFragment newFragment;
try {