summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java7
-rw-r--r--app/src/main/res/layout/f_censorship_circumvention.xml109
2 files changed, 63 insertions, 53 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 99d49ccb..eb777abc 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
@@ -130,12 +130,16 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh
IconTextEntry manualConfiguration = rootView.findViewById(R.id.bridge_manual_switch);
manualConfiguration.setVisibility(ProviderObservable.getInstance().getCurrentProvider().supportsPluggableTransports() ? VISIBLE : GONE);
SwitchCompat manualConfigurationSwitch = rootView.findViewById(R.id.bridge_manual_switch_control);
- manualConfigurationSwitch.setChecked(usesManualBridges());
+ boolean usesManualBridge = usesManualBridges();
+ manualConfigurationSwitch.setChecked(usesManualBridge);
manualConfigurationSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {
if (!buttonView.isPressed()) {
return;
}
resetManualConfig();
+ if (!usesManualBridge){
+ openManualConfigurationFragment();
+ }
});
manualConfiguration.setOnClickListener((buttonView) -> openManualConfigurationFragment());
@@ -151,6 +155,7 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh
useSnowflake(false);
setUseTunnel(TUNNELING_NONE);
setUsePortHopping(false);
+ useBridges(false);
if (VpnStatus.isVPNActive()) {
EipCommand.startVPN(getContext(), false);
Toast.makeText(getContext(), R.string.reconnecting, Toast.LENGTH_LONG).show();
diff --git a/app/src/main/res/layout/f_censorship_circumvention.xml b/app/src/main/res/layout/f_censorship_circumvention.xml
index 6e2d7b5d..69ee7afd 100644
--- a/app/src/main/res/layout/f_censorship_circumvention.xml
+++ b/app/src/main/res/layout/f_censorship_circumvention.xml
@@ -1,65 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:orientation="vertical"
- android:padding="@dimen/activity_margin"
- tools:context=".base.fragments.CensorshipCircumventionFragment">
+ android:layout_height="match_parent">
- <TextView
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/censorship_circumvention_description" />
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:padding="@dimen/activity_margin"
+ tools:context=".base.fragments.CensorshipCircumventionFragment">
- <androidx.appcompat.widget.AppCompatTextView
- android:id="@+id/discovery"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="@dimen/activity_margin"
- android:text="@string/discovery"
- android:textAppearance="@style/TextAppearance.AppCompat.Title" />
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/censorship_circumvention_description" />
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="@dimen/stdpadding"
- android:text="@string/discovery_description" />
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/discovery"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="@dimen/activity_margin"
+ android:text="@string/discovery"
+ android:textAppearance="@style/TextAppearance.AppCompat.Title" />
- <RadioGroup
- android:id="@+id/discovery_radioGroup"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="@dimen/stdpadding"/>
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="@dimen/stdpadding"
+ android:text="@string/discovery_description" />
- <androidx.appcompat.widget.AppCompatTextView
- android:id="@+id/tunnelling"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="@dimen/activity_margin"
- android:text="@string/tunnelling"
- android:textAppearance="@style/TextAppearance.AppCompat.Title" />
+ <RadioGroup
+ android:id="@+id/discovery_radioGroup"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="@dimen/stdpadding" />
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="@dimen/stdpadding"
- android:text="@string/tunnelling_description" />
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/tunnelling"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="@dimen/activity_margin"
+ android:text="@string/tunnelling"
+ android:textAppearance="@style/TextAppearance.AppCompat.Title" />
- <RadioGroup
- android:id="@+id/tunneling_radioGroup"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="@dimen/stdpadding"/>
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="@dimen/stdpadding"
+ android:text="@string/tunnelling_description" />
- <se.leap.bitmaskclient.base.views.IconSwitchEntry
- android:id="@+id/port_hopping_switch"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="@dimen/stdpadding"
- app:text="@string/port_hopping"
- app:subtitle="@string/port_hopping_description"
- app:singleLine="false" />
+ <RadioGroup
+ android:id="@+id/tunneling_radioGroup"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="@dimen/stdpadding" />
+
+ <se.leap.bitmaskclient.base.views.IconSwitchEntry
+ android:id="@+id/port_hopping_switch"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="@dimen/stdpadding"
+ app:singleLine="false"
+ app:subtitle="@string/port_hopping_description"
+ app:text="@string/port_hopping" />
-</LinearLayout> \ No newline at end of file
+ </LinearLayout>
+</ScrollView> \ No newline at end of file