1<?xml version="1.0" encoding="utf-8"?>
2<!--
3    Copyright (C) 2022 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    android:id="@+id/container"
22    android:layout_width="match_parent"
23    android:layout_height="wrap_content"
24    style="@style/DreamCardStyle"
25    android:clickable="true">
26
27    <androidx.constraintlayout.widget.ConstraintLayout
28        android:layout_width="match_parent"
29        android:layout_height="wrap_content"
30        android:minHeight="?android:attr/listPreferredItemHeight">
31
32        <ImageView
33            android:id="@+id/preview"
34            android:layout_width="0dp"
35            android:layout_height="0dp"
36            android:background="@drawable/dream_preview_rounded_bg"
37            android:importantForAccessibility="no"
38            app:layout_constraintDimensionRatio="1:1"
39            app:layout_constraintTop_toTopOf="parent"
40            app:layout_constraintStart_toStartOf="parent"
41            app:layout_constraintEnd_toEndOf="parent"/>
42
43        <ImageView
44            android:id="@+id/preview_placeholder"
45            android:layout_width="@dimen/dream_preview_placeholder_width"
46            android:layout_height="0dp"
47            android:src="@drawable/dream_default_preview_icon"
48            android:importantForAccessibility="no"
49            app:layout_constraintDimensionRatio="1:1"
50            app:layout_constraintTop_toTopOf="@+id/preview"
51            app:layout_constraintBottom_toBottomOf="@+id/preview"
52            app:layout_constraintStart_toStartOf="@+id/preview"
53            app:layout_constraintEnd_toEndOf="@+id/preview"/>
54
55        <Button
56            android:id="@+id/customize_button"
57            style="@style/ActionPrimaryButton"
58            android:layout_width="wrap_content"
59            android:layout_height="wrap_content"
60            android:visibility="gone"
61            android:text="@string/customize_button_title"
62            android:hyphenationFrequency="normalFast"
63            android:lineBreakWordStyle="phrase"
64            app:layout_constraintTop_toTopOf="@+id/preview"
65            app:layout_constraintBottom_toBottomOf="@+id/preview"
66            app:layout_constraintStart_toStartOf="@+id/preview"
67            app:layout_constraintEnd_toEndOf="@+id/preview"/>
68
69        <TextView
70            android:id="@+id/title_text"
71            android:layout_width="0dp"
72            android:layout_height="wrap_content"
73            android:layout_marginTop="@dimen/dream_item_title_margin_top"
74            android:layout_marginHorizontal="@dimen/dream_item_title_margin_horizontal"
75            android:layout_marginBottom="@dimen/dream_item_title_margin_bottom"
76            android:gravity="center_vertical"
77            android:maxLines="1"
78            android:ellipsize="end"
79            android:textSize="@dimen/dream_item_title_text_size"
80            android:textColor="@color/dream_card_text_color_state_list"
81            android:drawablePadding="@dimen/dream_item_icon_padding"
82            android:drawableTint="@color/dream_card_icon_color_state_list"
83            app:layout_constraintTop_toBottomOf="@+id/preview"
84            app:layout_constraintEnd_toEndOf="parent"
85            app:layout_constraintStart_toStartOf="parent"
86            app:layout_constraintBottom_toTopOf="@id/summary_text"/>
87
88        <TextView
89            android:id="@+id/summary_text"
90            android:layout_width="0dp"
91            android:layout_height="wrap_content"
92            android:layout_marginHorizontal="@dimen/dream_item_title_margin_horizontal"
93            android:layout_marginBottom="@dimen/dream_item_title_margin_bottom"
94            android:maxLines="2"
95            android:ellipsize="end"
96            android:textSize="@dimen/dream_item_summary_text_size"
97            android:textColor="@color/dream_card_summary_color_state_list"
98            app:layout_constraintTop_toBottomOf="@+id/title_text"
99            app:layout_constraintEnd_toEndOf="parent"
100            app:layout_constraintStart_toStartOf="parent"
101            app:layout_constraintBottom_toBottomOf="parent"/>
102
103    </androidx.constraintlayout.widget.ConstraintLayout>
104</androidx.cardview.widget.CardView>
105