| 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.CheckBoxPreference; | |
| 5 import android.util.AttributeSet; | |
| 6 import android.view.View; | |
| 7 import android.widget.TextView; | |
| 8 | |
| 9 /** | |
| 10 * Represents a Checkbox element in a preference menu. | |
| 11 * The title of the Checkbox 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 CheckBoxPreference | |
| 14 * doesn't wrap the title. | |
| 15 */ | |
| 16 | |
| 17 public class MultilineCheckBoxPreference extends CheckBoxPreference | |
| 18 { | |
| 19 public MultilineCheckBoxPreference(Context context) | |
| 20 { | |
| 21 super(context); | |
| 22 } | |
| 23 | |
| 24 public MultilineCheckBoxPreference(Context context, AttributeSet attrs) | |
| 25 { | |
| 26 super(context, attrs); | |
| 27 } | |
| 28 | |
| 29 public MultilineCheckBoxPreference(Context context, AttributeSet attrs, int de fStyle) | |
| 30 { | |
| 31 super(context, attrs, defStyle); | |
| 32 } | |
| 33 | |
| 34 @Override | |
| 35 protected void onBindView(View view) | |
| 36 { | |
| 37 super.onBindView(view); | |
| 38 final TextView title = (TextView) view.findViewById(android.R.id.title); | |
| 39 if (title != null) { | |
| 40 title.setSingleLine(false); | |
| 41 title.setEllipsize(null); | |
| 42 } | |
| 43 } | |
| 44 } | |
| OLD | NEW |