Left: | ||
Right: |
OLD | NEW |
---|---|
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 27 matching lines...) Expand all Loading... | |
38 import android.content.pm.PackageManager.NameNotFoundException; | 38 import android.content.pm.PackageManager.NameNotFoundException; |
39 import android.content.res.AssetManager; | 39 import android.content.res.AssetManager; |
40 import android.net.Uri; | 40 import android.net.Uri; |
41 import android.os.Build; | 41 import android.os.Build; |
42 import android.os.Bundle; | 42 import android.os.Bundle; |
43 import android.os.IBinder; | 43 import android.os.IBinder; |
44 import android.preference.ListPreference; | 44 import android.preference.ListPreference; |
45 import android.preference.PreferenceManager; | 45 import android.preference.PreferenceManager; |
46 import android.text.Html; | 46 import android.text.Html; |
47 import android.text.format.DateFormat; | 47 import android.text.format.DateFormat; |
48 import android.text.method.LinkMovementMethod; | |
48 import android.util.Log; | 49 import android.util.Log; |
49 import android.view.View; | 50 import android.view.View; |
50 import android.view.ViewGroup; | 51 import android.view.ViewGroup; |
51 import android.widget.TextView; | 52 import android.widget.TextView; |
52 | 53 |
53 import com.actionbarsherlock.view.Menu; | 54 import com.actionbarsherlock.view.Menu; |
54 import com.actionbarsherlock.view.MenuInflater; | 55 import com.actionbarsherlock.view.MenuInflater; |
55 import com.actionbarsherlock.view.MenuItem; | 56 import com.actionbarsherlock.view.MenuItem; |
56 | 57 |
57 /** | 58 /** |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 if (subscriptions.length > 0) | 145 if (subscriptions.length > 0) |
145 { | 146 { |
146 current = subscriptions[0]; | 147 current = subscriptions[0]; |
147 } | 148 } |
148 | 149 |
149 boolean firstRun = firstRunActionsPending && application.isFirstRun(); | 150 boolean firstRun = firstRunActionsPending && application.isFirstRun(); |
150 firstRunActionsPending = false; | 151 firstRunActionsPending = false; |
151 | 152 |
152 if (firstRun && current != null) | 153 if (firstRun && current != null) |
153 { | 154 { |
154 new AlertDialog.Builder(this).setTitle(R.string.app_name) | 155 final String message = String.format(getString(R.string.msg_subscription_o ffer, current.title)) |
155 .setMessage(String.format(getString(R.string.msg_subscription_offer, c urrent.title))) | 156 .replace("<a>", "<a href=\"" + getString(R.string.acceptable_ads_url) + "\">"); |
Wladimir Palant
2013/11/26 09:35:54
This is a security vulnerability, please don't all
Felix Dahlke
2013/11/26 10:25:50
Done. I had a feeling I wouldn't get away with thi
| |
157 final TextView messageView = new TextView(this); | |
158 messageView.setText(Html.fromHtml(message)); | |
159 messageView.setMovementMethod(LinkMovementMethod.getInstance()); | |
160 final int padding = 10; | |
Felix Dahlke
2013/11/26 09:21:52
I'm not a big fan of hard coding style properties,
| |
161 messageView.setPadding(padding, padding, padding, padding); | |
162 new AlertDialog.Builder(this).setTitle(R.string.install_name) | |
163 .setView(messageView) | |
156 .setIcon(android.R.drawable.ic_dialog_info) | 164 .setIcon(android.R.drawable.ic_dialog_info) |
157 .setPositiveButton(R.string.ok, null).create().show(); | 165 .setPositiveButton(R.string.ok, null).create().show(); |
158 } | 166 } |
159 | 167 |
160 // Enable manual subscription refresh | 168 // Enable manual subscription refresh |
161 subscriptionList.setOnRefreshClickListener(new View.OnClickListener() | 169 subscriptionList.setOnRefreshClickListener(new View.OnClickListener() |
162 { | 170 { |
163 @Override | 171 @Override |
164 public void onClick(View v) | 172 public void onClick(View v) |
165 { | 173 { |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
535 showConfigurationMsg(getString(R.string.msg_configuration)); | 543 showConfigurationMsg(getString(R.string.msg_configuration)); |
536 } | 544 } |
537 | 545 |
538 public void onServiceDisconnected(ComponentName className) | 546 public void onServiceDisconnected(ComponentName className) |
539 { | 547 { |
540 proxyService = null; | 548 proxyService = null; |
541 Log.d(TAG, "Proxy service disconnected"); | 549 Log.d(TAG, "Proxy service disconnected"); |
542 } | 550 } |
543 }; | 551 }; |
544 } | 552 } |
OLD | NEW |