Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 package org.adblockplus.sbrowser.contentblocker.preferences; | |
diegocarloslima
2017/05/25 18:53:56
Our Copyright header is missing here
jens
2017/05/30 12:17:00
Acknowledged.
| |
2 | |
3 import android.content.Context; | |
4 import android.preference.ListPreference; | |
5 import android.util.AttributeSet; | |
6 import android.view.View; | |
7 import android.widget.TextView; | |
8 | |
9 /** | |
10 * Represents a List in a preference menu. | |
11 * The title of the list items can be larger than the view. | |
12 * In this case, it will be displayed in 2 or more lines. | |
13 * The default behavior of the class ListPreference | |
14 * doesn't wrap the title. | |
15 */ | |
16 | |
17 public class MultilineListPreference extends ListPreference | |
18 { | |
19 public MultilineListPreference(Context context) { | |
20 super(context); | |
21 } | |
22 | |
23 public MultilineListPreference(Context context, AttributeSet attrs) { | |
24 super(context, attrs); | |
25 } | |
26 | |
27 public MultilineListPreference(Context context, AttributeSet attrs, int defSty le) { | |
28 super(context, attrs, defStyle); | |
29 } | |
30 | |
31 @Override | |
32 protected void onBindView(View view) { | |
33 super.onBindView(view); | |
34 final TextView title = (TextView) view.findViewById(android.R.id.title); | |
35 if (title != null) { | |
36 title.setSingleLine(false); | |
37 title.setEllipsize(null); | |
38 } | |
39 } | |
40 } | |
OLD | NEW |