This repository has been archived by the owner on Oct 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 496
/
activity_basic.xml
81 lines (65 loc) · 2.66 KB
/
activity_basic.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
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="me.liangfei.databinding.model.User" />
<import type="me.liangfei.databinding.utils.MyStringUtils" alias="StringUtils" />
<import type="android.view.View" />
<variable name="user" type="me.liangfei.databinding.model.User" />
</data>
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp">
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="Display Name: " />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{user.displayName ?? user.lastName}" />
</TableRow>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="First Name: " />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{StringUtils.capitalize(user.firstName)}" />
</TableRow>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="Last Name: " />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{user.lastName}" />
</TableRow>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="Age: " />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.valueOf(user.age)}" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Adult"
android:textColor="@android:color/holo_red_light"
android:textStyle="italic"
android:visibility="@{user.isAdult ? View.VISIBLE : View.GONE}" />
</TableRow>
</TableLayout>
</layout>