| OLD | NEW |
| 1 package org.adblockplus.android; | 1 package org.adblockplus.android; |
| 2 | 2 |
| 3 import android.app.Activity; | 3 import android.app.Activity; |
| 4 import android.content.Intent; | 4 import android.content.Intent; |
| 5 import android.os.Build; |
| 5 import android.os.Bundle; | 6 import android.os.Bundle; |
| 6 import android.provider.Settings; | 7 import android.provider.Settings; |
| 7 import android.text.Html; | 8 import android.text.Html; |
| 8 import android.text.method.LinkMovementMethod; | 9 import android.text.method.LinkMovementMethod; |
| 9 import android.view.View; | 10 import android.view.View; |
| 11 import android.widget.Button; |
| 10 import android.widget.TextView; | 12 import android.widget.TextView; |
| 11 | 13 |
| 12 public class ProxyConfigurationActivity extends Activity | 14 public class ProxyConfigurationActivity extends Activity |
| 13 { | 15 { |
| 14 @Override | 16 @Override |
| 15 public void onCreate(Bundle savedInstanceState) | 17 public void onCreate(Bundle savedInstanceState) |
| 16 { | 18 { |
| 17 super.onCreate(savedInstanceState); | 19 super.onCreate(savedInstanceState); |
| 18 setContentView(R.layout.proxyconfiguration); | 20 setContentView(R.layout.proxyconfiguration); |
| 19 int port = getIntent().getIntExtra("port", 0); | 21 int port = getIntent().getIntExtra("port", 0); |
| 20 | 22 |
| 21 StringBuilder info = new StringBuilder(); | 23 StringBuilder info = new StringBuilder(); |
| 22 AdblockPlus.appendRawTextFile(this, info, R.raw.proxysettings); | 24 int textId = ProxyService.NATIVE_PROXY_SUPPORTED ? R.raw.proxysettings : R.r
aw.proxysettings_old; |
| 25 AdblockPlus.appendRawTextFile(this, info, textId); |
| 23 String msg = String.format(info.toString(), port); | 26 String msg = String.format(info.toString(), port); |
| 24 | 27 |
| 25 TextView tv = (TextView) findViewById(R.id.message_text); | 28 TextView tv = (TextView) findViewById(R.id.message_text); |
| 26 tv.setText(Html.fromHtml(msg)); | 29 tv.setText(Html.fromHtml(msg)); |
| 27 tv.setMovementMethod(LinkMovementMethod.getInstance()); | 30 tv.setMovementMethod(LinkMovementMethod.getInstance()); |
| 28 | 31 |
| 32 Button buttonToHide = (Button) findViewById(ProxyService.NATIVE_PROXY_SUPPOR
TED ? R.id.gotit : R.id.opensettings); |
| 33 buttonToHide.setVisibility(View.GONE); |
| 29 } | 34 } |
| 30 | 35 |
| 31 public void onGotit(View view) | 36 public void onGotit(View view) |
| 32 { | 37 { |
| 33 finish(); | 38 finish(); |
| 34 } | 39 } |
| 35 | 40 |
| 36 public void onSettings(View view) | 41 public void onSettings(View view) |
| 37 { | 42 { |
| 38 startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS)); | 43 startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS)); |
| 39 finish(); | 44 finish(); |
| 40 } | 45 } |
| 41 } | 46 } |
| OLD | NEW |