Malcolm Chen | 6579b8b | 2017-06-01 16:35:43 -0700 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <!-- |
| 3 | Copyright (C) 2017 The Android Open Source Project |
| 4 | |
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | you may not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, software |
| 12 | distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | --> |
| 17 | |
| 18 | <!-- Based off frameworks/base/core/res/res/layout/preference_category_material.xml |
| 19 | except that this supports icon --> |
| 20 | <FrameLayout |
| 21 | xmlns:android="http://schemas.android.com/apk/res/android" |
| 22 | android:layout_width="match_parent" |
| 23 | android:layout_height="wrap_content" |
| 24 | android:layout_marginTop="8dp" |
| 25 | android:layout_marginBottom="8dp" |
| 26 | android:paddingStart="?android:attr/listPreferredItemPaddingStart" > |
| 27 | |
| 28 | <LinearLayout |
| 29 | android:id="@+id/icon_container" |
| 30 | android:layout_width="wrap_content" |
| 31 | android:layout_height="wrap_content" |
| 32 | android:gravity="start|center_vertical" |
| 33 | android:orientation="horizontal"> |
| 34 | <com.android.internal.widget.PreferenceImageView |
| 35 | android:id="@android:id/icon" |
| 36 | android:layout_width="wrap_content" |
| 37 | android:layout_height="wrap_content" |
| 38 | android:tint="?android:attr/textColorPrimary" |
| 39 | android:maxWidth="18dp" |
| 40 | android:maxHeight="18dp"/> |
| 41 | </LinearLayout> |
| 42 | |
| 43 | <LinearLayout |
| 44 | android:layout_width="match_parent" |
| 45 | android:layout_height="wrap_content" |
| 46 | android:paddingStart="56dp" |
| 47 | android:orientation="vertical"> |
| 48 | <TextView |
| 49 | android:id="@android:id/title" |
| 50 | android:layout_marginTop="16dp" |
| 51 | android:layout_width="match_parent" |
| 52 | android:layout_height="wrap_content" |
| 53 | android:textAppearance="@android:style/TextAppearance.Material.Body2" |
| 54 | android:textColor="?android:attr/colorAccent" |
| 55 | android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"/> |
| 56 | <TextView |
| 57 | android:id="@android:id/summary" |
| 58 | android:layout_width="wrap_content" |
| 59 | android:layout_height="wrap_content" |
| 60 | android:textAppearance="?android:attr/textAppearanceListItemSecondary" |
| 61 | android:textColor="?android:attr/textColorSecondary" |
| 62 | android:ellipsize="end" |
| 63 | android:singleLine="true" /> |
| 64 | </LinearLayout> |
| 65 | |
| 66 | </FrameLayout> |