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

Side by Side Diff: adblockplussbrowser/src/main/java/org/adblockplus/sbrowser/contentblocker/preferences/ImprintPreference.java

Issue 29603697: Issue 5931 - Create tests for util package (Closed)
Patch Set: Created Nov. 10, 2017, 2:23 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
(Empty)
1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 package org.adblockplus.sbrowser.contentblocker.preferences;
19
20 import org.adblockplus.adblockplussbrowser.R;
21
22 import android.content.Context;
23 import android.preference.Preference;
24 import android.text.Html;
25 import android.text.method.LinkMovementMethod;
26 import android.util.AttributeSet;
27 import android.view.View;
28 import android.widget.TextView;
29
30 public class ImprintPreference extends Preference
31 {
32 public ImprintPreference(Context context, AttributeSet attrs, int defStyleAttr )
33 {
34 super(context, attrs, defStyleAttr);
35 }
36
37 public ImprintPreference(Context context, AttributeSet attrs)
38 {
39 super(context, attrs);
40 setLayoutResource(R.layout.imprint_screen);
41 setSelectable(false);
42 }
43
44 public ImprintPreference(Context context)
45 {
46 super(context);
47 }
48
49 @Override
50 protected void onBindView(View view)
51 {
52 super.onBindView(view);
53 final TextView tvImprint = (TextView) view.findViewById(R.id.tv_imprint);
54 if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N)
55 {
56 tvImprint.setText(Html.fromHtml(getContext().getString(R.string.imprint_te xt), Html.FROM_HTML_MODE_LEGACY));
57 }
58 else
59 {
60 tvImprint.setText(Html.fromHtml(getContext().getString(R.string.imprint_te xt)));
61 }
62 tvImprint.setMovementMethod(LinkMovementMethod.getInstance());
63 }
64 }
OLDNEW

Powered by Google App Engine
This is Rietveld