blob: 5934fce834c53acacba0ff743cd54de42d883a7e [file] [log] [blame]
Ram Parameswaranfa84da12019-10-31 09:57:35 -07001<?xml version="1.0" encoding="utf-8"?><!--
2 ~ Copyright 2019 The Android Open Source Project
3 ~
4 ~ Licensed under the Apache License, Version 2.0 (the "License");
5 ~ you may not use this file except in compliance with the License.
6 ~ You may obtain a copy of the License at
7 ~
8 ~ http://www.apache.org/licenses/LICENSE-2.0
9 ~
10 ~ Unless required by applicable law or agreed to in writing, software
11 ~ distributed under the License is distributed on an "AS IS" BASIS,
12 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ~ See the License for the specific language governing permissions and
14 ~ limitations under the License.
15 -->
16
Ram Parameswaran45db9be2019-12-11 18:34:02 -080017<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
Ram Parameswaranfa84da12019-10-31 09:57:35 -070018 xmlns:app="http://schemas.android.com/apk/res-auto"
19 android:layout_width="match_parent"
20 android:layout_height="@dimen/car_ui_list_item_height">
21
Ram Parameswaran45db9be2019-12-11 18:34:02 -080022 <!-- The following touch interceptor views are sized to encompass the specific sub-sections of
23 the list item view to easily control the bounds of a background ripple effects. -->
24 <View
25 android:id="@+id/touch_interceptor"
26 android:layout_width="0dp"
27 android:layout_height="0dp"
28 android:background="?android:attr/selectableItemBackground"
29 android:clickable="true"
30 app:layout_constraintBottom_toBottomOf="parent"
31 app:layout_constraintEnd_toEndOf="parent"
32 app:layout_constraintStart_toStartOf="parent"
33 app:layout_constraintTop_toTopOf="parent" />
34
35 <!-- This touch interceptor does not include the action container -->
36 <View
37 android:id="@+id/reduced_touch_interceptor"
38 android:layout_width="0dp"
39 android:layout_height="0dp"
40 android:background="?android:attr/selectableItemBackground"
41 android:clickable="true"
42 android:visibility="gone"
43 app:layout_constraintBottom_toBottomOf="parent"
44 app:layout_constraintEnd_toStartOf="@id/action_container"
45 app:layout_constraintStart_toStartOf="parent"
46 app:layout_constraintTop_toTopOf="parent" />
47
Ram Parameswaranfa84da12019-10-31 09:57:35 -070048 <androidx.constraintlayout.widget.Guideline
49 android:id="@+id/car_ui_list_item_start_guideline"
50 android:layout_width="wrap_content"
51 android:layout_height="wrap_content"
52 android:orientation="vertical"
53 app:layout_constraintGuide_begin="@dimen/car_ui_list_item_start_inset" />
54
55 <FrameLayout
56 android:id="@+id/icon_container"
57 android:layout_width="@dimen/car_ui_list_item_icon_container_width"
58 android:layout_height="0dp"
Ram Parameswaranfa84da12019-10-31 09:57:35 -070059 app:layout_constraintBottom_toBottomOf="parent"
Cole Faustb546b6e2019-11-19 13:27:53 -080060 app:layout_constraintStart_toStartOf="@+id/car_ui_list_item_start_guideline"
Ram Parameswaranfa84da12019-10-31 09:57:35 -070061 app:layout_constraintTop_toTopOf="parent">
62
63 <ImageView
64 android:id="@+id/icon"
65 android:layout_width="@dimen/car_ui_list_item_icon_size"
66 android:layout_height="@dimen/car_ui_list_item_icon_size"
67 android:layout_gravity="center"
68 android:scaleType="fitXY" />
69 </FrameLayout>
70
71 <TextView
72 android:id="@+id/title"
73 android:layout_width="0dp"
74 android:layout_height="wrap_content"
75 android:layout_marginStart="@dimen/car_ui_list_item_text_start_margin"
76 android:singleLine="@bool/car_ui_list_item_single_line_title"
77 android:textAppearance="@style/TextAppearance.CarUi.ListItem"
78 app:layout_constraintBottom_toTopOf="@+id/body"
Cole Faustb546b6e2019-11-19 13:27:53 -080079 app:layout_constraintEnd_toStartOf="@+id/action_container"
80 app:layout_constraintStart_toEndOf="@+id/icon_container"
Ram Parameswaranfa84da12019-10-31 09:57:35 -070081 app:layout_constraintTop_toTopOf="parent"
82 app:layout_constraintVertical_chainStyle="packed"
83 app:layout_goneMarginStart="@dimen/car_ui_list_item_text_no_icon_start_margin" />
84
85 <TextView
86 android:id="@+id/body"
87 android:layout_width="0dp"
88 android:layout_height="wrap_content"
89 android:layout_marginStart="@dimen/car_ui_list_item_text_start_margin"
90 android:textAppearance="@style/TextAppearance.CarUi.ListItem.Body"
91 app:layout_constraintBottom_toBottomOf="parent"
Cole Faustb546b6e2019-11-19 13:27:53 -080092 app:layout_constraintEnd_toStartOf="@+id/action_container"
93 app:layout_constraintStart_toEndOf="@+id/icon_container"
Ram Parameswaranfa84da12019-10-31 09:57:35 -070094 app:layout_constraintTop_toBottomOf="@+id/title"
95 app:layout_goneMarginStart="@dimen/car_ui_list_item_text_no_icon_start_margin" />
96
97 <FrameLayout
98 android:id="@+id/action_container"
99 android:layout_width="@dimen/car_ui_list_item_icon_container_width"
100 android:layout_height="0dp"
101 android:background="?android:attr/selectableItemBackground"
102 app:layout_constraintBottom_toBottomOf="parent"
Cole Faustb546b6e2019-11-19 13:27:53 -0800103 app:layout_constraintEnd_toEndOf="@+id/car_ui_list_item_end_guideline"
Ram Parameswaranfa84da12019-10-31 09:57:35 -0700104 app:layout_constraintTop_toTopOf="parent">
105
Ram Parameswaran3ce67022019-11-12 15:39:33 -0800106 <View
107 android:id="@+id/action_divider"
108 android:layout_width="@dimen/car_ui_list_item_action_divider_width"
109 android:layout_height="@dimen/car_ui_list_item_action_divider_height"
Ram Parameswaran45db9be2019-12-11 18:34:02 -0800110 android:layout_gravity="start|center_vertical"
111 android:background="@drawable/car_ui_list_item_divider" />
Ram Parameswaran3ce67022019-11-12 15:39:33 -0800112
Ram Parameswaranfa84da12019-10-31 09:57:35 -0700113 <Switch
114 android:id="@+id/switch_widget"
115 android:layout_width="wrap_content"
116 android:layout_height="wrap_content"
Ram Parameswaran45db9be2019-12-11 18:34:02 -0800117 android:layout_gravity="center"
118 android:clickable="false"
119 android:focusable="false" />
Ram Parameswaranfa84da12019-10-31 09:57:35 -0700120
121 <CheckBox
122 android:id="@+id/checkbox_widget"
123 android:layout_width="wrap_content"
124 android:layout_height="wrap_content"
Ram Parameswaran45db9be2019-12-11 18:34:02 -0800125 android:layout_gravity="center"
126 android:clickable="false"
127 android:focusable="false" />
Ram Parameswaran3ce67022019-11-12 15:39:33 -0800128
129 <ImageView
130 android:id="@+id/supplemental_icon"
131 android:layout_width="@dimen/car_ui_list_item_supplemental_icon_size"
132 android:layout_height="@dimen/car_ui_list_item_supplemental_icon_size"
133 android:layout_gravity="center"
134 android:scaleType="fitXY" />
Ram Parameswaranfa84da12019-10-31 09:57:35 -0700135 </FrameLayout>
136
137 <androidx.constraintlayout.widget.Guideline
138 android:id="@+id/car_ui_list_item_end_guideline"
139 android:layout_width="wrap_content"
140 android:layout_height="wrap_content"
141 android:orientation="vertical"
142 app:layout_constraintGuide_end="@dimen/car_ui_list_item_end_inset" />
143
144</androidx.constraintlayout.widget.ConstraintLayout>