|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | | -<layout> |
| 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" |
| 4 | + xmlns:tools="http://schemas.android.com/tools"> |
3 | 5 |
|
4 | 6 | <data> |
| 7 | + |
5 | 8 | <variable |
6 | 9 | name="item" |
7 | 10 | type="com.smarttoolfactory.domain.model.PropertyItem" /> |
8 | 11 | </data> |
9 | 12 |
|
10 | | - <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" |
11 | | - xmlns:app="http://schemas.android.com/apk/res-auto" |
| 13 | + <androidx.coordinatorlayout.widget.CoordinatorLayout |
12 | 14 | android:layout_width="match_parent" |
13 | 15 | android:layout_height="match_parent"> |
14 | 16 |
|
15 | | - |
16 | 17 | <com.google.android.material.appbar.AppBarLayout |
17 | 18 | android:id="@+id/appbar" |
18 | 19 | android:layout_width="match_parent" |
19 | | - android:layout_height="wrap_content"> |
| 20 | + android:layout_height="256dp" |
| 21 | + android:fitsSystemWindows="true" |
| 22 | + android:theme="@style/ThemeOverlay.AppCompat.ActionBar"> |
20 | 23 |
|
21 | 24 | <com.google.android.material.appbar.CollapsingToolbarLayout |
22 | 25 | android:id="@+id/collapsingToolbar" |
23 | 26 | android:layout_width="match_parent" |
24 | | - android:layout_height="200dp" |
25 | | - app:contentScrim="?attr/colorPrimary" |
| 27 | + android:layout_height="wrap_content" |
| 28 | + app:contentScrim="@color/white" |
26 | 29 | app:expandedTitleMarginEnd="64dp" |
27 | 30 | app:expandedTitleMarginStart="48dp" |
28 | 31 | app:layout_scrollFlags="scroll|exitUntilCollapsed"> |
29 | 32 |
|
30 | | - |
31 | | - <androidx.appcompat.widget.Toolbar |
32 | | - android:id="@+id/toolbar" |
| 33 | + <androidx.constraintlayout.widget.ConstraintLayout |
33 | 34 | android:layout_width="match_parent" |
34 | | - android:layout_height="?attr/actionBarSize" |
35 | | - app:layout_collapseMode="parallax" /> |
| 35 | + android:layout_height="match_parent"> |
| 36 | + |
| 37 | + <ImageView |
| 38 | + android:id="@+id/ivHeader" |
| 39 | + imageSrc="@{item.thumbnailBig}" |
| 40 | + android:layout_width="wrap_content" |
| 41 | + android:layout_height="match_parent" |
| 42 | + android:scaleType="centerCrop" |
| 43 | + android:src="@drawable/placeholder" |
| 44 | + app:layout_constraintBottom_toBottomOf="parent" |
| 45 | + app:layout_constraintEnd_toEndOf="parent" |
| 46 | + app:layout_constraintStart_toStartOf="parent" |
| 47 | + app:layout_constraintTop_toTopOf="parent" /> |
| 48 | + |
| 49 | + <TextView |
| 50 | + visibilityBasedOn="@{item.verified}" |
| 51 | + android:layout_width="wrap_content" |
| 52 | + android:layout_height="wrap_content" |
| 53 | + android:background="#66BB6A" |
| 54 | + android:paddingStart="10dp" |
| 55 | + android:paddingTop="2dp" |
| 56 | + android:paddingEnd="10dp" |
| 57 | + android:paddingBottom="2dp" |
| 58 | + android:text="VERIFIED" |
| 59 | + android:textColor="@color/white" |
| 60 | + android:textSize="16sp" |
| 61 | + android:translationZ="5dp" |
| 62 | + app:layout_constraintBottom_toBottomOf="@id/ivHeader" |
| 63 | + app:layout_constraintEnd_toEndOf="parent" |
| 64 | + app:layout_constraintStart_toStartOf="parent" /> |
| 65 | + |
| 66 | + </androidx.constraintlayout.widget.ConstraintLayout> |
| 67 | + |
36 | 68 | </com.google.android.material.appbar.CollapsingToolbarLayout> |
37 | 69 |
|
38 | 70 |
|
39 | 71 | </com.google.android.material.appbar.AppBarLayout> |
40 | 72 |
|
41 | | - |
42 | | - <androidx.constraintlayout.widget.ConstraintLayout |
| 73 | + <androidx.core.widget.NestedScrollView |
43 | 74 | android:layout_width="match_parent" |
44 | 75 | android:layout_height="match_parent" |
| 76 | + |
45 | 77 | app:layout_behavior="@string/appbar_scrolling_view_behavior"> |
46 | 78 |
|
47 | 79 | <LinearLayout |
48 | | - android:layout_width="wrap_content" |
49 | | - android:layout_height="3000dp" |
50 | | - android:background="#f00" |
51 | | - app:layout_constraintEnd_toEndOf="parent" |
52 | | - app:layout_constraintStart_toStartOf="parent" |
53 | | - app:layout_constraintTop_toTopOf="parent" /> |
54 | | - |
55 | | - </androidx.constraintlayout.widget.ConstraintLayout> |
| 80 | + android:layout_width="match_parent" |
| 81 | + android:layout_height="match_parent" |
| 82 | + android:orientation="vertical" |
| 83 | + android:paddingStart="16dp" |
| 84 | + android:paddingEnd="16dp"> |
| 85 | + |
| 86 | + <com.google.android.material.textview.MaterialTextView |
| 87 | + android:id="@+id/tvPrice" |
| 88 | + android:layout_width="match_parent" |
| 89 | + android:layout_height="wrap_content" |
| 90 | + android:layout_marginTop="12dp" |
| 91 | + android:gravity="center" |
| 92 | + android:maxLines="1" |
| 93 | + android:text="@{item.price + ` `+ item.currency}" |
| 94 | + android:textColor="@color/black" |
| 95 | + android:textSize="24sp" |
| 96 | + tools:text="249,000 AED" /> |
| 97 | + |
| 98 | + <com.google.android.material.textview.MaterialTextView |
| 99 | + android:id="@+id/tvTitle" |
| 100 | + android:layout_width="match_parent" |
| 101 | + android:layout_height="wrap_content" |
| 102 | + android:layout_marginTop="12dp" |
| 103 | + android:gravity="center" |
| 104 | + android:maxLines="1" |
| 105 | + android:text="@{item.title}" |
| 106 | + android:textColor="@color/black" |
| 107 | + android:textSize="16sp" |
| 108 | + tools:text="Apartment, 1 bed, 2 baths" /> |
| 109 | + |
| 110 | + <com.google.android.material.textview.MaterialTextView |
| 111 | + android:id="@+id/tvLocation" |
| 112 | + android:layout_width="match_parent" |
| 113 | + android:layout_height="wrap_content" |
| 114 | + android:layout_marginTop="16dp" |
| 115 | + android:gravity="center" |
| 116 | + android:maxLines="2" |
| 117 | + android:text="@{item.location}" |
| 118 | + android:textColor="#000" |
| 119 | + tools:text="Casa, Arabian Ranches 2, Dubai" /> |
| 120 | + |
| 121 | + |
| 122 | + <com.google.android.material.textview.MaterialTextView |
| 123 | + android:id="@+id/tvDescription" |
| 124 | + android:layout_width="match_parent" |
| 125 | + android:layout_height="wrap_content" |
| 126 | + android:layout_gravity="center_horizontal" |
| 127 | + android:layout_marginTop="16dp" |
| 128 | + |
| 129 | + android:gravity="center" |
| 130 | + android:maxLines="2" |
| 131 | + android:text="@{item.subject}" |
| 132 | + |
| 133 | + android:textColor="#000" |
| 134 | + tools:text="Stunning 1 Bed Apt with Burj Khalifa View" /> |
| 135 | + |
| 136 | + </LinearLayout> |
| 137 | + |
| 138 | + </androidx.core.widget.NestedScrollView> |
56 | 139 |
|
57 | 140 |
|
58 | 141 | </androidx.coordinatorlayout.widget.CoordinatorLayout> |
|
0 commit comments