<?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" xmlns:tools="http://schemas.android.com/tools"> <data> <import type="java.util.Map"/> <import type="java.util.List"/> <variable name="list" type="List<String>" /> <variable name="index" type="Integer" /> <variable name="user" type="com.bw.day01.User" /> <variable name="view" type="android.view.View" /> <variable name="presenter" type="com.bw.day01.Presenter" /> <variable name="userinfo" type="com.bw.day01.UserInfo" /> <variable name="map" type="Map<String,Object>"/> <variable name="key" type="String"/> </data> <LinearLayout android:layout_width="match_parent" android:orientation="vertical" android:layout_height="match_parent" tools:context=".MainActivity2"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@{user.name}" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@{String.valueOf(user.age)}" android:visibility="@{user.age>20?view.GONE:view.VISIBLE}" /> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/et_text" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@{etText.text}" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@{list[index]}" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@{String.valueOf(map.get(key))}" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="事件绑定" android:onClick="@{()->presenter.OnSave()}" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@{userinfo.name}" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@{presenter.field}" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="可观察对象" android:onClick="@{()->presenter.OnSave2(userinfo)}" /> </LinearLayout> </layout>
讯享网
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/110545.html