From c47ceb7f73372f7ce9d605383a32e5b8ec9fe85b Mon Sep 17 00:00:00 2001 From: rezanejati Date: Sun, 11 Aug 2019 09:11:11 +0430 Subject: Improve code style --- app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'app/src/main/java/de/danoeh/antennapod/dialog') 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 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 adapter = new ArrayAdapter<>(context, android.R.layout.simple_spinner_item, types); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); -- cgit v1.2.3