Index: src/org/adblockplus/android/ProxyConfigurationActivity.java |
=================================================================== |
--- a/src/org/adblockplus/android/ProxyConfigurationActivity.java |
+++ b/src/org/adblockplus/android/ProxyConfigurationActivity.java |
@@ -2,11 +2,14 @@ |
import android.app.Activity; |
import android.content.Intent; |
+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
|
+import android.os.Build; |
import android.os.Bundle; |
import android.provider.Settings; |
import android.text.Html; |
import android.text.method.LinkMovementMethod; |
import android.view.View; |
+import android.widget.Button; |
import android.widget.TextView; |
public class ProxyConfigurationActivity extends Activity |
@@ -18,14 +21,19 @@ |
setContentView(R.layout.proxyconfiguration); |
int port = getIntent().getIntExtra("port", 0); |
+ boolean configurationSupported = Build.VERSION.SDK_INT >= Build.VERSION_CODES.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
|
+ |
StringBuilder info = new StringBuilder(); |
- AdblockPlus.appendRawTextFile(this, info, R.raw.proxysettings); |
+ 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
|
+ AdblockPlus.appendRawTextFile(this, info, proxySettingsResource); |
String msg = String.format(info.toString(), port); |
TextView tv = (TextView) findViewById(R.id.message_text); |
tv.setText(Html.fromHtml(msg)); |
tv.setMovementMethod(LinkMovementMethod.getInstance()); |
+ Button buttonToHide = (Button) findViewById(configurationSupported ? R.id.gotit : R.id.opensettings); |
+ buttonToHide.setVisibility(View.GONE); |
} |
public void onGotit(View view) |