Ram Parameswaran | 00ad512 | 2020-01-22 14:09:35 -0800 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <!-- |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 3 | ~ Copyright 2019 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 | |
Ram Parameswaran | 00ad512 | 2020-01-22 14:09:35 -0800 | [diff] [blame] | 18 | <androidx.constraintlayout.widget.ConstraintLayout |
| 19 | xmlns:android="http://schemas.android.com/apk/res/android" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 20 | xmlns:app="http://schemas.android.com/apk/res-auto" |
| 21 | android:layout_width="match_parent" |
| 22 | android:layout_height="@dimen/car_ui_list_item_height"> |
| 23 | |
Ram Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame] | 24 | <!-- The following touch interceptor views are sized to encompass the specific sub-sections of |
| 25 | the list item view to easily control the bounds of a background ripple effects. --> |
| 26 | <View |
| 27 | android:id="@+id/touch_interceptor" |
| 28 | android:layout_width="0dp" |
| 29 | android:layout_height="0dp" |
Ram Parameswaran | 5500c3a | 2020-01-17 15:45:23 -0800 | [diff] [blame] | 30 | android:background="@drawable/car_ui_list_item_background" |
Ram Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame] | 31 | android:clickable="true" |
| 32 | app:layout_constraintBottom_toBottomOf="parent" |
| 33 | app:layout_constraintEnd_toEndOf="parent" |
| 34 | app:layout_constraintStart_toStartOf="parent" |
| 35 | app:layout_constraintTop_toTopOf="parent" /> |
| 36 | |
| 37 | <!-- This touch interceptor does not include the action container --> |
| 38 | <View |
| 39 | android:id="@+id/reduced_touch_interceptor" |
| 40 | android:layout_width="0dp" |
| 41 | android:layout_height="0dp" |
Ram Parameswaran | 5500c3a | 2020-01-17 15:45:23 -0800 | [diff] [blame] | 42 | android:background="@drawable/car_ui_list_item_background" |
Ram Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame] | 43 | android:clickable="true" |
| 44 | android:visibility="gone" |
| 45 | app:layout_constraintBottom_toBottomOf="parent" |
| 46 | app:layout_constraintEnd_toStartOf="@id/action_container" |
| 47 | app:layout_constraintStart_toStartOf="parent" |
| 48 | app:layout_constraintTop_toTopOf="parent" /> |
| 49 | |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 50 | <androidx.constraintlayout.widget.Guideline |
| 51 | android:id="@+id/car_ui_list_item_start_guideline" |
| 52 | android:layout_width="wrap_content" |
| 53 | android:layout_height="wrap_content" |
| 54 | android:orientation="vertical" |
| 55 | app:layout_constraintGuide_begin="@dimen/car_ui_list_item_start_inset" /> |
| 56 | |
| 57 | <FrameLayout |
| 58 | android:id="@+id/icon_container" |
| 59 | android:layout_width="@dimen/car_ui_list_item_icon_container_width" |
| 60 | android:layout_height="0dp" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 61 | app:layout_constraintBottom_toBottomOf="parent" |
Cole Faust | b546b6e | 2019-11-19 13:27:53 -0800 | [diff] [blame] | 62 | app:layout_constraintStart_toStartOf="@+id/car_ui_list_item_start_guideline" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 63 | app:layout_constraintTop_toTopOf="parent"> |
| 64 | |
| 65 | <ImageView |
| 66 | android:id="@+id/icon" |
| 67 | android:layout_width="@dimen/car_ui_list_item_icon_size" |
| 68 | android:layout_height="@dimen/car_ui_list_item_icon_size" |
| 69 | android:layout_gravity="center" |
Ram Parameswaran | 00ad512 | 2020-01-22 14:09:35 -0800 | [diff] [blame] | 70 | android:visibility="gone" |
| 71 | android:scaleType="fitXY" /> |
| 72 | |
| 73 | <ImageView |
| 74 | android:id="@+id/content_icon" |
| 75 | android:layout_width="@dimen/car_ui_list_item_content_icon_width" |
| 76 | android:layout_height="@dimen/car_ui_list_item_content_icon_height" |
| 77 | android:layout_gravity="center" |
| 78 | android:visibility="gone" |
| 79 | android:scaleType="fitXY" /> |
| 80 | |
| 81 | <ImageView |
| 82 | android:id="@+id/avatar_icon" |
| 83 | android:background="@drawable/car_ui_list_item_avatar_icon_outline" |
| 84 | android:layout_width="@dimen/car_ui_list_item_avatar_icon_width" |
| 85 | android:layout_height="@dimen/car_ui_list_item_avatar_icon_height" |
| 86 | android:layout_gravity="center" |
| 87 | android:visibility="gone" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 88 | android:scaleType="fitXY" /> |
| 89 | </FrameLayout> |
| 90 | |
| 91 | <TextView |
| 92 | android:id="@+id/title" |
| 93 | android:layout_width="0dp" |
| 94 | android:layout_height="wrap_content" |
| 95 | android:layout_marginStart="@dimen/car_ui_list_item_text_start_margin" |
| 96 | android:singleLine="@bool/car_ui_list_item_single_line_title" |
| 97 | android:textAppearance="@style/TextAppearance.CarUi.ListItem" |
| 98 | app:layout_constraintBottom_toTopOf="@+id/body" |
Cole Faust | b546b6e | 2019-11-19 13:27:53 -0800 | [diff] [blame] | 99 | app:layout_constraintEnd_toStartOf="@+id/action_container" |
| 100 | app:layout_constraintStart_toEndOf="@+id/icon_container" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 101 | app:layout_constraintTop_toTopOf="parent" |
| 102 | app:layout_constraintVertical_chainStyle="packed" |
| 103 | app:layout_goneMarginStart="@dimen/car_ui_list_item_text_no_icon_start_margin" /> |
| 104 | |
| 105 | <TextView |
| 106 | android:id="@+id/body" |
| 107 | android:layout_width="0dp" |
| 108 | android:layout_height="wrap_content" |
| 109 | android:layout_marginStart="@dimen/car_ui_list_item_text_start_margin" |
| 110 | android:textAppearance="@style/TextAppearance.CarUi.ListItem.Body" |
| 111 | app:layout_constraintBottom_toBottomOf="parent" |
Cole Faust | b546b6e | 2019-11-19 13:27:53 -0800 | [diff] [blame] | 112 | app:layout_constraintEnd_toStartOf="@+id/action_container" |
| 113 | app:layout_constraintStart_toEndOf="@+id/icon_container" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 114 | app:layout_constraintTop_toBottomOf="@+id/title" |
| 115 | app:layout_goneMarginStart="@dimen/car_ui_list_item_text_no_icon_start_margin" /> |
| 116 | |
Ram Parameswaran | 5500c3a | 2020-01-17 15:45:23 -0800 | [diff] [blame] | 117 | <!-- This touch interceptor is sized and positioned to encompass the action container --> |
| 118 | <View |
| 119 | android:id="@+id/action_container_touch_interceptor" |
| 120 | android:layout_width="0dp" |
| 121 | android:layout_height="0dp" |
| 122 | android:background="@drawable/car_ui_list_item_background" |
| 123 | android:clickable="true" |
| 124 | android:visibility="gone" |
| 125 | app:layout_constraintBottom_toBottomOf="@id/action_container" |
| 126 | app:layout_constraintEnd_toEndOf="@id/action_container" |
| 127 | app:layout_constraintStart_toStartOf="@id/action_container" |
| 128 | app:layout_constraintTop_toTopOf="@id/action_container" /> |
| 129 | |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 130 | <FrameLayout |
| 131 | android:id="@+id/action_container" |
Priyank Singh | 2acba18 | 2020-01-10 17:42:59 -0800 | [diff] [blame] | 132 | android:layout_width="wrap_content" |
| 133 | android:minWidth="@dimen/car_ui_list_item_icon_container_width" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 134 | android:layout_height="0dp" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 135 | app:layout_constraintBottom_toBottomOf="parent" |
Cole Faust | b546b6e | 2019-11-19 13:27:53 -0800 | [diff] [blame] | 136 | app:layout_constraintEnd_toEndOf="@+id/car_ui_list_item_end_guideline" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 137 | app:layout_constraintTop_toTopOf="parent"> |
| 138 | |
Ram Parameswaran | 3ce6702 | 2019-11-12 15:39:33 -0800 | [diff] [blame] | 139 | <View |
| 140 | android:id="@+id/action_divider" |
| 141 | android:layout_width="@dimen/car_ui_list_item_action_divider_width" |
| 142 | android:layout_height="@dimen/car_ui_list_item_action_divider_height" |
Ram Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame] | 143 | android:layout_gravity="start|center_vertical" |
| 144 | android:background="@drawable/car_ui_list_item_divider" /> |
Ram Parameswaran | 3ce6702 | 2019-11-12 15:39:33 -0800 | [diff] [blame] | 145 | |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 146 | <Switch |
| 147 | android:id="@+id/switch_widget" |
| 148 | android:layout_width="wrap_content" |
| 149 | android:layout_height="wrap_content" |
Ram Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame] | 150 | android:layout_gravity="center" |
| 151 | android:clickable="false" |
| 152 | android:focusable="false" /> |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 153 | |
| 154 | <CheckBox |
| 155 | android:id="@+id/checkbox_widget" |
| 156 | android:layout_width="wrap_content" |
| 157 | android:layout_height="wrap_content" |
Ram Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame] | 158 | android:layout_gravity="center" |
| 159 | android:clickable="false" |
| 160 | android:focusable="false" /> |
Ram Parameswaran | 3ce6702 | 2019-11-12 15:39:33 -0800 | [diff] [blame] | 161 | |
Ram Parameswaran | 318fb40 | 2019-12-17 12:31:01 -0800 | [diff] [blame] | 162 | <RadioButton |
| 163 | android:id="@+id/radio_button_widget" |
| 164 | android:layout_width="wrap_content" |
| 165 | android:layout_height="wrap_content" |
| 166 | android:layout_gravity="center" |
| 167 | android:clickable="false" |
| 168 | android:focusable="false" /> |
| 169 | |
Ram Parameswaran | 3ce6702 | 2019-11-12 15:39:33 -0800 | [diff] [blame] | 170 | <ImageView |
| 171 | android:id="@+id/supplemental_icon" |
| 172 | android:layout_width="@dimen/car_ui_list_item_supplemental_icon_size" |
| 173 | android:layout_height="@dimen/car_ui_list_item_supplemental_icon_size" |
| 174 | android:layout_gravity="center" |
| 175 | android:scaleType="fitXY" /> |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 176 | </FrameLayout> |
| 177 | |
| 178 | <androidx.constraintlayout.widget.Guideline |
| 179 | android:id="@+id/car_ui_list_item_end_guideline" |
| 180 | android:layout_width="wrap_content" |
| 181 | android:layout_height="wrap_content" |
| 182 | android:orientation="vertical" |
| 183 | app:layout_constraintGuide_end="@dimen/car_ui_list_item_end_inset" /> |
| 184 | |
| 185 | </androidx.constraintlayout.widget.ConstraintLayout> |