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

Unified Diff: src/org/adblockplus/android/Preferences.java

Issue 9423010: ABP/Android Better icon hide (Closed)
Patch Set: Created Feb. 20, 2013, 12:08 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/org/adblockplus/android/Preferences.java
===================================================================
--- a/src/org/adblockplus/android/Preferences.java
+++ b/src/org/adblockplus/android/Preferences.java
@@ -39,6 +39,7 @@
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.AssetManager;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.preference.CheckBoxPreference;
@@ -349,14 +350,32 @@
break;
case HIDEICONWARNING_DIALOG:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setTitle(R.string.warning).setMessage(R.string.msg_hideicon_warning).setIcon(android.R.drawable.ic_dialog_alert).setCancelable(false)
- .setPositiveButton(R.string.gotit, new DialogInterface.OnClickListener()
+ builder.setTitle(R.string.warning);
+ builder.setIcon(android.R.drawable.ic_dialog_alert);
+ builder.setCancelable(false);
+ StringBuffer message = new StringBuffer();
+ message.append(getString(R.string.msg_hideicon_warning));
+ builder.setPositiveButton(R.string.gotit, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id)
{
dialog.cancel();
}
});
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
+ {
+ message.append("<br/><br/>");
+ message.append(getString(R.string.msg_hideicon_native));
+ builder.setNeutralButton(R.string.showme, new DialogInterface.OnClickListener()
+ {
Thomas Greiner 2013/02/27 16:34:29 mind the indentation level
+ public void onClick(DialogInterface dialog, int id)
+ {
+ AdblockPlus.showAppDetails(getApplicationContext());
+ dialog.cancel();
+ }
+ });
+ }
+ builder.setMessage(Html.fromHtml(message.toString()));
dialog = builder.create();
break;
}

Powered by Google App Engine
This is Rietveld