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

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

Issue 6342870919282688: Don't hard code the Acceptable Ads help URL (Closed)
Patch Set: Created Nov. 28, 2013, 2:21 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 copyAssets(); 97 copyAssets();
98 SharedPreferences.Editor editor = prefs.edit(); 98 SharedPreferences.Editor editor = prefs.edit();
99 editor.putInt(getString(R.string.pref_version), thisVersion); 99 editor.putInt(getString(R.string.pref_version), thisVersion);
100 editor.commit(); 100 editor.commit();
101 } 101 }
102 } 102 }
103 catch (NameNotFoundException e) 103 catch (NameNotFoundException e)
104 { 104 {
105 copyAssets(); 105 copyAssets();
106 } 106 }
107
108 // Set Acceptable Ads FAQ link
109 HelpfulCheckBoxPreference acceptableAdsCheckBox = (HelpfulCheckBoxPreference ) findPreference(getString(R.string.pref_acceptableads));
110 // TODO Set proper url
111 acceptableAdsCheckBox.setHelpUrl("https://adblockplus.org/en/acceptable-ads" );
112 } 107 }
113 108
114 @Override 109 @Override
115 protected void onStart() 110 protected void onStart()
116 { 111 {
117 super.onStart(); 112 super.onStart();
118 AdblockPlus application = AdblockPlus.getApplication(); 113 AdblockPlus application = AdblockPlus.getApplication();
119 application.startEngine(); 114 application.startEngine();
120 115
121 // Initialize subscription list 116 // Initialize subscription list
122 subscriptionList = (RefreshableListPreference) findPreference(getString(R.st ring.pref_subscription)); 117 subscriptionList = (RefreshableListPreference) findPreference(getString(R.st ring.pref_subscription));
123 Subscription[] subscriptions = application.getRecommendedSubscriptions(); 118 Subscription[] subscriptions = application.getRecommendedSubscriptions();
124 String[] entries = new String[subscriptions.length]; 119 String[] entries = new String[subscriptions.length];
125 String[] entryValues = new String[subscriptions.length]; 120 String[] entryValues = new String[subscriptions.length];
126 int i = 0; 121 int i = 0;
127 for (Subscription subscription : subscriptions) 122 for (Subscription subscription : subscriptions)
128 { 123 {
129 entries[i] = subscription.title; 124 entries[i] = subscription.title;
130 entryValues[i] = subscription.url; 125 entryValues[i] = subscription.url;
131 i++; 126 i++;
132 } 127 }
133 subscriptionList.setEntries(entries); 128 subscriptionList.setEntries(entries);
134 subscriptionList.setEntryValues(entryValues); 129 subscriptionList.setEntryValues(entryValues);
130
131 // Set Acceptable Ads FAQ link
132 HelpfulCheckBoxPreference acceptableAdsCheckBox =
133 (HelpfulCheckBoxPreference) findPreference(getString(R.string.pref_accep tableads));
134 acceptableAdsCheckBox.setHelpUrl(AdblockPlus.getApplication().getAcceptableA dsUrl());
135 } 135 }
136 136
137 @Override 137 @Override
138 public void onResume() 138 public void onResume()
139 { 139 {
140 super.onResume(); 140 super.onResume();
141 SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this ); 141 SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this );
142 142
143 final AdblockPlus application = AdblockPlus.getApplication(); 143 final AdblockPlus application = AdblockPlus.getApplication();
144 144
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 showConfigurationMsg(getString(R.string.msg_configuration)); 571 showConfigurationMsg(getString(R.string.msg_configuration));
572 } 572 }
573 573
574 public void onServiceDisconnected(ComponentName className) 574 public void onServiceDisconnected(ComponentName className)
575 { 575 {
576 proxyService = null; 576 proxyService = null;
577 Log.d(TAG, "Proxy service disconnected"); 577 Log.d(TAG, "Proxy service disconnected");
578 } 578 }
579 }; 579 };
580 } 580 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld