summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-11-26 11:56:39 +0100
committercyBerta <cyberta@riseup.net>2021-11-26 11:56:39 +0100
commit7e55369cb99cf8362072a0d4fc78bdd238bc24f4 (patch)
tree0e4a9e299bef40d155ddc5a75dcf3484547ba277
parentaabf3d9633eeca6ec1ce1a31400b799b5be1b7e9 (diff)
instead of leaving the settings screen, show a toast if VPN needs to reconnect to apply setting changes
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java13
1 files changed, 3 insertions, 10 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java
index a38314d1..a695fcb2 100644
--- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java
+++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java
@@ -7,6 +7,7 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -94,7 +95,7 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh
useBridges(getContext(), isChecked);
if (VpnStatus.isVPNActive()) {
EipCommand.startVPN(getContext(), false);
- showVPNFragment();
+ Toast.makeText(getContext(), R.string.reconnecting, Toast.LENGTH_LONG).show();
}
});
@@ -143,7 +144,7 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh
preferUDP(getContext(), isChecked);
if (VpnStatus.isVPNActive()) {
EipCommand.startVPN(getContext(), false);
- showVPNFragment();
+ Toast.makeText(getContext(), R.string.reconnecting, Toast.LENGTH_LONG).show();
}
});
}
@@ -191,14 +192,6 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh
});
}
- private void showVPNFragment() {
- Intent intent = new Intent(getContext(), MainActivity.class);
- intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
- intent.setAction(ACTION_SHOW_VPN_FRAGMENT);
- startActivity(intent);
- }
-
-
private void initTetheringEntry(View rootView) {
tethering = rootView.findViewById(R.id.tethering);
tethering.setOnClickListener((buttonView) -> {