1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- Copyright (C) 2018 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 <!-- Note: the width is 0dp because ColumnCardView will automatically set a width based 18 on the number of columns it should take up. See ColumnCardView for more details. --> 19 <androidx.car.widget.ColumnCardView 20 xmlns:android="http://schemas.android.com/apk/res/android" 21 xmlns:app="http://schemas.android.com/apk/res-auto" 22 android:layout_gravity="center" 23 android:layout_width="0dp" 24 android:layout_height="wrap_content" 25 android:elevation="@dimen/car_dialog_elevation" 26 app:cardBackgroundColor="?attr/dialogBackgroundColor" 27 app:cardCornerRadius="@dimen/car_radius_3"> 28 29 <LinearLayout 30 android:id="@+id/content_view" 31 android:layout_width="match_parent" 32 android:layout_height="wrap_content" 33 android:layout_marginStart="@dimen/car_keyline_1" 34 android:layout_marginEnd="@dimen/car_keyline_1" 35 android:paddingTop="@dimen/car_padding_4" 36 android:paddingBottom="@dimen/car_padding_4" 37 android:orientation="vertical"> 38 39 <TextView 40 android:id="@+id/title" 41 android:layout_width="match_parent" 42 android:layout_height="@dimen/car_dialog_header_height" 43 android:gravity="center_vertical|start" 44 android:visibility="gone" 45 style="?attr/dialogTitleStyle" /> 46 47 <TextView 48 android:id="@+id/body" 49 android:layout_width="wrap_content" 50 android:layout_height="wrap_content" 51 android:visibility="gone" 52 style="?attr/dialogBodyStyle" /> 53 54 <LinearLayout 55 android:id="@+id/button_panel" 56 android:layout_width="match_parent" 57 android:layout_height="@dimen/car_dialog_action_bar_height" 58 android:gravity="center_vertical" 59 android:orientation="horizontal" 60 android:visibility="gone"> 61 62 <Button 63 android:id="@+id/positive_button" 64 android:layout_marginEnd="@dimen/car_padding_4" 65 android:layout_width="wrap_content" 66 android:minWidth="0dp" 67 android:padding="0dp" 68 android:textColor="@color/car_accent" 69 android:visibility="gone" 70 style="?attr/dialogButtonStyle" /> 71 72 <Button 73 android:id="@+id/negative_button" 74 android:layout_width="wrap_content" 75 android:minWidth="0dp" 76 android:padding="0dp" 77 android:textColor="@color/car_accent" 78 android:visibility="gone" 79 style="?attr/dialogButtonStyle" /> 80 </LinearLayout> 81 </LinearLayout> 82 </androidx.car.widget.ColumnCardView> 83