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

Delta Between Two Patch Sets: mobile/android/thirdparty/org/adblockplus/browser/MoreSubscriptionsPreferenceGroup.java

Issue 29322610: Issue 2720 - [Adblocking settings] Add the other filter lists category (Closed)
Left Patch Set: Mostly naming Created July 28, 2015, 10:58 a.m.
Right Patch Set: Last naming nit Created July 31, 2015, 9:36 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 19 matching lines...) Expand all
30 import android.content.Context; 30 import android.content.Context;
31 import android.os.Build; 31 import android.os.Build;
32 import android.preference.CheckBoxPreference; 32 import android.preference.CheckBoxPreference;
33 import android.preference.Preference; 33 import android.preference.Preference;
34 import android.preference.PreferenceGroup; 34 import android.preference.PreferenceGroup;
35 import android.util.AttributeSet; 35 import android.util.AttributeSet;
36 import android.util.Log; 36 import android.util.Log;
37 import android.view.View; 37 import android.view.View;
38 import android.view.ViewGroup; 38 import android.view.ViewGroup;
39 39
40 public class MoreSubscriptionsPreferenceGroup extends PreferenceGroup implements 40 public class MoreSubscriptionsPreferenceGroup extends PreferenceGroup implements
Felix Dahlke 2015/07/29 20:32:07 Naming nit again: Seems you're still mostly callin
René Jeschke 2015/07/30 09:26:44 Done.
41 UrlInputDialog.UrlReadyCallback 41 UrlInputDialog.UrlReadyCallback
42 { 42 {
43 private static final String TAG = "AdblockBrowser.OtherPreferenceGroup"; 43 private static final String TAG = "AdblockBrowser.OtherPreferenceGroup";
44 private static final HashMap<String, Integer> BUILTIN_URL_TO_INDEX = new HashM ap<String, Integer>(); 44 private static final HashMap<String, Integer> BUILTIN_URL_TO_INDEX = new HashM ap<String, Integer>();
45 private static final HashSet<String> IGNORED_URLS = new HashSet<String>(); 45 private static final HashSet<String> IGNORED_URLS = new HashSet<String>();
46 private static SubscriptionContainer recommendedSubscriptions = null; 46 private static SubscriptionContainer recommendedSubscriptions = null;
47 47
48 private final CheckBoxChangeListener checkBoxChangeListener = new CheckBoxChan geListener(); 48 private final CheckBoxChangeListener checkBoxChangeListener = new CheckBoxChan geListener();
49 private final ActiveSubscriptionContainer activeSubscriptions = new ActiveSubs criptionContainer(); 49 private final ActiveSubscriptionContainer activeSubscriptions = new ActiveSubs criptionContainer();
50 private ProgressDialog progressDialog; 50 private ProgressDialog progressDialog;
51 51
52 private static final int[] BUILTIN_TITLES = 52 private static final int[] BUILTIN_TITLES =
53 { 53 {
54 R.string.abb_list_disable_tracking, 54 R.string.abb_subscription_disable_tracking,
55 R.string.abb_list_disable_malware, 55 R.string.abb_subscription_disable_malware,
56 R.string.abb_list_disable_anti_adblock, 56 R.string.abb_subscription_disable_anti_adblock,
57 R.string.abb_list_disable_social_media 57 R.string.abb_subscription_disable_social_media
58 }; 58 };
59 59
60 private static final String[] BUILTIN_LISTS = 60 private static final String[] BUILTIN_LISTS =
61 { 61 {
62 "EasyPrivacy", 62 "EasyPrivacy",
63 "https://easylist-downloads.adblockplus.org/easyprivacy.txt", 63 "https://easylist-downloads.adblockplus.org/easyprivacy.txt",
64 "Malware Domains", 64 "Malware Domains",
65 "https://easylist-downloads.adblockplus.org/malwaredomains_full.txt", 65 "https://easylist-downloads.adblockplus.org/malwaredomains_full.txt",
66 "Adblock Warning Removal List", 66 "Adblock Warning Removal List",
67 "https://easylist-downloads.adblockplus.org/antiadblockfilters.txt", 67 "https://easylist-downloads.adblockplus.org/antiadblockfilters.txt",
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 super.onAttachedToActivity(); 138 super.onAttachedToActivity();
139 139
140 this.progressDialog = new ProgressDialog(this.getContext()); 140 this.progressDialog = new ProgressDialog(this.getContext());
141 this.progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 141 this.progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
142 this.progressDialog.setMessage(this.getContext().getString(R.string.abb_adbl ocking_waiting)); 142 this.progressDialog.setMessage(this.getContext().getString(R.string.abb_adbl ocking_waiting));
143 this.progressDialog.show(); 143 this.progressDialog.show();
144 144
145 UrlInputOpenerPreference.setRedirectUrlReadyCallback(this); 145 UrlInputOpenerPreference.setRedirectUrlReadyCallback(this);
146 146
147 AddOnBridge.handlerPost(new Runnable() 147 AddOnBridge.postToHandler(new Runnable()
148 { 148 {
149 @Override 149 @Override
150 public void run() 150 public void run()
151 { 151 {
152 initRecommendedSubscriptions(); 152 initRecommendedSubscriptions();
153 MoreSubscriptionsPreferenceGroup.this.activeSubscriptions.refresh(); 153 MoreSubscriptionsPreferenceGroup.this.activeSubscriptions.refresh();
154 154
155 ThreadUtils.postToUiThread(new Runnable() 155 ThreadUtils.postToUiThread(new Runnable()
156 { 156 {
157 @Override 157 @Override
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 this.progressDialog.dismiss(); 203 this.progressDialog.dismiss();
204 this.progressDialog = null; 204 this.progressDialog = null;
205 } 205 }
206 } 206 }
207 207
208 private void addNewSubscription(final String url) 208 private void addNewSubscription(final String url)
209 { 209 {
210 this.progressDialog = new ProgressDialog(this.getContext()); 210 this.progressDialog = new ProgressDialog(this.getContext());
211 this.progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 211 this.progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
212 this.progressDialog 212 this.progressDialog
213 .setMessage(this.getContext().getString(R.string.abb_add_filter_list_add ing)); 213 .setMessage(this.getContext().getString(R.string.abb_add_subscription_ad ding));
214 this.progressDialog.show(); 214 this.progressDialog.show();
215 215
216 AddOnBridge.handlerPost(new Runnable() 216 AddOnBridge.postToHandler(new Runnable()
217 { 217 {
218 @Override 218 @Override
219 public void run() 219 public void run()
220 { 220 {
221 try 221 try
222 { 222 {
223 final Semaphore finished = new Semaphore(0); 223 final Semaphore finished = new Semaphore(0);
224 224
225 AddOnBridge.addSubscription(new AdblockPlusApiCallback() 225 AddOnBridge.addSubscription(new AdblockPlusApiCallback()
226 { 226 {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 // ignored 348 // ignored
349 } 349 }
350 350
351 @Override 351 @Override
352 public void onApiRequestFailed(String errorMessage) 352 public void onApiRequestFailed(String errorMessage)
353 { 353 {
354 // ignored 354 // ignored
355 } 355 }
356 } 356 }
357 } 357 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld