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

Side by Side 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.
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 /* 1 /*
2 * This file is part of the Adblock Plus, 2 * This file is part of the Adblock Plus,
3 * Copyright (C) 2006-2012 Eyeo GmbH 3 * Copyright (C) 2006-2012 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 21 matching lines...) Expand all
32 import android.content.ComponentName; 32 import android.content.ComponentName;
33 import android.content.Context; 33 import android.content.Context;
34 import android.content.DialogInterface; 34 import android.content.DialogInterface;
35 import android.content.Intent; 35 import android.content.Intent;
36 import android.content.IntentFilter; 36 import android.content.IntentFilter;
37 import android.content.ServiceConnection; 37 import android.content.ServiceConnection;
38 import android.content.SharedPreferences; 38 import android.content.SharedPreferences;
39 import android.content.pm.PackageManager.NameNotFoundException; 39 import android.content.pm.PackageManager.NameNotFoundException;
40 import android.content.res.AssetManager; 40 import android.content.res.AssetManager;
41 import android.net.Uri; 41 import android.net.Uri;
42 import android.os.Build;
42 import android.os.Bundle; 43 import android.os.Bundle;
43 import android.os.IBinder; 44 import android.os.IBinder;
44 import android.preference.CheckBoxPreference; 45 import android.preference.CheckBoxPreference;
45 import android.preference.ListPreference; 46 import android.preference.ListPreference;
46 import android.preference.PreferenceManager; 47 import android.preference.PreferenceManager;
47 import android.text.Html; 48 import android.text.Html;
48 import android.text.format.DateFormat; 49 import android.text.format.DateFormat;
49 import android.util.Log; 50 import android.util.Log;
50 import android.view.View; 51 import android.view.View;
51 import android.view.ViewGroup; 52 import android.view.ViewGroup;
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 protected Dialog onCreateDialog(int id) 343 protected Dialog onCreateDialog(int id)
343 { 344 {
344 Dialog dialog = null; 345 Dialog dialog = null;
345 switch (id) 346 switch (id)
346 { 347 {
347 case ABOUT_DIALOG: 348 case ABOUT_DIALOG:
348 dialog = new AboutDialog(this); 349 dialog = new AboutDialog(this);
349 break; 350 break;
350 case HIDEICONWARNING_DIALOG: 351 case HIDEICONWARNING_DIALOG:
351 AlertDialog.Builder builder = new AlertDialog.Builder(this); 352 AlertDialog.Builder builder = new AlertDialog.Builder(this);
352 builder.setTitle(R.string.warning).setMessage(R.string.msg_hideicon_warn ing).setIcon(android.R.drawable.ic_dialog_alert).setCancelable(false) 353 builder.setTitle(R.string.warning);
353 .setPositiveButton(R.string.gotit, new DialogInterface.OnClickListen er() 354 builder.setIcon(android.R.drawable.ic_dialog_alert);
355 builder.setCancelable(false);
356 StringBuffer message = new StringBuffer();
357 message.append(getString(R.string.msg_hideicon_warning));
358 builder.setPositiveButton(R.string.gotit, new DialogInterface.OnClickLis tener()
354 { 359 {
355 public void onClick(DialogInterface dialog, int id) 360 public void onClick(DialogInterface dialog, int id)
356 { 361 {
357 dialog.cancel(); 362 dialog.cancel();
358 } 363 }
359 }); 364 });
365 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
366 {
367 message.append("<br/><br/>");
368 message.append(getString(R.string.msg_hideicon_native));
369 builder.setNeutralButton(R.string.showme, new DialogInterface.OnClick Listener()
370 {
Thomas Greiner 2013/02/27 16:34:29 mind the indentation level
371 public void onClick(DialogInterface dialog, int id)
372 {
373 AdblockPlus.showAppDetails(getApplicationContext());
374 dialog.cancel();
375 }
376 });
377 }
378 builder.setMessage(Html.fromHtml(message.toString()));
360 dialog = builder.create(); 379 dialog = builder.create();
361 break; 380 break;
362 } 381 }
363 return dialog; 382 return dialog;
364 } 383 }
365 384
366 @Override 385 @Override
367 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Str ing key) 386 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Str ing key)
368 { 387 {
369 if (getString(R.string.pref_enabled).equals(key)) 388 if (getString(R.string.pref_enabled).equals(key))
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 showConfigurationMsg(getString(R.string.msg_configuration, proxyService. port)); 542 showConfigurationMsg(getString(R.string.msg_configuration, proxyService. port));
524 } 543 }
525 544
526 public void onServiceDisconnected(ComponentName className) 545 public void onServiceDisconnected(ComponentName className)
527 { 546 {
528 proxyService = null; 547 proxyService = null;
529 Log.d(TAG, "Proxy service disconnected"); 548 Log.d(TAG, "Proxy service disconnected");
530 } 549 }
531 }; 550 };
532 } 551 }
OLDNEW

Powered by Google App Engine
This is Rietveld