blob: d560ffece2a2f6d54fbaab63bae09d6c2068c0eb [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2017 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.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/car_card_ripple_background">
<!-- Primary Action. -->
<ImageView
android:id="@+id/primary_icon"
android:layout_width="@dimen/car_single_line_list_item_height"
android:layout_height="@dimen/car_single_line_list_item_height"/>
<!-- Text. -->
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toStartOf="@+id/supplemental_actions"
android:singleLine="true"
android:ellipsize="end"/>
<TextView
android:id="@+id/body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toStartOf="@id/supplemental_actions"/>
<!-- Supplemental action(s) - supports either 1 supplemental icon or up to 2 action buttons. -->
<LinearLayout
android:id="@id/supplemental_actions"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/car_keyline_1"
android:layout_centerVertical="true"
android:gravity="center_vertical"
android:orientation="horizontal">
<!-- End icon with divider. -->
<View
android:id="@+id/supplemental_icon_divider"
style="@style/CarListVerticalDivider"/>
<ImageView
android:id="@+id/supplemental_icon"
android:layout_width="@dimen/car_primary_icon_size"
android:layout_height="@dimen/car_primary_icon_size"
android:layout_marginStart="@dimen/car_padding_4"
android:scaleType="fitCenter"/>
<!-- Switch with divider. -->
<View
android:id="@+id/switch_divider"
style="@style/CarListVerticalDivider"/>
<Switch
android:id="@+id/switch_widget"
android:layout_width="@dimen/car_primary_icon_size"
android:layout_height="@dimen/car_primary_icon_size"
android:layout_marginStart="@dimen/car_padding_4"
style="@android:style/Widget.Material.CompoundButton.Switch"
/>
<!-- Up to 2 action buttons with dividers. -->
<View
android:id="@+id/action2_divider"
style="@style/CarListVerticalDivider"/>
<Button
android:id="@+id/action2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/car_padding_4"
android:ellipsize="end"
android:maxLength="@integer/car_borderless_button_text_length_limit"
android:maxLines="1"
android:background="@color/car_card"
android:foreground="@drawable/car_card_ripple_background"
style="?android:attr/borderlessButtonStyle"/>
<View
android:id="@+id/action1_divider"
style="@style/CarListVerticalDivider"/>
<Button
android:id="@+id/action1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/car_padding_4"
android:ellipsize="end"
android:maxLength="@integer/car_borderless_button_text_length_limit"
android:maxLines="1"
android:background="@color/car_card"
android:foreground="@drawable/car_card_ripple_background"
style="?android:attr/borderlessButtonStyle"/>
</LinearLayout>
</RelativeLayout>