From 16522f330befdd556c1d0bc703b1ee207bf0aec7 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 20 Nov 2014 00:06:31 +0100 Subject: More fine-tuning, move obscure and behavior settings together (again...) --HG-- extra : rebase_source : 9e9ea0548b9b98505a880dc30b8ca1e513d0e5ea --- .../blinkt/openvpn/activities/VPNPreferences.java | 15 +--- .../openvpn/fragments/Settings_Behaviour.java | 82 ---------------------- .../openvpn/fragments/Settings_Connections.java | 6 +- .../blinkt/openvpn/fragments/Settings_Obscure.java | 68 +++++++++++++++++- main/src/main/res/layout-v21/tabs.xml | 4 +- main/src/main/res/layout/allowed_vpn_apps.xml | 19 +++-- main/src/main/res/layout/connections.xml | 39 +++++++--- main/src/main/res/values/colours.xml | 3 +- main/src/main/res/values/strings.xml | 3 + main/src/main/res/xml/vpn_authentification.xml | 37 +++++----- main/src/main/res/xml/vpn_behaviour.xml | 29 -------- main/src/main/res/xml/vpn_obscure.xml | 28 ++++++-- 12 files changed, 164 insertions(+), 169 deletions(-) delete mode 100644 main/src/main/java/de/blinkt/openvpn/fragments/Settings_Behaviour.java delete mode 100644 main/src/main/res/xml/vpn_behaviour.xml (limited to 'main/src') diff --git a/main/src/main/java/de/blinkt/openvpn/activities/VPNPreferences.java b/main/src/main/java/de/blinkt/openvpn/activities/VPNPreferences.java index 4eee5eea..2ef0dcce 100644 --- a/main/src/main/java/de/blinkt/openvpn/activities/VPNPreferences.java +++ b/main/src/main/java/de/blinkt/openvpn/activities/VPNPreferences.java @@ -21,15 +21,9 @@ import android.view.MenuItem; import de.blinkt.openvpn.R; import de.blinkt.openvpn.VpnProfile; import de.blinkt.openvpn.core.ProfileManager; -import de.blinkt.openvpn.fragments.AboutFragment; -import de.blinkt.openvpn.fragments.FaqFragment; -import de.blinkt.openvpn.fragments.GeneralSettings; -import de.blinkt.openvpn.fragments.LogFragment; -import de.blinkt.openvpn.fragments.SendDumpFragment; import de.blinkt.openvpn.fragments.Settings_Allowed_Apps; import de.blinkt.openvpn.fragments.Settings_Authentication; import de.blinkt.openvpn.fragments.Settings_Basic; -import de.blinkt.openvpn.fragments.Settings_Behaviour; import de.blinkt.openvpn.fragments.Settings_Connections; import de.blinkt.openvpn.fragments.Settings_IP; import de.blinkt.openvpn.fragments.Settings_Obscure; @@ -45,7 +39,7 @@ public class VPNPreferences extends Activity { static final Class validFragments[] = new Class[] { Settings_Authentication.class, Settings_Basic.class, Settings_IP.class, Settings_Obscure.class, Settings_Routing.class, ShowConfigFragment.class, - Settings_Behaviour.class, Settings_Connections.class, Settings_Allowed_Apps.class + Settings_Connections.class, Settings_Allowed_Apps.class }; private String mProfileUUID; @@ -140,19 +134,16 @@ public class VPNPreferences extends Activity { fragmentArguments.putString(getPackageName() + ".profileUUID",mProfileUUID); mPagerAdapter.setFragmentArgs(fragmentArguments); - mPagerAdapter.addTab(R.string.client_behaviour, Settings_Behaviour.class); - - mPagerAdapter.addTab(R.string.server_list, Settings_Connections.class); - mPagerAdapter.addTab(R.string.basic, Settings_Basic.class); + mPagerAdapter.addTab(R.string.server_list, Settings_Connections.class); mPagerAdapter.addTab(R.string.ipdns, Settings_IP.class); mPagerAdapter.addTab(R.string.routing, Settings_Routing.class); mPagerAdapter.addTab(R.string.settings_auth, Settings_Authentication.class); + mPagerAdapter.addTab(R.string.advanced, Settings_Obscure.class); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) mPagerAdapter.addTab(R.string.vpn_allowed_apps, Settings_Allowed_Apps.class); - mPagerAdapter.addTab(R.string.advanced, Settings_Obscure.class); mPagerAdapter.addTab(R.string.generated_config, ShowConfigFragment.class); diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Behaviour.java b/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Behaviour.java deleted file mode 100644 index 8563fc8f..00000000 --- a/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Behaviour.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2012-2014 Arne Schwabe - * Distributed under the GNU GPL v2. For full terms see the file doc/LICENSE.txt - */ - -package de.blinkt.openvpn.fragments; - -import android.os.Bundle; -import android.preference.CheckBoxPreference; -import android.preference.EditTextPreference; -import android.preference.ListPreference; -import android.preference.Preference; -import android.preference.Preference.OnPreferenceChangeListener; - -import de.blinkt.openvpn.R; - -public class Settings_Behaviour extends OpenVpnPreferencesFragment implements OnPreferenceChangeListener { - private CheckBoxPreference mPersistent; - private ListPreference mConnectretrymax; - private EditTextPreference mConnectretry; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - // Load the preferences from an XML resource - addPreferencesFromResource(R.xml.vpn_behaviour); - - mPersistent = (CheckBoxPreference) findPreference("usePersistTun"); - mConnectretrymax = (ListPreference) findPreference("connectretrymax"); - mConnectretry = (EditTextPreference) findPreference("connectretry"); - - mConnectretrymax.setOnPreferenceChangeListener(this); - mConnectretrymax.setSummary("%s"); - - mConnectretry.setOnPreferenceChangeListener(this); - - - loadSettings(); - - } - - protected void loadSettings() { - mPersistent.setChecked(mProfile.mPersistTun); - - mConnectretrymax.setValue(mProfile.mConnectRetryMax); - onPreferenceChange(mConnectretrymax, mProfile.mConnectRetryMax); - - mConnectretry.setText(mProfile.mConnectRetry); - onPreferenceChange(mConnectretry, mProfile.mConnectRetry); - } - - - protected void saveSettings() { - mProfile.mConnectRetryMax = mConnectretrymax.getValue(); - mProfile.mPersistTun = mPersistent.isChecked(); - mProfile.mConnectRetry = mConnectretry.getText(); - } - - - @Override - public boolean onPreferenceChange(Preference preference, Object newValue) { - if (preference == mConnectretrymax) { - if(newValue==null) { - newValue="5"; - } - mConnectretrymax.setDefaultValue(newValue); - - for(int i=0;i + blinkt:pstsIndicatorHeight="3dp" + android:elevation="8dp" /> \ No newline at end of file diff --git a/main/src/main/res/layout/allowed_vpn_apps.xml b/main/src/main/res/layout/allowed_vpn_apps.xml index 66665cb6..53c48fd8 100644 --- a/main/src/main/res/layout/allowed_vpn_apps.xml +++ b/main/src/main/res/layout/allowed_vpn_apps.xml @@ -7,29 +7,34 @@ xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="match_parent" + tools:ignore="RtlCompat" android:layout_height="match_parent"> + + - + + + + + - + tools:visibility="gone" /> diff --git a/main/src/main/res/values/colours.xml b/main/src/main/res/values/colours.xml index 3d8ce000..f27167f3 100644 --- a/main/src/main/res/values/colours.xml +++ b/main/src/main/res/values/colours.xml @@ -10,10 +10,11 @@ #3F51B5 #303F9F #FFA726 - #5C6BC0 #ffff00 #ff0000 + @android:color/darker_gray + #1AFFFFFF diff --git a/main/src/main/res/values/strings.xml b/main/src/main/res/values/strings.xml index 9c7ade61..aeb03712 100755 --- a/main/src/main/res/values/strings.xml +++ b/main/src/main/res/values/strings.xml @@ -342,5 +342,8 @@ You need to define and enable at least one remote server. Server List Allowed Apps + Advanced Settings + Payload options + TLS Settings diff --git a/main/src/main/res/xml/vpn_authentification.xml b/main/src/main/res/xml/vpn_authentification.xml index cea54b8f..d2f6ad25 100644 --- a/main/src/main/res/xml/vpn_authentification.xml +++ b/main/src/main/res/xml/vpn_authentification.xml @@ -1,26 +1,25 @@ - - - + + + + - - - - - - + + + - + - - - - - - - - - - - - \ No newline at end of file diff --git a/main/src/main/res/xml/vpn_obscure.xml b/main/src/main/res/xml/vpn_obscure.xml index 2d5269c5..288752aa 100644 --- a/main/src/main/res/xml/vpn_obscure.xml +++ b/main/src/main/res/xml/vpn_obscure.xml @@ -1,12 +1,32 @@ - - + android:title="@string/advanced_settings"> + + + + + + + + + - +