OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2016 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.sbrowser.contentblocker.util.PreferenceUtils; |
| 21 |
| 22 import android.content.Context; |
| 23 import android.preference.ListPreference; |
| 24 import android.util.AttributeSet; |
| 25 import android.view.View; |
| 26 |
| 27 /** |
| 28 * Represents a List in a preference menu. |
| 29 * The title of the list items can be larger than the view. |
| 30 * In this case, it will be displayed in 2 or more lines. |
| 31 * The default behavior of the class ListPreference |
| 32 * doesn't wrap the title. |
| 33 */ |
| 34 |
| 35 public class MultilineListPreference extends ListPreference |
| 36 { |
| 37 public MultilineListPreference(Context context) { |
| 38 super(context); |
| 39 } |
| 40 |
| 41 public MultilineListPreference(Context context, AttributeSet attrs) { |
| 42 super(context, attrs); |
| 43 } |
| 44 |
| 45 public MultilineListPreference(Context context, AttributeSet attrs, int defSty
le) { |
| 46 super(context, attrs, defStyle); |
| 47 } |
| 48 |
| 49 @Override |
| 50 protected void onBindView(View view) { |
| 51 super.onBindView(view); |
| 52 PreferenceUtils.setMultilineTitle(view); |
| 53 } |
| 54 } |
OLD | NEW |