blob: d560ffece2a2f6d54fbaab63bae09d6c2068c0eb [file] [log] [blame]
Yao, Yuxinge048d0d2017-11-27 15:34:44 -08001<?xml version="1.0" encoding="utf-8"?>
2<!--
3 ~ Copyright (C) 2017 The Android Open Source Project
4 ~
5 ~ Licensed under the Apache License, Version 2.0 (the "License");
6 ~ you may not use this file except in compliance with the License.
7 ~ You may obtain a copy of the License at
8 ~
9 ~ http://www.apache.org/licenses/LICENSE-2.0
10 ~
11 ~ Unless required by applicable law or agreed to in writing, software
12 ~ distributed under the License is distributed on an "AS IS" BASIS,
13 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License.
16 -->
17<RelativeLayout
18 xmlns:android="http://schemas.android.com/apk/res/android"
19 android:id="@+id/container"
20 android:layout_width="wrap_content"
Yao, Yuxing2d994082017-12-21 11:25:31 -080021 android:layout_height="match_parent"
Yao, Yuxinge929e4d2018-02-02 11:16:50 -080022 android:background="@drawable/car_card_ripple_background">
Yao, Yuxinge048d0d2017-11-27 15:34:44 -080023 <!-- Primary Action. -->
24 <ImageView
25 android:id="@+id/primary_icon"
26 android:layout_width="@dimen/car_single_line_list_item_height"
Yao, Yuxing5dbc4a82017-12-22 11:12:31 -080027 android:layout_height="@dimen/car_single_line_list_item_height"/>
Yao, Yuxinge048d0d2017-11-27 15:34:44 -080028
29 <!-- Text. -->
30 <TextView
31 android:id="@+id/title"
32 android:layout_width="match_parent"
33 android:layout_height="wrap_content"
Anthony Chend9b394c2017-12-14 17:22:22 -080034 android:layout_toStartOf="@+id/supplemental_actions"
Yao, Yuxinge048d0d2017-11-27 15:34:44 -080035 android:singleLine="true"
36 android:ellipsize="end"/>
Anthony Chend9b394c2017-12-14 17:22:22 -080037
Yao, Yuxinge048d0d2017-11-27 15:34:44 -080038 <TextView
39 android:id="@+id/body"
40 android:layout_width="match_parent"
41 android:layout_height="wrap_content"
42 android:layout_toStartOf="@id/supplemental_actions"/>
43
44 <!-- Supplemental action(s) - supports either 1 supplemental icon or up to 2 action buttons. -->
45 <LinearLayout
Anthony Chend9b394c2017-12-14 17:22:22 -080046 android:id="@id/supplemental_actions"
Yao, Yuxinge048d0d2017-11-27 15:34:44 -080047 android:layout_width="wrap_content"
48 android:layout_height="match_parent"
49 android:layout_alignParentEnd="true"
50 android:layout_marginEnd="@dimen/car_keyline_1"
51 android:layout_centerVertical="true"
52 android:gravity="center_vertical"
53 android:orientation="horizontal">
54 <!-- End icon with divider. -->
55 <View
56 android:id="@+id/supplemental_icon_divider"
Yao, Yuxing22037e62018-01-08 09:33:35 -080057 style="@style/CarListVerticalDivider"/>
Yao, Yuxinge048d0d2017-11-27 15:34:44 -080058 <ImageView
59 android:id="@+id/supplemental_icon"
60 android:layout_width="@dimen/car_primary_icon_size"
61 android:layout_height="@dimen/car_primary_icon_size"
62 android:layout_marginStart="@dimen/car_padding_4"
63 android:scaleType="fitCenter"/>
64
Yao, Yuxing22037e62018-01-08 09:33:35 -080065 <!-- Switch with divider. -->
66 <View
67 android:id="@+id/switch_divider"
68 style="@style/CarListVerticalDivider"/>
69 <Switch
70 android:id="@+id/switch_widget"
71 android:layout_width="@dimen/car_primary_icon_size"
72 android:layout_height="@dimen/car_primary_icon_size"
73 android:layout_marginStart="@dimen/car_padding_4"
74 style="@android:style/Widget.Material.CompoundButton.Switch"
75 />
76
Yao, Yuxinge048d0d2017-11-27 15:34:44 -080077 <!-- Up to 2 action buttons with dividers. -->
78 <View
79 android:id="@+id/action2_divider"
Yao, Yuxing22037e62018-01-08 09:33:35 -080080 style="@style/CarListVerticalDivider"/>
Yao, Yuxinge048d0d2017-11-27 15:34:44 -080081 <Button
82 android:id="@+id/action2"
83 android:layout_width="wrap_content"
84 android:layout_height="wrap_content"
85 android:layout_marginStart="@dimen/car_padding_4"
86 android:ellipsize="end"
87 android:maxLength="@integer/car_borderless_button_text_length_limit"
88 android:maxLines="1"
89 android:background="@color/car_card"
Yao, Yuxing2d994082017-12-21 11:25:31 -080090 android:foreground="@drawable/car_card_ripple_background"
Roshan Agrawalc3c06952017-12-28 15:33:36 -080091 style="?android:attr/borderlessButtonStyle"/>
Yao, Yuxinge048d0d2017-11-27 15:34:44 -080092 <View
93 android:id="@+id/action1_divider"
Yao, Yuxing22037e62018-01-08 09:33:35 -080094 style="@style/CarListVerticalDivider"/>
Yao, Yuxinge048d0d2017-11-27 15:34:44 -080095 <Button
96 android:id="@+id/action1"
97 android:layout_width="wrap_content"
98 android:layout_height="wrap_content"
99 android:layout_marginStart="@dimen/car_padding_4"
100 android:ellipsize="end"
101 android:maxLength="@integer/car_borderless_button_text_length_limit"
102 android:maxLines="1"
103 android:background="@color/car_card"
Yao, Yuxing2d994082017-12-21 11:25:31 -0800104 android:foreground="@drawable/car_card_ripple_background"
Roshan Agrawalc3c06952017-12-28 15:33:36 -0800105 style="?android:attr/borderlessButtonStyle"/>
Yao, Yuxinge048d0d2017-11-27 15:34:44 -0800106 </LinearLayout>
107</RelativeLayout>