diff options
author | rezanejati <dev.njti@gmail.com> | 2019-08-11 09:11:11 +0430 |
---|---|---|
committer | rezanejati <dev.njti@gmail.com> | 2019-08-11 09:11:11 +0430 |
commit | c47ceb7f73372f7ce9d605383a32e5b8ec9fe85b (patch) | |
tree | de9301695c8c4f6561b9a8c1def64af2208c625c /app/src/main/java/de | |
parent | 2f1ebbbf7487a98d35c8173186af9a667be811a3 (diff) | |
download | AntennaPod-c47ceb7f73372f7ce9d605383a32e5b8ec9fe85b.zip |
Improve code style
Diffstat (limited to 'app/src/main/java/de')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java index 1fac5c193..c1008a380 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java @@ -95,10 +95,11 @@ public class ProxyDialog { if(!TextUtils.isEmpty(port)) { portValue = Integer.valueOf(port); } - if (Proxy.Type.valueOf(type) == Proxy.Type.SOCKS) + if (Proxy.Type.valueOf(type) == Proxy.Type.SOCKS) { proxy = ProxyConfig.socks(host, portValue, username, password); - else + } else { proxy = ProxyConfig.http(host, portValue, username, password); + } } UserPreferences.setProxyConfig(proxy); AntennapodHttpClient.reinit(); @@ -113,11 +114,9 @@ public class ProxyDialog { List<String> types= new ArrayList<>(); types.add(Proxy.Type.DIRECT.name()); types.add(Proxy.Type.HTTP.name()); - - if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){ + if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { types.add(Proxy.Type.SOCKS.name()); } - ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_spinner_item, types); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); |