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 | |
| 17 | <androidx.constraintlayout.widget.ConstraintLayout |
| 18 | xmlns:android="http://schemas.android.com/apk/res/android" |
| 19 | xmlns:app="http://schemas.android.com/apk/res-auto" |
| 20 | android:layout_width="match_parent" |
| 21 | android:layout_height="@dimen/car_ui_list_item_height"> |
| 22 | |
| 23 | <androidx.constraintlayout.widget.Guideline |
| 24 | android:id="@+id/car_ui_list_item_start_guideline" |
| 25 | android:layout_width="wrap_content" |
| 26 | android:layout_height="wrap_content" |
| 27 | android:orientation="vertical" |
| 28 | app:layout_constraintGuide_begin="@dimen/car_ui_list_item_start_inset" /> |
| 29 | |
| 30 | <FrameLayout |
| 31 | android:id="@+id/icon_container" |
| 32 | android:layout_width="@dimen/car_ui_list_item_icon_container_width" |
| 33 | android:layout_height="0dp" |
| 34 | android:background="?android:attr/selectableItemBackground" |
| 35 | app:layout_constraintBottom_toBottomOf="parent" |
| 36 | app:layout_constraintStart_toStartOf="@id/car_ui_list_item_start_guideline" |
| 37 | app:layout_constraintTop_toTopOf="parent"> |
| 38 | |
| 39 | <ImageView |
| 40 | android:id="@+id/icon" |
| 41 | android:layout_width="@dimen/car_ui_list_item_icon_size" |
| 42 | android:layout_height="@dimen/car_ui_list_item_icon_size" |
| 43 | android:layout_gravity="center" |
| 44 | android:scaleType="fitXY" /> |
| 45 | </FrameLayout> |
| 46 | |
| 47 | <TextView |
| 48 | android:id="@+id/title" |
| 49 | android:layout_width="0dp" |
| 50 | android:layout_height="wrap_content" |
| 51 | android:layout_marginStart="@dimen/car_ui_list_item_text_start_margin" |
| 52 | android:singleLine="@bool/car_ui_list_item_single_line_title" |
| 53 | android:textAppearance="@style/TextAppearance.CarUi.ListItem" |
| 54 | app:layout_constraintBottom_toTopOf="@+id/body" |
| 55 | app:layout_constraintEnd_toStartOf="@id/action_container" |
| 56 | app:layout_constraintStart_toEndOf="@id/icon_container" |
| 57 | app:layout_constraintTop_toTopOf="parent" |
| 58 | app:layout_constraintVertical_chainStyle="packed" |
| 59 | app:layout_goneMarginStart="@dimen/car_ui_list_item_text_no_icon_start_margin" /> |
| 60 | |
| 61 | <TextView |
| 62 | android:id="@+id/body" |
| 63 | android:layout_width="0dp" |
| 64 | android:layout_height="wrap_content" |
| 65 | android:layout_marginStart="@dimen/car_ui_list_item_text_start_margin" |
| 66 | android:textAppearance="@style/TextAppearance.CarUi.ListItem.Body" |
| 67 | app:layout_constraintBottom_toBottomOf="parent" |
| 68 | app:layout_constraintEnd_toStartOf="@id/action_container" |
| 69 | app:layout_constraintStart_toEndOf="@id/icon_container" |
| 70 | app:layout_constraintTop_toBottomOf="@+id/title" |
| 71 | app:layout_goneMarginStart="@dimen/car_ui_list_item_text_no_icon_start_margin" /> |
| 72 | |
| 73 | <FrameLayout |
| 74 | android:id="@+id/action_container" |
| 75 | android:layout_width="@dimen/car_ui_list_item_icon_container_width" |
| 76 | android:layout_height="0dp" |
| 77 | android:background="?android:attr/selectableItemBackground" |
| 78 | app:layout_constraintBottom_toBottomOf="parent" |
| 79 | app:layout_constraintEnd_toEndOf="@id/car_ui_list_item_end_guideline" |
| 80 | app:layout_constraintTop_toTopOf="parent"> |
| 81 | |
| 82 | <Switch |
| 83 | android:id="@+id/switch_widget" |
| 84 | android:layout_width="wrap_content" |
| 85 | android:layout_height="wrap_content" |
| 86 | android:layout_gravity="center" /> |
| 87 | |
| 88 | <CheckBox |
| 89 | android:id="@+id/checkbox_widget" |
| 90 | android:layout_width="wrap_content" |
| 91 | android:layout_height="wrap_content" |
| 92 | android:layout_gravity="center" /> |
| 93 | </FrameLayout> |
| 94 | |
| 95 | <androidx.constraintlayout.widget.Guideline |
| 96 | android:id="@+id/car_ui_list_item_end_guideline" |
| 97 | android:layout_width="wrap_content" |
| 98 | android:layout_height="wrap_content" |
| 99 | android:orientation="vertical" |
| 100 | app:layout_constraintGuide_end="@dimen/car_ui_list_item_end_inset" /> |
| 101 | |
| 102 | </androidx.constraintlayout.widget.ConstraintLayout> |