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        <LinearLayout
71            android:id="@+id/card_preference_buttons"
72            android:layout_width="match_parent"
73            android:layout_height="wrap_content"
74            android:layout_marginTop="10dp"
75            android:layout_below="@android:id/summary"
76            android:gravity="center_vertical|end"
77            android:orientation="horizontal"
78            android:paddingEnd="20dp"
79            android:visibility="gone">
80            <Button
81                android:id="@android:id/button1"
82                style="@style/CardPreferencePrimaryButton"
83                android:layout_height="wrap_content"
84                android:layout_width="wrap_content"
85                android:layout_marginStart="20dp"
86                android:visibility="gone"/>
87            <Button
88                android:id="@android:id/button2"
89                style="@style/CardPreferenceBorderlessButton"
90                android:layout_height="wrap_content"
91                android:layout_width="wrap_content"
92                android:layout_marginStart="20dp"
93                android:visibility="gone"/>
94        </LinearLayout>
95    </RelativeLayout>
96
97    <!-- Preference should place its actual preference widget here. -->
98    <LinearLayout
99        android:id="@android:id/widget_frame"
100        android:layout_width="wrap_content"
101        android:layout_height="match_parent"
102        android:gravity="end|center_vertical"
103        android:paddingLeft="16dp"
104        android:paddingStart="16dp"
105        android:paddingRight="0dp"
106        android:paddingEnd="0dp"
107        android:orientation="vertical"/>
108
109</LinearLayout>
110