Dialog for proxy

This commit is contained in:
stom79 2018-01-20 10:20:16 +01:00
parent d695dfc692
commit 35b01b0e53
2 changed files with 16 additions and 1 deletions

View File

@ -82,12 +82,27 @@ public class ProxyActivity extends BaseActivity {
final EditText proxy_login = findViewById(R.id.proxy_login);
final EditText proxy_password = findViewById(R.id.proxy_password);
String hostVal = sharedpreferences.getString(Helper.SET_PROXY_HOST, "127.0.0.1");
int portVal = sharedpreferences.getInt(Helper.SET_PROXY_PORT, 8118);
final String login = sharedpreferences.getString(Helper.SET_PROXY_LOGIN, null);
final String pwd = sharedpreferences.getString(Helper.SET_PROXY_PASSWORD, null);
if( hostVal.length() > 0)
host.setText(hostVal);
port.setText(String.valueOf(portVal));
if( login != null && login.length() > 0)
proxy_login.setText(login);
if( pwd != null && proxy_password.length() > 0)
proxy_password.setText(pwd);
count2 = 0;
final Spinner proxy_type = findViewById(R.id.type);
ArrayAdapter<CharSequence> adapterTrans = ArrayAdapter.createFromResource(ProxyActivity.this,
R.array.proxy_type, android.R.layout.simple_spinner_item);
proxy_type.setAdapter(adapterTrans);
proxy_type.setSelection(sharedpreferences.getInt(Helper.SET_PROXY_TYPE, 0));
proxy_type.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override

View File

@ -8,7 +8,7 @@
android:id="@+id/container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="300dp">
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"