1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-11-24 21:32:07 +01:00

Proxy http update

This commit is contained in:
Gregor Santner 2016-10-22 19:54:10 +02:00
parent ca29333806
commit 5f815dae70

View file

@ -85,20 +85,20 @@ public class SettingsFragment__Proxy extends ThemedSettingsFragment {
protected void applyColorToViews() { protected void applyColorToViews() {
ThemeHelper.updateTitleColor(titleProxy); ThemeHelper.updateTitleColor(titleProxy);
ThemeHelper.updateCheckBoxColor(checkboxProxyActivated); ThemeHelper.updateCheckBoxColor(checkboxProxyActivated);
optionProxyHost.setVisibility(getAppSettings().isProxyEnabled() ? View.VISIBLE : View.GONE); optionProxyHost.setVisibility(getAppSettings().isProxyHttpEnabled() ? View.VISIBLE : View.GONE);
optionProxyPort.setVisibility(getAppSettings().isProxyEnabled() ? View.VISIBLE : View.GONE); optionProxyPort.setVisibility(getAppSettings().isProxyHttpEnabled() ? View.VISIBLE : View.GONE);
optionProxyOrbotPreset.setVisibility(getAppSettings().isProxyEnabled() ? View.VISIBLE : View.GONE); optionProxyOrbotPreset.setVisibility(getAppSettings().isProxyHttpEnabled() ? View.VISIBLE : View.GONE);
} }
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
@Override @Override
protected void applySettingsToViews() { protected void applySettingsToViews() {
checkboxProxyActivated.setChecked(getAppSettings().isProxyEnabled()); checkboxProxyActivated.setChecked(getAppSettings().isProxyHttpEnabled());
optionProxyHost.setEnabled(getAppSettings().isProxyEnabled()); optionProxyHost.setEnabled(getAppSettings().isProxyHttpEnabled());
hintProxyHost.setText(getAppSettings().getProxyHost()); hintProxyHost.setText(getAppSettings().getProxyHttpHost());
optionProxyPort.setEnabled(getAppSettings().isProxyEnabled()); optionProxyPort.setEnabled(getAppSettings().isProxyHttpEnabled());
hintProxyPort.setText(""+getAppSettings().getProxyPort()); hintProxyPort.setText(""+getAppSettings().getProxyHttpPort());
optionProxyOrbotPreset.setEnabled(getAppSettings().isProxyEnabled()); optionProxyOrbotPreset.setEnabled(getAppSettings().isProxyHttpEnabled());
} }
@Override @Override
@ -116,15 +116,15 @@ public class SettingsFragment__Proxy extends ThemedSettingsFragment {
switch (view.getId()) { switch (view.getId()) {
case R.id.settings_activity__proxy_activated: case R.id.settings_activity__proxy_activated:
case R.id.settings_activity__proxy_activated_checkbox: case R.id.settings_activity__proxy_activated_checkbox:
boolean proxyEnabled = !getAppSettings().isProxyEnabled(); boolean proxyEnabled = !getAppSettings().isProxyHttpEnabled();
checkboxProxyActivated.setChecked(proxyEnabled); checkboxProxyActivated.setChecked(proxyEnabled);
getAppSettings().setProxyEnabled(proxyEnabled); getAppSettings().setProxyHttpEnabled(proxyEnabled);
optionProxyHost.setEnabled(proxyEnabled); optionProxyHost.setEnabled(proxyEnabled);
optionProxyPort.setEnabled(proxyEnabled); optionProxyPort.setEnabled(proxyEnabled);
optionProxyOrbotPreset.setEnabled(proxyEnabled); optionProxyOrbotPreset.setEnabled(proxyEnabled);
optionProxyHost.setVisibility(getAppSettings().isProxyEnabled() ? View.VISIBLE : View.GONE); optionProxyHost.setVisibility(getAppSettings().isProxyHttpEnabled() ? View.VISIBLE : View.GONE);
optionProxyPort.setVisibility(getAppSettings().isProxyEnabled() ? View.VISIBLE : View.GONE); optionProxyPort.setVisibility(getAppSettings().isProxyHttpEnabled() ? View.VISIBLE : View.GONE);
optionProxyOrbotPreset.setVisibility(getAppSettings().isProxyEnabled() ? View.VISIBLE : View.GONE); optionProxyOrbotPreset.setVisibility(getAppSettings().isProxyHttpEnabled() ? View.VISIBLE : View.GONE);
break; break;
case R.id.settings_activity__proxy_host: case R.id.settings_activity__proxy_host:
showProxyHostDialog(); showProxyHostDialog();
@ -162,7 +162,7 @@ public class SettingsFragment__Proxy extends ThemedSettingsFragment {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
final EditText input = (EditText) getLayoutInflater(null).inflate(R.layout.settings_activity__dialog_proxy, null, false); final EditText input = (EditText) getLayoutInflater(null).inflate(R.layout.settings_activity__dialog_proxy, null, false);
input.setInputType(InputType.TYPE_CLASS_TEXT); input.setInputType(InputType.TYPE_CLASS_TEXT);
input.setText(getAppSettings().getProxyHost()); input.setText(getAppSettings().getProxyHttpHost());
ThemeHelper.updateEditTextColor(input); ThemeHelper.updateEditTextColor(input);
builder.setTitle(R.string.pref_title__http_proxy_host) builder.setTitle(R.string.pref_title__http_proxy_host)
.setView(input).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { .setView(input).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@ -179,7 +179,7 @@ public class SettingsFragment__Proxy extends ThemedSettingsFragment {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
final EditText input = (EditText) getLayoutInflater(null).inflate(R.layout.settings_activity__dialog_proxy, null, false); final EditText input = (EditText) getLayoutInflater(null).inflate(R.layout.settings_activity__dialog_proxy, null, false);
input.setInputType(InputType.TYPE_CLASS_NUMBER); input.setInputType(InputType.TYPE_CLASS_NUMBER);
input.setText(""+getAppSettings().getProxyPort()); input.setText(""+getAppSettings().getProxyHttpPort());
ThemeHelper.updateEditTextColor(input); ThemeHelper.updateEditTextColor(input);
builder.setTitle(R.string.pref_title__http_proxy_port) builder.setTitle(R.string.pref_title__http_proxy_port)
.setView(input).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { .setView(input).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {