Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 1 | <?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 Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame] | 17 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 18 | 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 Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame] | 22 | <!-- 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" |
Ram Parameswaran | 5500c3a | 2020-01-17 15:45:23 -0800 | [diff] [blame^] | 28 | android:background="@drawable/car_ui_list_item_background" |
Ram Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame] | 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" |
Ram Parameswaran | 5500c3a | 2020-01-17 15:45:23 -0800 | [diff] [blame^] | 40 | android:background="@drawable/car_ui_list_item_background" |
Ram Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame] | 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 Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 48 | <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 Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 59 | app:layout_constraintBottom_toBottomOf="parent" |
Cole Faust | b546b6e | 2019-11-19 13:27:53 -0800 | [diff] [blame] | 60 | app:layout_constraintStart_toStartOf="@+id/car_ui_list_item_start_guideline" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 61 | 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 Faust | b546b6e | 2019-11-19 13:27:53 -0800 | [diff] [blame] | 79 | app:layout_constraintEnd_toStartOf="@+id/action_container" |
| 80 | app:layout_constraintStart_toEndOf="@+id/icon_container" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 81 | 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 Faust | b546b6e | 2019-11-19 13:27:53 -0800 | [diff] [blame] | 92 | app:layout_constraintEnd_toStartOf="@+id/action_container" |
| 93 | app:layout_constraintStart_toEndOf="@+id/icon_container" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 94 | app:layout_constraintTop_toBottomOf="@+id/title" |
| 95 | app:layout_goneMarginStart="@dimen/car_ui_list_item_text_no_icon_start_margin" /> |
| 96 | |
Ram Parameswaran | 5500c3a | 2020-01-17 15:45:23 -0800 | [diff] [blame^] | 97 | <!-- This touch interceptor is sized and positioned to encompass the action container --> |
| 98 | <View |
| 99 | android:id="@+id/action_container_touch_interceptor" |
| 100 | android:layout_width="0dp" |
| 101 | android:layout_height="0dp" |
| 102 | android:background="@drawable/car_ui_list_item_background" |
| 103 | android:clickable="true" |
| 104 | android:visibility="gone" |
| 105 | app:layout_constraintBottom_toBottomOf="@id/action_container" |
| 106 | app:layout_constraintEnd_toEndOf="@id/action_container" |
| 107 | app:layout_constraintStart_toStartOf="@id/action_container" |
| 108 | app:layout_constraintTop_toTopOf="@id/action_container" /> |
| 109 | |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 110 | <FrameLayout |
| 111 | android:id="@+id/action_container" |
Priyank Singh | 2acba18 | 2020-01-10 17:42:59 -0800 | [diff] [blame] | 112 | android:layout_width="wrap_content" |
| 113 | android:minWidth="@dimen/car_ui_list_item_icon_container_width" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 114 | android:layout_height="0dp" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 115 | app:layout_constraintBottom_toBottomOf="parent" |
Cole Faust | b546b6e | 2019-11-19 13:27:53 -0800 | [diff] [blame] | 116 | app:layout_constraintEnd_toEndOf="@+id/car_ui_list_item_end_guideline" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 117 | app:layout_constraintTop_toTopOf="parent"> |
| 118 | |
Ram Parameswaran | 3ce6702 | 2019-11-12 15:39:33 -0800 | [diff] [blame] | 119 | <View |
| 120 | android:id="@+id/action_divider" |
| 121 | android:layout_width="@dimen/car_ui_list_item_action_divider_width" |
| 122 | android:layout_height="@dimen/car_ui_list_item_action_divider_height" |
Ram Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame] | 123 | android:layout_gravity="start|center_vertical" |
| 124 | android:background="@drawable/car_ui_list_item_divider" /> |
Ram Parameswaran | 3ce6702 | 2019-11-12 15:39:33 -0800 | [diff] [blame] | 125 | |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 126 | <Switch |
| 127 | android:id="@+id/switch_widget" |
| 128 | android:layout_width="wrap_content" |
| 129 | android:layout_height="wrap_content" |
Ram Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame] | 130 | android:layout_gravity="center" |
| 131 | android:clickable="false" |
| 132 | android:focusable="false" /> |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 133 | |
| 134 | <CheckBox |
| 135 | android:id="@+id/checkbox_widget" |
| 136 | android:layout_width="wrap_content" |
| 137 | android:layout_height="wrap_content" |
Ram Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame] | 138 | android:layout_gravity="center" |
| 139 | android:clickable="false" |
| 140 | android:focusable="false" /> |
Ram Parameswaran | 3ce6702 | 2019-11-12 15:39:33 -0800 | [diff] [blame] | 141 | |
Ram Parameswaran | 318fb40 | 2019-12-17 12:31:01 -0800 | [diff] [blame] | 142 | <RadioButton |
| 143 | android:id="@+id/radio_button_widget" |
| 144 | android:layout_width="wrap_content" |
| 145 | android:layout_height="wrap_content" |
| 146 | android:layout_gravity="center" |
| 147 | android:clickable="false" |
| 148 | android:focusable="false" /> |
| 149 | |
Ram Parameswaran | 3ce6702 | 2019-11-12 15:39:33 -0800 | [diff] [blame] | 150 | <ImageView |
| 151 | android:id="@+id/supplemental_icon" |
| 152 | android:layout_width="@dimen/car_ui_list_item_supplemental_icon_size" |
| 153 | android:layout_height="@dimen/car_ui_list_item_supplemental_icon_size" |
| 154 | android:layout_gravity="center" |
| 155 | android:scaleType="fitXY" /> |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 156 | </FrameLayout> |
| 157 | |
| 158 | <androidx.constraintlayout.widget.Guideline |
| 159 | android:id="@+id/car_ui_list_item_end_guideline" |
| 160 | android:layout_width="wrap_content" |
| 161 | android:layout_height="wrap_content" |
| 162 | android:orientation="vertical" |
| 163 | app:layout_constraintGuide_end="@dimen/car_ui_list_item_end_inset" /> |
| 164 | |
| 165 | </androidx.constraintlayout.widget.ConstraintLayout> |