mvvm java

Solutions on MaxInterview for mvvm java by the best coders in the world

showing results for - "mvvm java"
Sofia
28 Aug 2018
1
2<?xml version="1.0" encoding="utf-8"?>
3<layout xmlns:android="https://schemas.android.com/apk/res/android"
4    xmlns:bind="https://schemas.android.com/tools">
5
6    <data>
7
8        <variable
9            name="viewModel"
10            type="com.journaldev.androidmvvmbasics.viewmodels.LoginViewModel" />
11    </data>
12
13
14    <ScrollView
15        android:layout_width="match_parent"
16        android:layout_height="match_parent">
17
18        <LinearLayout
19            android:layout_width="match_parent"
20            android:layout_height="wrap_content"
21            android:layout_gravity="center"
22            android:layout_margin="8dp"
23            android:orientation="vertical">
24
25            <EditText
26                android:id="@+id/inEmail"
27                android:layout_width="match_parent"
28                android:layout_height="wrap_content"
29                android:hint="Email"
30                android:inputType="textEmailAddress"
31                android:padding="8dp"
32                android:text="@={viewModel.userEmail}" />
33
34
35            <EditText
36                android:id="@+id/inPassword"
37                android:layout_width="match_parent"
38                android:layout_height="wrap_content"
39                android:hint="Password"
40                android:inputType="textPassword"
41                android:padding="8dp"
42                android:text="@={viewModel.userPassword}" />
43
44
45            <Button
46                android:layout_width="match_parent"
47                android:layout_height="wrap_content"
48                android:layout_marginTop="8dp"
49                android:onClick="@{()-> viewModel.onLoginClicked()}"
50                android:text="LOGIN"
51                bind:toastMessage="@{viewModel.toastMessage}" />
52
53
54        </LinearLayout>
55
56    </ScrollView>
57
58</layout>
59