Add brackets for condition - add new line in ProxyConfig

This commit is contained in:
rezanejati 2019-08-07 09:11:55 +04:30
parent c968bfd5cc
commit 2f1ebbbf74
2 changed files with 5 additions and 2 deletions

View File

@ -114,8 +114,9 @@ public class ProxyDialog {
types.add(Proxy.Type.DIRECT.name()); types.add(Proxy.Type.DIRECT.name());
types.add(Proxy.Type.HTTP.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()); types.add(Proxy.Type.SOCKS.name());
}
ArrayAdapter<String> adapter = new ArrayAdapter<>(context, ArrayAdapter<String> adapter = new ArrayAdapter<>(context,
android.R.layout.simple_spinner_item, types); android.R.layout.simple_spinner_item, types);

View File

@ -21,9 +21,11 @@ public class ProxyConfig {
public static ProxyConfig http(String host, int port, String username, String password) { public static ProxyConfig http(String host, int port, String username, String password) {
return new ProxyConfig(Proxy.Type.HTTP, host, port, username, password); return new ProxyConfig(Proxy.Type.HTTP, host, port, username, password);
} }
public static ProxyConfig socks(String host, int port, String username, String password) { public static ProxyConfig socks(String host, int port, String username, String password) {
return new ProxyConfig(Proxy.Type.SOCKS, host, port, username, password); return new ProxyConfig(Proxy.Type.SOCKS, host, port, username, password);
} }
public ProxyConfig(Proxy.Type type, String host, int port, String username, String password) { public ProxyConfig(Proxy.Type type, String host, int port, String username, String password) {
this.type = type; this.type = type;
this.host = host; this.host = host;
@ -31,4 +33,4 @@ public class ProxyConfig {
this.username = username; this.username = username;
this.password = password; this.password = password;
} }
} }