From e9c8ea835a8d2679fa919519b4d23ca7139d988b Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 17 Nov 2014 20:33:38 +0100 Subject: More taking of new layout and features --HG-- extra : rebase_source : 77e40c87eb1c11019361f8bf4d53068921025ae4 --- .../main/java/de/blinkt/openvpn/VpnProfile.java | 8 ++++ .../openvpn/fragments/ConnectionsAdapter.java | 2 +- .../openvpn/fragments/Settings_Allowed_Apps.java | 35 ++++++++-------- main/src/main/res/drawable/bg_switchbar.xml | 9 +++++ main/src/main/res/layout/allowed_vpn_apps.xml | 46 +++++++++++++--------- main/src/main/res/layout/connections.xml | 4 +- main/src/main/res/menu/connections.xml | 2 +- main/src/main/res/values-v21/styles.xml | 1 + main/src/main/res/values/colours.xml | 10 +++-- main/src/main/res/values/dimens.xml | 1 + main/src/main/res/values/strings.xml | 5 ++- main/src/main/res/values/styles.xml | 7 +++- 12 files changed, 82 insertions(+), 48 deletions(-) create mode 100644 main/src/main/res/drawable/bg_switchbar.xml (limited to 'main') diff --git a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java index f5e55504..b2246b8c 100644 --- a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java +++ b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java @@ -802,6 +802,14 @@ public class VpnProfile implements Serializable { if (!mUseDefaultRoute && (getCustomRoutes(mCustomRoutes) == null || getCustomRoutes(mExcludedRoutes) ==null)) return R.string.custom_route_format_error; + boolean noRemoteEnabled = true; + for (Connection c : mConnections) + if (c.mEnabled) + noRemoteEnabled = false; + + if(noRemoteEnabled) + return R.string.remote_no_server_selected; + // Everything okay return R.string.no_error_found; diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/ConnectionsAdapter.java b/main/src/main/java/de/blinkt/openvpn/fragments/ConnectionsAdapter.java index 9fd7c04f..6d11c7d7 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/ConnectionsAdapter.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/ConnectionsAdapter.java @@ -184,7 +184,7 @@ public class ConnectionsAdapter extends RecyclerView.Adapter + + + + + \ 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 e5228f8a..c4369885 100644 --- a/main/src/main/res/layout/allowed_vpn_apps.xml +++ b/main/src/main/res/layout/allowed_vpn_apps.xml @@ -4,31 +4,39 @@ --> - + android:layout_height="wrap_content" /> - - - - + + + + diff --git a/main/src/main/res/menu/connections.xml b/main/src/main/res/menu/connections.xml index 7446746f..f7da6d54 100644 --- a/main/src/main/res/menu/connections.xml +++ b/main/src/main/res/menu/connections.xml @@ -7,7 +7,7 @@ @color/primary @color/primary_dark @color/accent + @style/BlinktPreferencePanel diff --git a/main/src/main/res/values/colours.xml b/main/src/main/res/values/colours.xml index 7028885a..7e67dacd 100644 --- a/main/src/main/res/values/colours.xml +++ b/main/src/main/res/values/colours.xml @@ -7,7 +7,11 @@ - #3F51B5 - #303F9F - #FFA726 + #3F51B5 + #303F9F + #FFA726 + #5C6BC0 + #ffff00 + #ff0000 + \ No newline at end of file diff --git a/main/src/main/res/values/dimens.xml b/main/src/main/res/values/dimens.xml index d46cfa98..1abe1957 100644 --- a/main/src/main/res/values/dimens.xml +++ b/main/src/main/res/values/dimens.xml @@ -14,6 +14,7 @@ 4dp 16dp 56dp + 16dp \ No newline at end of file diff --git a/main/src/main/res/values/strings.xml b/main/src/main/res/values/strings.xml index 648779fe..371466e3 100755 --- a/main/src/main/res/values/strings.xml +++ b/main/src/main/res/values/strings.xml @@ -329,8 +329,6 @@ Client behaviour Clear allowed external apps Loading… - Allow only these applications to use the VPN. Other apps will use the normal connection. - Do not allow these applications to use the VPN. Other apps will use the VPN connection. Allowed VPN apps: %1$s Disallowed VPN apps: %1$s Package %s is no longer installed, removing it from app allow/disallow list @@ -339,5 +337,8 @@ Remove remote server entry? Keep Delete + Add new remote + Use connection entries in random order on connect + You need to define and enable at least one remote server. diff --git a/main/src/main/res/values/styles.xml b/main/src/main/res/values/styles.xml index 0c295df2..cb503aed 100644 --- a/main/src/main/res/values/styles.xml +++ b/main/src/main/res/values/styles.xml @@ -6,10 +6,15 @@ + + +