Yao, Yuxing | e048d0d | 2017-11-27 15:34:44 -0800 | [diff] [blame] | 1 | <?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, Yuxing | 2d99408 | 2017-12-21 11:25:31 -0800 | [diff] [blame] | 21 | android:layout_height="match_parent" |
Yao, Yuxing | e929e4d | 2018-02-02 11:16:50 -0800 | [diff] [blame] | 22 | android:background="@drawable/car_card_ripple_background"> |
Yao, Yuxing | e048d0d | 2017-11-27 15:34:44 -0800 | [diff] [blame] | 23 | <!-- Primary Action. --> |
| 24 | <ImageView |
| 25 | android:id="@+id/primary_icon" |
| 26 | android:layout_width="@dimen/car_single_line_list_item_height" |
Yao, Yuxing | 5dbc4a8 | 2017-12-22 11:12:31 -0800 | [diff] [blame] | 27 | android:layout_height="@dimen/car_single_line_list_item_height"/> |
Yao, Yuxing | e048d0d | 2017-11-27 15:34:44 -0800 | [diff] [blame] | 28 | |
| 29 | <!-- Text. --> |
| 30 | <TextView |
| 31 | android:id="@+id/title" |
| 32 | android:layout_width="match_parent" |
| 33 | android:layout_height="wrap_content" |
Anthony Chen | d9b394c | 2017-12-14 17:22:22 -0800 | [diff] [blame] | 34 | android:layout_toStartOf="@+id/supplemental_actions" |
Yao, Yuxing | e048d0d | 2017-11-27 15:34:44 -0800 | [diff] [blame] | 35 | android:singleLine="true" |
| 36 | android:ellipsize="end"/> |
Anthony Chen | d9b394c | 2017-12-14 17:22:22 -0800 | [diff] [blame] | 37 | |
Yao, Yuxing | e048d0d | 2017-11-27 15:34:44 -0800 | [diff] [blame] | 38 | <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 Chen | d9b394c | 2017-12-14 17:22:22 -0800 | [diff] [blame] | 46 | android:id="@id/supplemental_actions" |
Yao, Yuxing | e048d0d | 2017-11-27 15:34:44 -0800 | [diff] [blame] | 47 | 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, Yuxing | 22037e6 | 2018-01-08 09:33:35 -0800 | [diff] [blame] | 57 | style="@style/CarListVerticalDivider"/> |
Yao, Yuxing | e048d0d | 2017-11-27 15:34:44 -0800 | [diff] [blame] | 58 | <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, Yuxing | 22037e6 | 2018-01-08 09:33:35 -0800 | [diff] [blame] | 65 | <!-- 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, Yuxing | e048d0d | 2017-11-27 15:34:44 -0800 | [diff] [blame] | 77 | <!-- Up to 2 action buttons with dividers. --> |
| 78 | <View |
| 79 | android:id="@+id/action2_divider" |
Yao, Yuxing | 22037e6 | 2018-01-08 09:33:35 -0800 | [diff] [blame] | 80 | style="@style/CarListVerticalDivider"/> |
Yao, Yuxing | e048d0d | 2017-11-27 15:34:44 -0800 | [diff] [blame] | 81 | <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, Yuxing | 2d99408 | 2017-12-21 11:25:31 -0800 | [diff] [blame] | 90 | android:foreground="@drawable/car_card_ripple_background" |
Roshan Agrawal | c3c0695 | 2017-12-28 15:33:36 -0800 | [diff] [blame] | 91 | style="?android:attr/borderlessButtonStyle"/> |
Yao, Yuxing | e048d0d | 2017-11-27 15:34:44 -0800 | [diff] [blame] | 92 | <View |
| 93 | android:id="@+id/action1_divider" |
Yao, Yuxing | 22037e6 | 2018-01-08 09:33:35 -0800 | [diff] [blame] | 94 | style="@style/CarListVerticalDivider"/> |
Yao, Yuxing | e048d0d | 2017-11-27 15:34:44 -0800 | [diff] [blame] | 95 | <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, Yuxing | 2d99408 | 2017-12-21 11:25:31 -0800 | [diff] [blame] | 104 | android:foreground="@drawable/car_card_ripple_background" |
Roshan Agrawal | c3c0695 | 2017-12-28 15:33:36 -0800 | [diff] [blame] | 105 | style="?android:attr/borderlessButtonStyle"/> |
Yao, Yuxing | e048d0d | 2017-11-27 15:34:44 -0800 | [diff] [blame] | 106 | </LinearLayout> |
| 107 | </RelativeLayout> |