|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | | -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 2 | +<androidx.constraintlayout.widget.ConstraintLayout |
| 3 | + xmlns:android="http://schemas.android.com/apk/res/android" |
3 | 4 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | 5 | xmlns:tools="http://schemas.android.com/tools" |
5 | 6 | android:layout_width="match_parent" |
|
12 | 13 | android:layout_height="wrap_content" |
13 | 14 | android:background="@color/colorPrimary" |
14 | 15 | android:theme="@style/AppTheme" |
| 16 | + app:layout_constraintEnd_toEndOf="parent" |
| 17 | + app:layout_constraintStart_toStartOf="parent" |
| 18 | + app:layout_constraintTop_toTopOf="parent" |
15 | 19 | app:logo="@drawable/ic_restaurant_white_24px" |
16 | 20 | app:popupTheme="@style/Theme.AppCompat.Light.DarkActionBar" |
17 | 21 | app:title="@string/app_name" |
|
22 | 26 | android:id="@+id/filterBarContainer" |
23 | 27 | android:layout_width="match_parent" |
24 | 28 | android:layout_height="wrap_content" |
25 | | - android:layout_below="@+id/toolbar" |
26 | 29 | android:background="@color/colorPrimary" |
27 | | - android:paddingBottom="12dp" |
28 | 30 | android:paddingLeft="12dp" |
29 | | - android:paddingRight="12dp"> |
| 31 | + android:paddingRight="12dp" |
| 32 | + android:paddingBottom="12dp" |
| 33 | + app:layout_constraintEnd_toEndOf="parent" |
| 34 | + app:layout_constraintStart_toStartOf="parent" |
| 35 | + app:layout_constraintTop_toBottomOf="@+id/toolbar"> |
30 | 36 |
|
31 | 37 | <androidx.cardview.widget.CardView |
32 | 38 | android:id="@+id/filterBar" |
|
36 | 42 | android:elevation="12dp" |
37 | 43 | android:foreground="?attr/selectableItemBackground"> |
38 | 44 |
|
39 | | - <RelativeLayout |
| 45 | + <androidx.constraintlayout.widget.ConstraintLayout |
40 | 46 | android:layout_width="match_parent" |
41 | 47 | android:layout_height="wrap_content" |
42 | | - android:gravity="center_vertical"> |
| 48 | + android:paddingTop="8dp" |
| 49 | + android:paddingBottom="8dp"> |
43 | 50 |
|
44 | 51 | <ImageView |
45 | 52 | android:id="@+id/buttonFilter" |
46 | 53 | android:layout_width="wrap_content" |
47 | 54 | android:layout_height="wrap_content" |
48 | 55 | android:layout_centerVertical="true" |
49 | | - android:padding="8dp" |
50 | | - app:tint="@color/greySecondary" |
51 | | - app:srcCompat="@drawable/ic_filter_list_white_24px" /> |
52 | | - |
53 | | - <LinearLayout |
54 | | - android:id="@+id/textCurrentSearchContainer" |
| 56 | + android:layout_marginLeft="8dp" |
| 57 | + android:layout_marginRight="8dp" |
| 58 | + app:layout_constraintBottom_toBottomOf="parent" |
| 59 | + app:layout_constraintStart_toStartOf="parent" |
| 60 | + app:layout_constraintTop_toTopOf="parent" |
| 61 | + app:srcCompat="@drawable/ic_filter_list_white_24px" |
| 62 | + app:tint="@color/greySecondary" /> |
| 63 | + |
| 64 | + <TextView |
| 65 | + android:id="@+id/textCurrentSearch" |
| 66 | + style="@style/AppTheme.Body1" |
55 | 67 | android:layout_width="wrap_content" |
56 | 68 | android:layout_height="wrap_content" |
57 | | - android:layout_centerVertical="true" |
58 | | - android:layout_marginLeft="8dp" |
59 | | - android:layout_toRightOf="@+id/buttonFilter" |
60 | | - android:orientation="vertical" |
61 | | - android:paddingBottom="8dp" |
62 | | - android:paddingTop="8dp"> |
63 | | - |
64 | | - <TextView |
65 | | - android:id="@+id/textCurrentSearch" |
66 | | - style="@style/AppTheme.Body1" |
67 | | - android:layout_width="wrap_content" |
68 | | - android:layout_height="wrap_content" |
69 | | - android:text="@string/all_restaurants" |
70 | | - android:textColor="@color/greySecondary" |
71 | | - tools:text="Filter" /> |
72 | | - |
73 | | - <TextView |
74 | | - android:id="@+id/textCurrentSortBy" |
75 | | - style="@style/AppTheme.Caption" |
76 | | - android:layout_width="wrap_content" |
77 | | - android:layout_height="wrap_content" |
78 | | - android:text="@string/sorted_by_rating" |
79 | | - android:textColor="@color/greyDisabled" /> |
80 | | - |
81 | | - </LinearLayout> |
| 69 | + android:layout_marginStart="16dp" |
| 70 | + android:layout_marginLeft="16dp" |
| 71 | + android:text="@string/all_restaurants" |
| 72 | + android:textColor="@color/greySecondary" |
| 73 | + app:layout_constraintStart_toEndOf="@+id/buttonFilter" |
| 74 | + app:layout_constraintTop_toTopOf="parent" |
| 75 | + tools:text="Filter" /> |
| 76 | + |
| 77 | + <TextView |
| 78 | + android:id="@+id/textCurrentSortBy" |
| 79 | + style="@style/AppTheme.Caption" |
| 80 | + android:layout_width="wrap_content" |
| 81 | + android:layout_height="wrap_content" |
| 82 | + android:text="@string/sorted_by_rating" |
| 83 | + android:textColor="@color/greyDisabled" |
| 84 | + app:layout_constraintBottom_toBottomOf="parent" |
| 85 | + app:layout_constraintStart_toStartOf="@+id/textCurrentSearch" |
| 86 | + app:layout_constraintTop_toBottomOf="@+id/textCurrentSearch" /> |
82 | 87 |
|
83 | 88 | <ImageView |
84 | 89 | android:id="@+id/buttonClearFilter" |
85 | 90 | android:layout_width="wrap_content" |
86 | 91 | android:layout_height="wrap_content" |
87 | | - android:layout_alignParentRight="true" |
88 | 92 | android:layout_centerVertical="true" |
| 93 | + android:layout_marginEnd="8dp" |
| 94 | + android:layout_marginRight="8dp" |
89 | 95 | android:padding="8dp" |
90 | | - app:tint="@color/greySecondary" |
91 | | - app:srcCompat="@drawable/ic_close_white_24px" /> |
| 96 | + app:layout_constraintBottom_toBottomOf="parent" |
| 97 | + app:layout_constraintEnd_toEndOf="parent" |
| 98 | + app:layout_constraintTop_toTopOf="parent" |
| 99 | + app:srcCompat="@drawable/ic_close_white_24px" |
| 100 | + app:tint="@color/greySecondary" /> |
92 | 101 |
|
93 | | - </RelativeLayout> |
| 102 | + </androidx.constraintlayout.widget.ConstraintLayout> |
94 | 103 |
|
95 | 104 | </androidx.cardview.widget.CardView> |
96 | 105 |
|
|
100 | 109 | <androidx.recyclerview.widget.RecyclerView |
101 | 110 | android:id="@+id/recyclerRestaurants" |
102 | 111 | android:layout_width="match_parent" |
103 | | - android:layout_height="wrap_content" |
104 | | - android:layout_below="@+id/filterBarContainer" |
| 112 | + android:layout_height="0dp" |
105 | 113 | android:background="@android:color/white" |
| 114 | + app:layout_constraintBottom_toBottomOf="parent" |
| 115 | + app:layout_constraintEnd_toEndOf="parent" |
| 116 | + app:layout_constraintStart_toStartOf="parent" |
| 117 | + app:layout_constraintTop_toBottomOf="@+id/filterBarContainer" |
106 | 118 | tools:listitem="@layout/item_restaurant" /> |
107 | 119 |
|
108 | 120 | <!-- Shadow below toolbar --> |
109 | 121 | <View |
| 122 | + android:id="@+id/view" |
110 | 123 | android:layout_width="match_parent" |
111 | 124 | android:layout_height="4dp" |
112 | | - android:layout_below="@+id/filterBarContainer" |
113 | | - android:background="@drawable/bg_shadow" /> |
| 125 | + android:background="@drawable/bg_shadow" |
| 126 | + app:layout_constraintTop_toBottomOf="@+id/filterBarContainer" |
| 127 | + /> |
114 | 128 |
|
115 | 129 | <!-- Empty list (pizza guy) view --> |
116 | 130 | <LinearLayout |
117 | 131 | android:id="@+id/viewEmpty" |
118 | 132 | android:layout_width="wrap_content" |
119 | 133 | android:layout_height="wrap_content" |
120 | | - android:layout_alignParentBottom="true" |
121 | | - android:layout_below="@+id/toolbar" |
122 | | - android:layout_centerHorizontal="true" |
123 | | - android:gravity="center" |
124 | 134 | android:orientation="vertical" |
125 | 135 | android:visibility="gone" |
| 136 | + app:layout_constraintBottom_toBottomOf="parent" |
| 137 | + app:layout_constraintEnd_toEndOf="parent" |
| 138 | + app:layout_constraintStart_toStartOf="parent" |
| 139 | + app:layout_constraintTop_toBottomOf="@+id/toolbar" |
| 140 | + tools:ignore="UseCompoundDrawables" |
126 | 141 | tools:visibility="gone"> |
127 | 142 |
|
128 | 143 | <ImageView |
|
133 | 148 | style="@style/AppTheme.Body1" |
134 | 149 | android:layout_width="wrap_content" |
135 | 150 | android:layout_height="wrap_content" |
136 | | - android:gravity="center" |
137 | 151 | android:text="@string/message_no_results" |
138 | 152 | android:textColor="@color/greyDisabled" /> |
139 | 153 |
|
|
143 | 157 | android:id="@+id/progressLoading" |
144 | 158 | android:layout_width="wrap_content" |
145 | 159 | android:layout_height="wrap_content" |
146 | | - android:layout_alignBottom="@+id/recyclerRestaurants" |
147 | | - android:layout_alignTop="@+id/recyclerRestaurants" |
148 | 160 | android:layout_centerHorizontal="true" |
149 | | - android:visibility="gone" /> |
| 161 | + android:visibility="gone" |
| 162 | + app:layout_constraintBottom_toBottomOf="@+id/recyclerRestaurants" |
| 163 | + app:layout_constraintEnd_toEndOf="parent" |
| 164 | + app:layout_constraintStart_toStartOf="parent" |
| 165 | + app:layout_constraintTop_toTopOf="@+id/recyclerRestaurants" |
| 166 | + /> |
150 | 167 |
|
151 | | -</RelativeLayout> |
| 168 | +</androidx.constraintlayout.widget.ConstraintLayout> |
0 commit comments