|
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 xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" |
3 | 4 | xmlns:tools="http://schemas.android.com/tools"
|
4 | 5 | android:layout_width="match_parent"
|
5 | 6 | android:layout_height="match_parent"
|
6 |
| - android:paddingBottom="@dimen/activity_vertical_margin" |
7 | 7 | android:paddingLeft="@dimen/activity_horizontal_margin"
|
| 8 | + android:paddingTop="@dimen/activity_vertical_margin" |
8 | 9 | android:paddingRight="@dimen/activity_horizontal_margin"
|
9 |
| - android:paddingTop="@dimen/activity_vertical_margin"> |
| 10 | + android:paddingBottom="@dimen/activity_vertical_margin"> |
10 | 11 |
|
11 | 12 | <include
|
12 | 13 | android:id="@+id/postAuthorLayout"
|
13 | 14 | layout="@layout/include_post_author"
|
14 | 15 | android:layout_width="wrap_content"
|
15 | 16 | android:layout_height="wrap_content"
|
16 |
| - android:layout_alignParentLeft="true" /> |
| 17 | + app:layout_constraintStart_toStartOf="parent" |
| 18 | + app:layout_constraintTop_toTopOf="parent" /> |
17 | 19 |
|
18 | 20 | <include
|
19 | 21 | android:id="@+id/postTextLayout"
|
20 | 22 | layout="@layout/include_post_text"
|
21 | 23 | android:layout_width="wrap_content"
|
22 | 24 | android:layout_height="wrap_content"
|
23 |
| - android:layout_alignParentLeft="true" |
24 |
| - android:layout_below="@+id/postAuthorLayout" |
25 |
| - android:layout_marginLeft="5dp" |
26 |
| - android:layout_marginTop="10dp" /> |
| 25 | + android:layout_marginStart="8dp" |
| 26 | + android:layout_marginLeft="8dp" |
| 27 | + android:layout_marginTop="8dp" |
| 28 | + app:layout_constraintStart_toStartOf="parent" |
| 29 | + app:layout_constraintTop_toBottomOf="@+id/postAuthorLayout" /> |
27 | 30 |
|
28 |
| - <LinearLayout |
29 |
| - android:id="@+id/commentForm" |
30 |
| - android:layout_width="match_parent" |
| 31 | + <EditText |
| 32 | + android:id="@+id/fieldCommentText" |
| 33 | + android:layout_width="0dp" |
31 | 34 | android:layout_height="wrap_content"
|
32 |
| - android:orientation="horizontal" |
33 |
| - android:layout_below="@+id/postTextLayout" |
34 |
| - android:layout_marginTop="20dp" |
35 |
| - android:weightSum="1.0"> |
| 35 | + android:layout_marginTop="16dp" |
| 36 | + android:hint="Write a comment..." |
| 37 | + android:maxLines="1" |
| 38 | + app:layout_constraintEnd_toStartOf="@+id/buttonPostComment" |
| 39 | + app:layout_constraintHorizontal_bias="0.5" |
| 40 | + app:layout_constraintHorizontal_weight="8" |
| 41 | + app:layout_constraintStart_toStartOf="parent" |
| 42 | + app:layout_constraintTop_toBottomOf="@+id/postTextLayout" /> |
36 | 43 |
|
37 |
| - <EditText |
38 |
| - android:id="@+id/fieldCommentText" |
39 |
| - android:layout_width="0dp" |
40 |
| - android:layout_weight="0.8" |
41 |
| - android:layout_height="wrap_content" |
42 |
| - android:maxLines="1" |
43 |
| - android:hint="Write a comment..."/> |
44 |
| - |
45 |
| - <com.google.android.material.button.MaterialButton |
46 |
| - android:id="@+id/buttonPostComment" |
47 |
| - style="@style/Widget.MaterialComponents.Button.TextButton" |
48 |
| - android:layout_width="0dp" |
49 |
| - android:layout_weight="0.2" |
50 |
| - android:layout_height="wrap_content" |
51 |
| - android:text="Post"/> |
52 |
| - |
53 |
| - </LinearLayout> |
| 44 | + <com.google.android.material.button.MaterialButton |
| 45 | + android:id="@+id/buttonPostComment" |
| 46 | + style="@style/Widget.MaterialComponents.Button.TextButton" |
| 47 | + android:layout_width="0dp" |
| 48 | + android:layout_height="wrap_content" |
| 49 | + android:text="Post" |
| 50 | + app:layout_constraintEnd_toEndOf="parent" |
| 51 | + app:layout_constraintHorizontal_bias="0.5" |
| 52 | + app:layout_constraintHorizontal_weight="2" |
| 53 | + app:layout_constraintStart_toEndOf="@+id/fieldCommentText" |
| 54 | + app:layout_constraintTop_toTopOf="@+id/fieldCommentText" /> |
54 | 55 |
|
55 | 56 | <androidx.recyclerview.widget.RecyclerView
|
56 | 57 | android:id="@+id/recyclerPostComments"
|
57 |
| - android:layout_width="match_parent" |
58 |
| - android:layout_height="match_parent" |
59 |
| - android:layout_below="@+id/commentForm" |
| 58 | + android:layout_width="0dp" |
| 59 | + android:layout_height="0dp" |
| 60 | + app:layout_constraintBottom_toBottomOf="parent" |
| 61 | + app:layout_constraintEnd_toEndOf="parent" |
| 62 | + app:layout_constraintStart_toStartOf="parent" |
| 63 | + app:layout_constraintTop_toBottomOf="@+id/buttonPostComment" |
60 | 64 | tools:listitem="@layout/item_comment" />
|
61 | 65 |
|
62 |
| -</RelativeLayout> |
| 66 | +</androidx.constraintlayout.widget.ConstraintLayout> |
0 commit comments