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<androidx.constraintlayout.widget.ConstraintLayout
19    xmlns:android="http://schemas.android.com/apk/res/android"
20    xmlns:app="http://schemas.android.com/apk/res-auto"
21    android:layout_width="match_parent"
22    android:layout_height="wrap_content"
23    android:minHeight="?android:attr/listPreferredItemHeightSmall"
24    android:tag="carUiPreference">
25
26    <com.android.car.ui.uxr.DrawableStateConstraintLayout
27        android:id="@+id/multi_action_preference_first_action_container"
28        android:layout_height="0dp"
29        android:layout_width="0dp"
30        android:background="?android:attr/selectableItemBackground"
31        android:paddingStart="?android:attr/listPreferredItemPaddingStart"
32        android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
33        app:layout_constraintStart_toStartOf="parent"
34        app:layout_constraintEnd_toStartOf="@id/multi_action_preference_second_action_container"
35        app:layout_constraintTop_toTopOf="parent"
36        app:layout_constraintBottom_toBottomOf="parent">
37        <com.android.car.ui.uxr.DrawableStateImageView
38            style="@style/Preference.CarUi.Icon"
39            android:id="@android:id/icon"
40            android:layout_width="@dimen/car_ui_preference_icon_size"
41            android:layout_height="@dimen/car_ui_preference_icon_size"
42            android:scaleType="fitCenter"
43            app:layout_constraintTop_toTopOf="parent"
44            app:layout_constraintBottom_toBottomOf="parent"
45            app:layout_constraintStart_toStartOf="parent"/>
46
47        <com.android.car.ui.uxr.DrawableStateTextView
48            android:id="@android:id/title"
49            android:layout_width="0dp"
50            android:layout_height="wrap_content"
51            android:layout_marginStart="@dimen/car_ui_preference_icon_margin_end"
52            app:layout_goneMarginStart="0dp"
53            android:textAlignment="viewStart"
54            android:singleLine="true"
55            android:textAppearance="@style/TextAppearance.CarUi.PreferenceTitle"
56            app:layout_constraintStart_toEndOf="@android:id/icon"
57            app:layout_constraintEnd_toEndOf="parent"
58            app:layout_constraintTop_toTopOf="parent"
59            app:layout_constraintBottom_toTopOf="@android:id/summary"
60            app:layout_constraintVertical_chainStyle="packed"/>
61
62        <com.android.car.ui.uxr.DrawableStateTextView
63            android:id="@android:id/summary"
64            android:layout_width="0dp"
65            android:layout_height="wrap_content"
66            android:layout_marginStart="@dimen/car_ui_preference_icon_margin_end"
67            app:layout_goneMarginStart="0dp"
68            android:textAlignment="viewStart"
69            android:textAppearance="@style/TextAppearance.CarUi.PreferenceSummary"
70            android:maxLines="2"
71            app:layout_constraintStart_toEndOf="@android:id/icon"
72            app:layout_constraintEnd_toEndOf="parent"
73            app:layout_constraintTop_toBottomOf="@android:id/title"
74            app:layout_constraintBottom_toBottomOf="parent"/>
75    </com.android.car.ui.uxr.DrawableStateConstraintLayout>
76
77    <androidx.constraintlayout.widget.ConstraintLayout
78        android:id="@+id/multi_action_preference_second_action_container"
79        android:layout_height="0dp"
80        android:layout_width="wrap_content"
81        android:paddingEnd="@dimen/multi_action_preference_item_container_padding"
82        android:paddingStart="@dimen/multi_action_preference_item_container_padding"
83        app:layout_constraintStart_toEndOf="@id/multi_action_preference_first_action_container"
84        app:layout_constraintEnd_toEndOf="parent"
85        app:layout_constraintTop_toTopOf="parent"
86        app:layout_constraintBottom_toBottomOf="parent">
87
88        <View
89            android:id="@+id/multi_action_preference_divider"
90            android:layout_width="@dimen/car_ui_divider_width"
91            android:layout_height="0dp"
92            android:layout_marginBottom="@dimen/car_ui_preference_content_margin_bottom"
93            android:layout_marginTop="@dimen/car_ui_preference_content_margin_top"
94            android:layout_marginEnd="@dimen/multi_action_preference_item_divider_margin_end"
95            app:layout_constraintStart_toStartOf="parent"
96            app:layout_constraintEnd_toStartOf="@id/multi_action_preference_item_container1"
97            app:layout_constraintTop_toTopOf="parent"
98            app:layout_constraintBottom_toBottomOf="parent"
99            style="@style/Preference.CarUi.Divider"/>
100
101        <com.android.car.ui.uxr.DrawableStateFrameLayout
102            android:id="@+id/multi_action_preference_item_container1"
103            android:layout_width="wrap_content"
104            android:layout_height="wrap_content"
105            android:focusable="false"
106            app:layout_constraintStart_toEndOf="@id/multi_action_preference_divider"
107            app:layout_constraintEnd_toStartOf="@id/multi_action_preference_item_container2"
108            app:layout_constraintTop_toTopOf="parent"
109            app:layout_constraintBottom_toBottomOf="parent"/>
110
111        <com.android.car.ui.uxr.DrawableStateFrameLayout
112            android:id="@+id/multi_action_preference_item_container2"
113            android:layout_width="wrap_content"
114            android:layout_height="wrap_content"
115            android:focusable="false"
116            app:layout_constraintStart_toEndOf="@id/multi_action_preference_item_container1"
117            app:layout_constraintEnd_toStartOf="@id/multi_action_preference_item_container3"
118            app:layout_constraintTop_toTopOf="parent"
119            app:layout_constraintBottom_toBottomOf="parent"/>
120
121        <com.android.car.ui.uxr.DrawableStateFrameLayout
122            android:id="@+id/multi_action_preference_item_container3"
123            android:layout_width="wrap_content"
124            android:layout_height="wrap_content"
125            android:focusable="false"
126            app:layout_constraintStart_toEndOf="@id/multi_action_preference_item_container2"
127            app:layout_constraintEnd_toStartOf="@android:id/widget_frame"
128            app:layout_constraintTop_toTopOf="parent"
129            app:layout_constraintBottom_toBottomOf="parent"/>
130
131        <!-- The widget frame is required for androidx preferences, but we won't use it. -->
132        <FrameLayout
133            android:id="@android:id/widget_frame"
134            android:layout_width="wrap_content"
135            android:layout_height="wrap_content"
136            app:layout_constraintEnd_toEndOf="parent"
137            app:layout_constraintTop_toTopOf="parent"
138            app:layout_constraintBottom_toBottomOf="parent"/>
139    </androidx.constraintlayout.widget.ConstraintLayout>
140
141</androidx.constraintlayout.widget.ConstraintLayout>
142