Create ListItem component
Bug: 142576503
Test: ListItemTest
Change-Id: Id0193e06aba566de9349738964d450093c8a963b
diff --git a/car-ui-lib/res/layout/car_ui_list_item.xml b/car-ui-lib/res/layout/car_ui_list_item.xml
new file mode 100644
index 0000000..1357e59
--- /dev/null
+++ b/car-ui-lib/res/layout/car_ui_list_item.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright 2019 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<androidx.constraintlayout.widget.ConstraintLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/car_ui_list_item_height">
+
+ <androidx.constraintlayout.widget.Guideline
+ android:id="@+id/car_ui_list_item_start_guideline"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ app:layout_constraintGuide_begin="@dimen/car_ui_list_item_start_inset" />
+
+ <FrameLayout
+ android:id="@+id/icon_container"
+ android:layout_width="@dimen/car_ui_list_item_icon_container_width"
+ android:layout_height="0dp"
+ android:background="?android:attr/selectableItemBackground"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintStart_toStartOf="@id/car_ui_list_item_start_guideline"
+ app:layout_constraintTop_toTopOf="parent">
+
+ <ImageView
+ android:id="@+id/icon"
+ android:layout_width="@dimen/car_ui_list_item_icon_size"
+ android:layout_height="@dimen/car_ui_list_item_icon_size"
+ android:layout_gravity="center"
+ android:scaleType="fitXY" />
+ </FrameLayout>
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/car_ui_list_item_text_start_margin"
+ android:singleLine="@bool/car_ui_list_item_single_line_title"
+ android:textAppearance="@style/TextAppearance.CarUi.ListItem"
+ app:layout_constraintBottom_toTopOf="@+id/body"
+ app:layout_constraintEnd_toStartOf="@id/action_container"
+ app:layout_constraintStart_toEndOf="@id/icon_container"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintVertical_chainStyle="packed"
+ app:layout_goneMarginStart="@dimen/car_ui_list_item_text_no_icon_start_margin" />
+
+ <TextView
+ android:id="@+id/body"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/car_ui_list_item_text_start_margin"
+ android:textAppearance="@style/TextAppearance.CarUi.ListItem.Body"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toStartOf="@id/action_container"
+ app:layout_constraintStart_toEndOf="@id/icon_container"
+ app:layout_constraintTop_toBottomOf="@+id/title"
+ app:layout_goneMarginStart="@dimen/car_ui_list_item_text_no_icon_start_margin" />
+
+ <FrameLayout
+ android:id="@+id/action_container"
+ android:layout_width="@dimen/car_ui_list_item_icon_container_width"
+ android:layout_height="0dp"
+ android:background="?android:attr/selectableItemBackground"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="@id/car_ui_list_item_end_guideline"
+ app:layout_constraintTop_toTopOf="parent">
+
+ <Switch
+ android:id="@+id/switch_widget"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center" />
+
+ <CheckBox
+ android:id="@+id/checkbox_widget"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center" />
+ </FrameLayout>
+
+ <androidx.constraintlayout.widget.Guideline
+ android:id="@+id/car_ui_list_item_end_guideline"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ app:layout_constraintGuide_end="@dimen/car_ui_list_item_end_inset" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file