-
Notifications
You must be signed in to change notification settings - Fork 120
/
item_comment.xml
79 lines (65 loc) · 3.06 KB
/
item_comment.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
76
77
78
79
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable name="viewModel" type="com.hitherejoe.mvvm_hackernews.viewModel.CommentViewModel" />
</data>
<RelativeLayout
android:id="@+id/container_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:background="@color/dark_grey"
app:containerMargin="@{viewModel.commentIsTopLevel}">
<LinearLayout
android:id="@+id/comment_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/white"
app:commentDepth="@{viewModel.commentDepth}">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<TextView
android:id="@+id/text_post_author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="@{viewModel.commentAuthor}"
android:textColor="@color/black_87pc"
android:textSize="@dimen/text_body" />
<TextView
android:id="@+id/text_post_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/text_post_author"
android:text="@{viewModel.commentDate}"
android:textSize="@dimen/text_body"
android:textColor="@color/hn_orange" />
</RelativeLayout>
<TextView
android:id="@+id/text_comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web|email"
android:text="@{viewModel.commentText}"
android:textColor="@android:color/black"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/comment_item"
android:background="@color/light_grey" />
</RelativeLayout>
</layout>