1<?xml version="1.0" encoding="utf-8"?><!--
2     Copyright (C) 2015 The Android Open Source Project
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8          http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15-->
16<ScrollView
17        xmlns:android="http://schemas.android.com/apk/res/android"
18        xmlns:app="http://schemas.android.com/apk/res-auto"
19        android:layout_width="match_parent"
20        android:layout_height="match_parent">
21
22    <LinearLayout
23        android:layout_width="match_parent"
24        android:layout_height="wrap_content"
25        android:orientation="vertical"
26        android:padding="16dp">
27
28        <com.google.android.material.textfield.TextInputLayout
29            android:id="@+id/input_username"
30            android:layout_width="match_parent"
31            android:layout_height="wrap_content"
32            app:errorEnabled="true">
33
34            <com.google.android.material.textfield.TextInputEditText
35                android:id="@+id/edit_username"
36                android:layout_width="match_parent"
37                android:layout_height="wrap_content"
38                android:hint="@string/form_username" />
39
40        </com.google.android.material.textfield.TextInputLayout>
41
42        <LinearLayout
43            android:layout_width="match_parent"
44            android:layout_height="wrap_content"
45            android:orientation="horizontal">
46
47            <Button
48                android:layout_width="wrap_content"
49                android:layout_height="wrap_content"
50                android:onClick="showError"
51                android:text="@string/show_error" />
52
53            <Button
54                android:layout_width="wrap_content"
55                android:layout_height="wrap_content"
56                android:onClick="clearError"
57                android:text="@string/clear_error" />
58
59            <Button
60                android:layout_width="wrap_content"
61                android:layout_height="wrap_content"
62                android:onClick="toggleEnabled"
63                android:text="@string/toggle_enabled" />
64
65        </LinearLayout>
66
67        <com.google.android.material.textfield.TextInputLayout
68            android:id="@+id/input_email"
69            android:layout_width="match_parent"
70            android:layout_height="wrap_content"
71            android:layout_marginTop="8dp"
72            app:errorEnabled="true">
73
74            <com.google.android.material.textfield.TextInputEditText
75                android:id="@+id/edit_email"
76                android:layout_width="match_parent"
77                android:layout_height="wrap_content"
78                android:hint="@string/form_email" />
79
80        </com.google.android.material.textfield.TextInputLayout>
81
82        <com.google.android.material.textfield.TextInputLayout
83            android:id="@+id/input_description"
84            android:layout_width="match_parent"
85            android:layout_height="wrap_content"
86            android:layout_marginTop="8dp"
87            app:counterEnabled="true"
88            app:counterMaxLength="30">
89
90            <EditText
91                android:id="@+id/edit_description"
92                android:layout_width="match_parent"
93                android:layout_height="wrap_content"
94                android:hint="@string/form_description" />
95
96        </com.google.android.material.textfield.TextInputLayout>
97
98        <com.google.android.material.textfield.TextInputLayout
99            android:id="@+id/input_auto_complete"
100            android:layout_width="match_parent"
101            android:layout_height="wrap_content"
102            android:layout_marginTop="8dp"
103            app:counterEnabled="true"
104            app:counterMaxLength="30">
105
106            <AutoCompleteTextView
107                android:id="@+id/edit_auto_complete"
108                android:layout_width="match_parent"
109                android:layout_height="wrap_content"
110                android:hint="@string/form_auto_complete" />
111
112        </com.google.android.material.textfield.TextInputLayout>
113
114        <com.google.android.material.textfield.TextInputLayout
115            android:id="@+id/input_password"
116            android:layout_width="match_parent"
117            android:layout_height="wrap_content"
118            android:layout_marginTop="8dp"
119            app:passwordToggleEnabled="true">
120
121            <EditText
122                android:id="@+id/edit_password"
123                android:layout_width="match_parent"
124                android:layout_height="wrap_content"
125                android:hint="@string/form_password"
126                android:inputType="textPassword" />
127
128        </com.google.android.material.textfield.TextInputLayout>
129
130        <LinearLayout
131            android:layout_width="match_parent"
132            android:layout_height="wrap_content"
133            android:orientation="horizontal">
134
135            <Button
136                android:layout_width="wrap_content"
137                android:layout_height="wrap_content"
138                android:onClick="setPasswordEnabled"
139                android:text="@string/password_enable" />
140
141            <Button
142                android:layout_width="wrap_content"
143                android:layout_height="wrap_content"
144                android:onClick="setPasswordDisabled"
145                android:text="@string/password_disable" />
146
147        </LinearLayout>
148
149    </LinearLayout>
150
151</ScrollView>