Skip to content

Instantly share code, notes, and snippets.

@chetdeva
Last active October 13, 2017 12:21
Show Gist options
  • Select an option

  • Save chetdeva/e1d7e7059d17a7a73448f181e48eb30f to your computer and use it in GitHub Desktop.

Select an option

Save chetdeva/e1d7e7059d17a7a73448f181e48eb30f to your computer and use it in GitHub Desktop.
<?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>
<variable
name="model"
type="com.fueled.loginbindings.LoginModel"/>
<variable
name="handler"
type="com.fueled.loginbindings.MainHandler"/>
</data>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
tools:context="com.fueled.loginbindings.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="@+id/username_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/email"
android:imeOptions="actionNext"
android:text="@={model.email}"/>
<EditText
android:id="@+id/password_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/password"
android:imeOptions="actionDone"
android:inputType="textPassword"
android:text="@={model.password}"/>
<Button
android:id="@+id/login_button"
style="@style/LoginButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/space_xlarge"
android:layout_marginTop="@dimen/space_xlarge"
android:enabled="@{model.loginEnabled}"
android:onClick="@{() -> handler.onLoginClicked(model.email, model.password)}"
android:text="@string/login"/>
</LinearLayout>
</ScrollView>
</layout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment