1<?xml version="1.0" encoding="UTF-8" ?> 2<!-- 3 ~ Copyright (C) 2020 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 18<androidx.cardview.widget.CardView 19 xmlns:android="http://schemas.android.com/apk/res/android" 20 xmlns:app="http://schemas.android.com/apk/res-auto" 21 style="@style/CardViewStyle" 22 android:id="@+id/card_view" 23 android:foreground="?android:attr/selectableItemBackground" 24 android:layout_height="match_parent" 25 android:layout_width="match_parent" 26 android:visibility="gone"> 27 28 <FrameLayout 29 android:id="@+id/card_background" 30 android:visibility="gone" 31 android:layout_width="match_parent" 32 android:layout_height="match_parent"> 33 34 <com.android.car.apps.common.CrossfadeImageView 35 android:id="@+id/card_background_image" 36 android:layout_width="match_parent" 37 android:layout_height="match_parent" 38 android:scaleType="centerCrop"/> 39 40 <View 41 android:id="@+id/card_background_scrim" 42 android:layout_width="match_parent" 43 android:layout_height="match_parent" 44 android:focusable="false" 45 android:background="@color/card_background_scrim" 46 android:alpha="@dimen/card_background_scrim_alpha"/> 47 </FrameLayout> 48 49 <androidx.constraintlayout.widget.ConstraintLayout 50 android:layout_height="match_parent" 51 android:layout_width="match_parent" 52 android:layout_marginEnd="@dimen/card_content_margin" 53 android:layout_marginStart="@dimen/card_content_margin"> 54 55 <ImageView 56 android:id="@+id/card_icon" 57 android:layout_height="@dimen/card_icon_size" 58 android:layout_width="@dimen/card_icon_size" 59 app:layout_constraintTop_toTopOf="@+id/card_name" 60 app:layout_constraintBottom_toBottomOf="@+id/card_name" 61 app:layout_constraintStart_toStartOf="parent"/> 62 63 <TextView 64 android:id="@+id/card_name" 65 android:layout_height="wrap_content" 66 android:layout_width="0dp" 67 android:layout_marginStart="@dimen/card_name_margin_start" 68 android:layout_marginTop="@dimen/card_content_margin" 69 android:singleLine="true" 70 android:textAppearance="?android:attr/textAppearanceSmall" 71 app:layout_constraintTop_toTopOf="parent" 72 app:layout_constraintStart_toEndOf="@+id/card_icon" 73 app:layout_constraintEnd_toEndOf="parent"/> 74 75 <!-- Card Content can be displayed using one of the following layouts --> 76 <FrameLayout 77 android:layout_height="0dp" 78 android:layout_width="match_parent" 79 app:layout_constraintTop_toBottomOf="@+id/card_name" 80 app:layout_constraintBottom_toBottomOf="parent"> 81 82 <ViewStub android:id="@+id/descriptive_text_layout" 83 android:inflatedId="@+id/descriptive_text_layout" 84 android:layout_height="match_parent" 85 android:layout_width="match_parent" 86 android:visibility="gone" 87 android:layout="@layout/card_content_descriptive_text_only"/> 88 89 <ViewStub android:id="@+id/text_block_layout" 90 android:inflatedId="@+id/text_block_layout" 91 android:layout_height="match_parent" 92 android:layout_width="match_parent" 93 android:visibility="gone" 94 android:layout="@layout/card_content_text_block"/> 95 96 <ViewStub android:id="@+id/descriptive_text_with_controls_layout" 97 android:inflatedId="@+id/descriptive_text_with_controls_layout" 98 android:layout_height="match_parent" 99 android:layout_width="match_parent" 100 android:visibility="gone" 101 android:layout="@layout/card_content_descriptive_text_with_controls"/> 102 103 <ViewStub android:id="@+id/media_layout" 104 android:inflatedId="@+id/media_layout" 105 android:layout_height="match_parent" 106 android:layout_width="match_parent" 107 android:visibility="gone" 108 android:layout="@layout/card_content_media"/> 109 </FrameLayout> 110 </androidx.constraintlayout.widget.ConstraintLayout> 111 <include layout="@layout/optional_seek_bar_with_times" 112 android:id="@+id/optional_seek_bar_with_times_container"/> 113</androidx.cardview.widget.CardView> 114