1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 Copyright (C) 2022 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<LinearLayout 19 xmlns:android="http://schemas.android.com/apk/res/android" 20 android:layout_width="match_parent" 21 android:layout_height="wrap_content" 22 android:minHeight="?android:attr/listPreferredItemHeightSmall" 23 android:gravity="center_vertical" 24 android:paddingStart="20dp" 25 android:paddingEnd="8dp" 26 android:background="?android:attr/selectableItemBackground" 27 android:clipToPadding="false" 28 android:baselineAligned="false"> 29 30 <RelativeLayout 31 android:layout_width="0dp" 32 android:layout_height="wrap_content" 33 android:layout_weight="1" 34 android:paddingTop="16dp" 35 android:paddingBottom="16dp"> 36 37 <LinearLayout 38 android:id="@+id/card_preference_parent" 39 android:layout_width="wrap_content" 40 android:layout_height="wrap_content" 41 android:layout_alignTop="@android:id/title" 42 android:layout_alignBottom="@android:id/summary" 43 android:gravity="center_vertical"> 44 45 <include layout="@layout/card_preference_icon_frame"/> 46 </LinearLayout> 47 48 <TextView 49 android:id="@android:id/title" 50 android:layout_width="wrap_content" 51 android:layout_height="wrap_content" 52 android:layout_toEndOf="@+id/card_preference_parent" 53 android:maxLines="2" 54 android:textAppearance="?android:attr/textAppearanceListItem" 55 android:ellipsize="marquee"/> 56 57 <TextView 58 android:id="@android:id/summary" 59 android:layout_width="wrap_content" 60 android:layout_height="wrap_content" 61 android:layout_below="@android:id/title" 62 android:layout_alignLeft="@android:id/title" 63 android:layout_alignStart="@android:id/title" 64 android:layout_gravity="start" 65 android:textAlignment="viewStart" 66 android:textColor="?android:attr/textColorSecondary" 67 android:maxLines="10" 68 style="@style/PreferenceSummaryTextStyle"/> 69 70 <RelativeLayout 71 android:id="@+id/card_preference_buttons" 72 android:layout_width="match_parent" 73 android:layout_height="wrap_content" 74 android:layout_marginTop="24dp" 75 android:layout_below="@android:id/summary" 76 android:visibility="gone"> 77 <Button 78 android:id="@android:id/button1" 79 style="@style/CardPreferencePrimaryButton" 80 android:layout_height="wrap_content" 81 android:layout_width="wrap_content" 82 android:layout_marginStart="20dp" 83 android:layout_toStartOf="@android:id/button2" 84 android:visibility="gone"/> 85 <Button 86 android:id="@android:id/button2" 87 style="@style/CardPreferenceBorderlessButton" 88 android:layout_height="wrap_content" 89 android:layout_width="wrap_content" 90 android:layout_marginHorizontal="20dp" 91 android:layout_alignParentEnd="true" 92 android:visibility="gone"/> 93 </RelativeLayout> 94 </RelativeLayout> 95 96 <!-- Preference should place its actual preference widget here. --> 97 <LinearLayout 98 android:id="@android:id/widget_frame" 99 android:layout_width="wrap_content" 100 android:layout_height="match_parent" 101 android:gravity="end|center_vertical" 102 android:paddingLeft="16dp" 103 android:paddingStart="16dp" 104 android:paddingRight="0dp" 105 android:paddingEnd="0dp" 106 android:orientation="vertical"/> 107 108</LinearLayout>