1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- 3 Copyright 2018, 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 <android.support.v7.widget.CardView 18 xmlns:android="http://schemas.android.com/apk/res/android" 19 xmlns:app="http://schemas.android.com/apk/res-auto" 20 android:layout_height="match_parent" 21 android:layout_width="match_parent" 22 app:cardElevation="0dp" 23 app:cardCornerRadius="6dp"> 24 25 <com.android.car.media.common.CrossfadeImageView 26 android:id="@+id/album_background" 27 android:background="@color/car_dark_blue_grey_800" 28 android:layout_width="match_parent" 29 android:layout_height="match_parent" 30 android:scaleType="fitStart" /> 31 32 <View 33 android:id="@+id/playback_scrim" 34 android:layout_width="match_parent" 35 android:layout_height="match_parent" 36 android:background="@color/album_art_scrim" 37 android:alpha="@dimen/album_art_scrim_alpha"/> 38 39 <android.support.constraint.ConstraintLayout 40 xmlns:android="http://schemas.android.com/apk/res/android" 41 xmlns:app="http://schemas.android.com/apk/res-auto" 42 android:id="@+id/playback_container" 43 android:layout_width="match_parent" 44 android:layout_height="match_parent"> 45 46 <TextView 47 android:id="@+id/app_name" 48 android:layout_width="0dp" 49 android:layout_height="wrap_content" 50 android:layout_marginTop="@dimen/car_padding_4" 51 android:layout_marginLeft="@dimen/car_padding_4" 52 android:layout_marginRight="@dimen/car_padding_4" 53 android:textAppearance="@style/TextAppearance.Car.Body2.Light" 54 android:ellipsize="end" 55 android:maxLines="1" 56 android:includeFontPadding="false" 57 app:layout_constraintLeft_toLeftOf="parent" 58 app:layout_constraintRight_toLeftOf="@+id/app_icon" 59 app:layout_constraintTop_toTopOf="parent"/> 60 61 <ImageView 62 android:id="@+id/app_icon" 63 android:contentDescription="@string/album_art" 64 android:layout_marginRight="@dimen/car_padding_4" 65 android:layout_width="0dp" 66 android:layout_height="0dp" 67 android:scaleType="fitCenter" 68 app:layout_constraintDimensionRatio="W,1:1" 69 app:layout_constraintRight_toRightOf="parent" 70 app:layout_constraintTop_toTopOf="@+id/app_name" 71 app:layout_constraintBottom_toBottomOf="@+id/app_name"/> 72 73 74 <TextView 75 android:id="@+id/title" 76 android:layout_width="0dp" 77 android:layout_height="wrap_content" 78 android:layout_marginTop="@dimen/car_padding_4" 79 android:layout_marginLeft="@dimen/car_padding_4" 80 android:layout_marginRight="@dimen/car_padding_4" 81 android:textAppearance="@style/TextAppearance.Car.Body1.Light" 82 android:maxLines="1" 83 android:ellipsize="end" 84 android:includeFontPadding="false" 85 app:layout_constraintLeft_toLeftOf="parent" 86 app:layout_constraintRight_toRightOf="parent" 87 app:layout_constraintTop_toBottomOf="@+id/app_name"/> 88 89 <TextView 90 android:id="@+id/subtitle" 91 android:layout_width="0dp" 92 android:layout_height="wrap_content" 93 android:layout_marginTop="@dimen/car_padding_4" 94 android:layout_marginLeft="@dimen/car_padding_4" 95 android:layout_marginRight="@dimen/car_padding_4" 96 android:textAppearance="@style/TextAppearance.Car.Body2.Light" 97 android:ellipsize="end" 98 android:maxLines="1" 99 android:includeFontPadding="false" 100 app:layout_constraintLeft_toLeftOf="parent" 101 app:layout_constraintRight_toRightOf="parent" 102 app:layout_constraintTop_toBottomOf="@+id/title"/> 103 104 <android.support.constraint.Guideline 105 android:id="@+id/guideline" 106 android:layout_width="wrap_content" 107 android:layout_height="wrap_content" 108 app:layout_constraintGuide_begin="600dp" 109 android:orientation="vertical"/> 110 111 <android.support.constraint.Guideline 112 android:id="@+id/rightmost" 113 android:layout_width="wrap_content" 114 android:layout_height="wrap_content" 115 app:layout_constraintGuide_percent="1" 116 android:orientation="vertical"/> 117 118 <android.support.constraint.Barrier 119 android:id="@+id/barrier" 120 android:layout_width="wrap_content" 121 android:layout_height="wrap_content" 122 app:barrierDirection="left" 123 app:constraint_referenced_ids="guideline,rightmost" /> 124 125 <com.android.car.media.common.PlaybackControlsActionBar 126 android:id="@+id/playback_controls" 127 android:layout_width="0dp" 128 android:layout_height="wrap_content" 129 android:layout_marginStart="@dimen/car_padding_4" 130 android:layout_marginEnd="@dimen/car_padding_4" 131 android:layout_marginBottom="@dimen/car_padding_4" 132 app:columns="3" 133 app:layout_constraintBottom_toBottomOf="parent" 134 app:layout_constraintLeft_toLeftOf="parent" 135 app:layout_constraintRight_toRightOf="parent" 136 app:layout_constraintRight_toLeftOf="@+id/barrier"/> 137 138 </android.support.constraint.ConstraintLayout> 139 140 </android.support.v7.widget.CardView> 141