Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/org/adblockplus/android/ProxyConfigurationActivity.java

Issue 5697499218051072: Usage of new API, cleanups (reduced) (Closed)
Patch Set: Fixed leftover first-batch review issues. Created April 16, 2014, 5:51 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
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.Bundle; 5 import android.os.Bundle;
6 import android.provider.Settings; 6 import android.provider.Settings;
7 import android.text.Html; 7 import android.text.Html;
8 import android.text.method.LinkMovementMethod; 8 import android.text.method.LinkMovementMethod;
9 import android.view.View; 9 import android.view.View;
10 import android.widget.Button; 10 import android.widget.Button;
11 import android.widget.TextView; 11 import android.widget.TextView;
12 12
13 public class ProxyConfigurationActivity extends Activity 13 public class ProxyConfigurationActivity extends Activity
14 { 14 {
15 @Override 15 @Override
16 public void onCreate(Bundle savedInstanceState) 16 public void onCreate(final Bundle savedInstanceState)
17 { 17 {
18 super.onCreate(savedInstanceState); 18 super.onCreate(savedInstanceState);
19 setContentView(R.layout.proxyconfiguration); 19 setContentView(R.layout.proxyconfiguration);
20 int port = getIntent().getIntExtra("port", 0); 20 final int port = getIntent().getIntExtra("port", 0);
21 21
22 StringBuilder info = new StringBuilder(); 22 final StringBuilder info = new StringBuilder();
23 int textId = ProxyService.NATIVE_PROXY_SUPPORTED ? R.raw.proxysettings : R.r aw.proxysettings_old; 23 final int textId = ProxyService.NATIVE_PROXY_SUPPORTED ? R.raw.proxysettings : R.raw.proxysettings_old;
24 AdblockPlus.appendRawTextFile(this, info, textId); 24 AdblockPlus.appendRawTextFile(this, info, textId);
25 String msg = String.format(info.toString(), port); 25 final String msg = String.format(info.toString(), port);
26 26
27 TextView tv = (TextView) findViewById(R.id.message_text); 27 final TextView tv = (TextView) findViewById(R.id.message_text);
28 tv.setText(Html.fromHtml(msg)); 28 tv.setText(Html.fromHtml(msg));
29 tv.setMovementMethod(LinkMovementMethod.getInstance()); 29 tv.setMovementMethod(LinkMovementMethod.getInstance());
30 30
31 Button buttonToHide = (Button) findViewById(ProxyService.NATIVE_PROXY_SUPPOR TED ? R.id.gotit : R.id.opensettings); 31 final Button buttonToHide = (Button) findViewById(ProxyService.NATIVE_PROXY_ SUPPORTED ? R.id.gotit : R.id.opensettings);
32 buttonToHide.setVisibility(View.GONE); 32 buttonToHide.setVisibility(View.GONE);
33 } 33 }
34 34
35 public void onGotit(View view) 35 public void onGotit(final View view)
36 { 36 {
37 finish(); 37 finish();
38 } 38 }
39 39
40 public void onSettings(View view) 40 public void onSettings(final View view)
41 { 41 {
42 startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS)); 42 startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
43 finish(); 43 finish();
44 } 44 }
45 } 45 }
OLDNEW
« no previous file with comments | « src/org/adblockplus/android/Preferences.java ('k') | src/org/adblockplus/android/ProxyService.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld