<?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.example.sprout.refactor.viewmodel.RegistrationViewModel" /> </data> <android.support.constraint.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="@dimen/layout_outside_margin"> <EditText android:id="@+id/edit_user_name" android:layout_width="0dp" android:layout_height="wrap_content" android:text="@={viewModel.editUserName}" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="@{() -> viewModel.onClickRegistration(viewModel.editUserName.get())}" android:text="@string/registration" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/edit_user_name" /> </android.support.constraint.ConstraintLayout> </layout>