OLD | NEW |
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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 18 matching lines...) Expand all Loading... |
29 import org.adblockplus.adblockplussbrowser.R; | 29 import org.adblockplus.adblockplussbrowser.R; |
30 | 30 |
31 import android.annotation.SuppressLint; | 31 import android.annotation.SuppressLint; |
32 import android.content.Context; | 32 import android.content.Context; |
33 import android.preference.CheckBoxPreference; | 33 import android.preference.CheckBoxPreference; |
34 import android.preference.Preference; | 34 import android.preference.Preference; |
35 import android.preference.PreferenceCategory; | 35 import android.preference.PreferenceCategory; |
36 import android.preference.Preference.OnPreferenceChangeListener; | 36 import android.preference.Preference.OnPreferenceChangeListener; |
37 import android.text.format.DateUtils; | 37 import android.text.format.DateUtils; |
38 import android.util.AttributeSet; | 38 import android.util.AttributeSet; |
39 import android.view.View; | |
40 import android.view.ViewGroup; | |
41 | 39 |
42 @SuppressLint("DefaultLocale") | 40 @SuppressLint("DefaultLocale") |
43 public class ListedSubscriptionsPreferenceCategory extends PreferenceCategory im
plements | 41 public class ListedSubscriptionsPreferenceCategory extends PreferenceCategory im
plements |
44 EngineService.OnEngineCreatedCallback, OnPreferenceChangeListener | 42 EngineService.OnEngineCreatedCallback, OnPreferenceChangeListener |
45 { | 43 { |
46 private Engine engine = null; | 44 private Engine engine = null; |
47 private boolean isEnabledView = false; | 45 private boolean isEnabledView = false; |
48 | 46 |
49 private static final String[] LANGUAGE_TRANSLATIONS = | 47 private static final String[] LANGUAGE_TRANSLATIONS = |
50 { | 48 { |
(...skipping 15 matching lines...) Expand all Loading... |
66 { | 64 { |
67 super(context); | 65 super(context); |
68 } | 66 } |
69 | 67 |
70 public ListedSubscriptionsPreferenceCategory(final Context context, final Attr
ibuteSet attrs) | 68 public ListedSubscriptionsPreferenceCategory(final Context context, final Attr
ibuteSet attrs) |
71 { | 69 { |
72 super(context, attrs); | 70 super(context, attrs); |
73 } | 71 } |
74 | 72 |
75 @Override | 73 @Override |
76 protected View onCreateView(final ViewGroup parent) | |
77 { | |
78 return super.onCreateView(parent); | |
79 } | |
80 | |
81 @Override | |
82 protected void onAttachedToActivity() | 74 protected void onAttachedToActivity() |
83 { | 75 { |
84 EngineService.startService(this.getContext().getApplicationContext(), this); | 76 EngineService.startService(this.getContext().getApplicationContext(), this); |
85 super.onAttachedToActivity(); | 77 super.onAttachedToActivity(); |
86 } | 78 } |
87 | 79 |
88 @Override | 80 @Override |
89 public void onEngineCreated(final Engine engine, final boolean success) | 81 public void onEngineCreated(final Engine engine, final boolean success) |
90 { | 82 { |
91 this.engine = engine; | 83 this.engine = engine; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 public boolean onPreferenceChange(final Preference preference, final Object ne
wValue) | 183 public boolean onPreferenceChange(final Preference preference, final Object ne
wValue) |
192 { | 184 { |
193 final String id = preference.getKey(); | 185 final String id = preference.getKey(); |
194 final boolean enabled = ((Boolean) newValue).booleanValue(); | 186 final boolean enabled = ((Boolean) newValue).booleanValue(); |
195 | 187 |
196 this.engine.changeSubscriptionState(id, enabled); | 188 this.engine.changeSubscriptionState(id, enabled); |
197 | 189 |
198 return true; | 190 return true; |
199 } | 191 } |
200 } | 192 } |
OLD | NEW |