|
15 | 15 | limitations under the License. |
16 | 16 | --> |
17 | 17 |
|
| 18 | +<!-- |
| 19 | + This layout file is used by the AlertDialog when displaying a multi select list of items. |
| 20 | +
|
| 21 | + A left android:gravity will handle text alignemnt on API 16 and below while |
| 22 | + android:textAlignemnt will be used on 17+. A start android:gravity is not added |
| 23 | + to avoid text being aligned right while a drawable is aligned left in RTL configurations |
| 24 | + on API 16 and below. |
| 25 | +
|
| 26 | + app:drawableLeftCompat (and app:drawableStartCompat) used instead of android:drawableLeft |
| 27 | + (and android:drawableStart) because of bug on api 17 that aligned drawable both left and |
| 28 | + right when in RTL configurations |
| 29 | +--> |
18 | 30 | <CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android" |
| 31 | + xmlns:app="http://schemas.android.com/apk/res-auto" |
19 | 32 | android:id="@android:id/text1" |
20 | 33 | android:layout_width="match_parent" |
21 | 34 | android:layout_height="wrap_content" |
22 | 35 | android:minHeight="?attr/listPreferredItemHeightSmall" |
23 | | - android:gravity="center_vertical" |
| 36 | + android:gravity="left|center_vertical" |
| 37 | + android:textAlignment="viewStart" |
24 | 38 | android:paddingLeft="@dimen/abc_select_dialog_padding_start_material" |
25 | 39 | android:paddingRight="?attr/dialogPreferredPadding" |
26 | 40 | android:paddingStart="@dimen/abc_select_dialog_padding_start_material" |
27 | 41 | android:paddingEnd="?attr/dialogPreferredPadding" |
28 | | - android:drawableLeft="?android:attr/listChoiceIndicatorMultiple" |
29 | | - android:drawableStart="?android:attr/listChoiceIndicatorMultiple" |
| 42 | + app:drawableLeftCompat="?android:attr/listChoiceIndicatorMultiple" |
| 43 | + app:drawableStartCompat="?android:attr/listChoiceIndicatorMultiple" |
30 | 44 | android:drawablePadding="20dp" |
31 | 45 | android:ellipsize="marquee" /> |
0 commit comments