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" |
| 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 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 | |
| 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 Faust | b546b6e | 2019-11-19 13:27:53 -0800 | [diff] [blame] | 103 | app:layout_constraintEnd_toEndOf="@+id/car_ui_list_item_end_guideline" |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 104 | app:layout_constraintTop_toTopOf="parent"> |
| 105 | |
Ram Parameswaran | 3ce6702 | 2019-11-12 15:39:33 -0800 | [diff] [blame] | 106 | <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 Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame^] | 110 | android:layout_gravity="start|center_vertical" |
| 111 | android:background="@drawable/car_ui_list_item_divider" /> |
Ram Parameswaran | 3ce6702 | 2019-11-12 15:39:33 -0800 | [diff] [blame] | 112 | |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 113 | <Switch |
| 114 | android:id="@+id/switch_widget" |
| 115 | android:layout_width="wrap_content" |
| 116 | android:layout_height="wrap_content" |
Ram Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame^] | 117 | android:layout_gravity="center" |
| 118 | android:clickable="false" |
| 119 | android:focusable="false" /> |
Ram Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 120 | |
| 121 | <CheckBox |
| 122 | android:id="@+id/checkbox_widget" |
| 123 | android:layout_width="wrap_content" |
| 124 | android:layout_height="wrap_content" |
Ram Parameswaran | 45db9be | 2019-12-11 18:34:02 -0800 | [diff] [blame^] | 125 | android:layout_gravity="center" |
| 126 | android:clickable="false" |
| 127 | android:focusable="false" /> |
Ram Parameswaran | 3ce6702 | 2019-11-12 15:39:33 -0800 | [diff] [blame] | 128 | |
| 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 Parameswaran | fa84da1 | 2019-10-31 09:57:35 -0700 | [diff] [blame] | 135 | </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> |