/
activity_static.xml
36 lines (26 loc) · 1013 Bytes
/
activity_static.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
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="android.view.View" />
<variable
name="user"
type="io.github.seniorzhai.databindingdemo.model.StaticUser" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{user.getName()}" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.format(`Age : %d`,user.age)}" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Adult"
android:visibility="@{user.isAudlt ? View.VISIBLE : View.GONE}" />
</LinearLayout>
</layout>