1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  ~ Copyright (C) 2021 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<com.android.car.ui.uxr.DrawableStateRelativeLayout
19    xmlns:android="http://schemas.android.com/apk/res/android"
20    android:layout_width="match_parent"
21    android:layout_height="wrap_content"
22    android:background="@drawable/top_level_preference_background"
23    android:clipToPadding="false"
24    android:minHeight="@dimen/top_level_preference_min_height"
25    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
26    android:tag="carUiPreference"
27    android:paddingStart="?android:attr/listPreferredItemPaddingStart">
28
29    <com.android.car.ui.uxr.DrawableStateImageView
30        android:id="@android:id/icon"
31        android:layout_width="@dimen/car_ui_preference_icon_size"
32        android:layout_height="@dimen/car_ui_preference_icon_size"
33        android:layout_alignParentStart="true"
34        android:layout_centerVertical="true"
35        android:layout_marginBottom="@dimen/car_ui_preference_content_margin_bottom"
36        android:layout_marginEnd="@dimen/car_ui_preference_icon_margin_end"
37        android:layout_marginTop="@dimen/car_ui_preference_content_margin_top"
38        android:scaleType="fitCenter"
39        style="@style/Preference.CarUi.Icon"/>
40
41    <LinearLayout
42        android:layout_width="match_parent"
43        android:layout_height="wrap_content"
44        android:layout_centerVertical="true"
45        android:layout_marginBottom="@dimen/car_ui_preference_content_margin_bottom"
46        android:layout_marginTop="@dimen/car_ui_preference_content_margin_top"
47        android:layout_toEndOf="@android:id/icon"
48        android:layout_toStartOf="@android:id/widget_frame"
49        android:orientation="vertical">
50
51        <com.android.car.ui.uxr.DrawableStateTextView
52            android:id="@android:id/title"
53            android:layout_width="wrap_content"
54            android:layout_height="wrap_content"
55            android:layout_marginHorizontal="@dimen/top_level_preference_title_margin_horizontal"
56            android:singleLine="true"
57            android:textAppearance="@style/TextAppearance.CarUi.PreferenceTitle"/>
58
59        <com.android.car.ui.uxr.DrawableStateTextView
60            android:id="@android:id/summary"
61            android:layout_width="wrap_content"
62            android:layout_height="wrap_content"
63            android:textAppearance="@style/TextAppearance.CarUi.PreferenceSummary"/>
64
65    </LinearLayout>
66
67    <!-- Preference should place its actual preference widget here. -->
68    <FrameLayout
69        android:id="@android:id/widget_frame"
70        android:layout_width="wrap_content"
71        android:layout_height="wrap_content"
72        android:layout_alignParentEnd="true"
73        android:layout_centerVertical="true"/>
74
75</com.android.car.ui.uxr.DrawableStateRelativeLayout>
76