/
card_topic.xml
75 lines (68 loc) · 3.68 KB
/
card_topic.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?xml version="1.0" encoding="utf-8"?>
<!-- Updated Card Fragment https://material.io/develop/android/components/material-card-view/ -->
<com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/small_margin"
android:layout_marginTop="@dimen/small_margin"
android:layout_marginRight="@dimen/small_margin"
app:cardElevation="@dimen/card_elevation"
android:minHeight="200dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/topic_image"
android:layout_width="match_parent"
android:layout_height="194dp"
android:scaleType="centerCrop"
android:src="@drawable/example_image"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/topic_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/big_margin"
android:layout_marginLeft="@dimen/big_margin"
android:layout_marginTop="@dimen/big_margin"
android:text="@string/card_headline"
android:textColor="@color/textColorPrimary"
android:textSize="@dimen/headline_text_size"
android:textStyle="bold"
app:fontFamily="@font/work_sans_bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/topic_image" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/description_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/description_label"
android:textColor="@color/textColorSecondary"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/topic_name"
app:layout_constraintTop_toBottomOf="@+id/topic_name" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/topic_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/big_margin"
android:layout_marginLeft="@dimen/big_margin"
android:layout_marginTop="@dimen/big_margin"
android:layout_marginEnd="@dimen/big_margin"
android:layout_marginRight="@dimen/big_margin"
android:layout_marginBottom="24dp"
android:maxLines="4"
android:ellipsize="end"
android:text="@string/lorem_short"
android:textSize="@dimen/body_text_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/description_label" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>