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

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

Issue 9643003: Improve manual proxy configuration (Closed)
Patch Set: Add guide for Android <= 2.3 devices Created March 12, 2013, 3:45 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.opengl.Visibility;
Andrey Novikov 2013/03/13 07:51:15 What is it doing here?
Felix Dahlke 2013/03/13 08:48:53 WTF, missed that. I wasn't trying to sneak OpenGL
6 import android.os.Build;
5 import android.os.Bundle; 7 import android.os.Bundle;
6 import android.provider.Settings; 8 import android.provider.Settings;
7 import android.text.Html; 9 import android.text.Html;
8 import android.text.method.LinkMovementMethod; 10 import android.text.method.LinkMovementMethod;
9 import android.view.View; 11 import android.view.View;
12 import android.widget.Button;
10 import android.widget.TextView; 13 import android.widget.TextView;
11 14
12 public class ProxyConfigurationActivity extends Activity 15 public class ProxyConfigurationActivity extends Activity
13 { 16 {
14 @Override 17 @Override
15 public void onCreate(Bundle savedInstanceState) 18 public void onCreate(Bundle savedInstanceState)
16 { 19 {
17 super.onCreate(savedInstanceState); 20 super.onCreate(savedInstanceState);
18 setContentView(R.layout.proxyconfiguration); 21 setContentView(R.layout.proxyconfiguration);
19 int port = getIntent().getIntExtra("port", 0); 22 int port = getIntent().getIntExtra("port", 0);
20 23
24 boolean configurationSupported = Build.VERSION.SDK_INT >= Build.VERSION_CODE S.HONEYCOMB_MR1;
Andrey Novikov 2013/03/13 07:51:15 We have a static application-wide flag for this: P
Felix Dahlke 2013/03/13 08:48:53 Right, I remember lobbying for that, but couldn't
25
21 StringBuilder info = new StringBuilder(); 26 StringBuilder info = new StringBuilder();
22 AdblockPlus.appendRawTextFile(this, info, R.raw.proxysettings); 27 int proxySettingsResource = configurationSupported ? R.raw.proxysettings : R .raw.proxysettings_old;
Andrey Novikov 2013/03/13 07:51:15 I would rename it to 'proxySettingsLayout' :) (In
Felix Dahlke 2013/03/13 08:48:53 Yeah, not a great name... Went with textId, seems
28 AdblockPlus.appendRawTextFile(this, info, proxySettingsResource);
23 String msg = String.format(info.toString(), port); 29 String msg = String.format(info.toString(), port);
24 30
25 TextView tv = (TextView) findViewById(R.id.message_text); 31 TextView tv = (TextView) findViewById(R.id.message_text);
26 tv.setText(Html.fromHtml(msg)); 32 tv.setText(Html.fromHtml(msg));
27 tv.setMovementMethod(LinkMovementMethod.getInstance()); 33 tv.setMovementMethod(LinkMovementMethod.getInstance());
28 34
35 Button buttonToHide = (Button) findViewById(configurationSupported ? R.id.go tit : R.id.opensettings);
36 buttonToHide.setVisibility(View.GONE);
29 } 37 }
30 38
31 public void onGotit(View view) 39 public void onGotit(View view)
32 { 40 {
33 finish(); 41 finish();
34 } 42 }
35 43
36 public void onSettings(View view) 44 public void onSettings(View view)
37 { 45 {
38 startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS)); 46 startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
39 finish(); 47 finish();
40 } 48 }
41 } 49 }
OLDNEW
« res/raw/proxysettings_old.txt ('K') | « src/org/adblockplus/android/Preferences.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld