1<?xml version="1.0" encoding="utf-8"?>
2<!--
3     Copyright (C) 2015 The Android Open Source Project
4
5     Licensed under the Apache License, Version 2.0 (the "License");
6     you may not use this file except in compliance with the License.
7     You may obtain a copy of the License at
8
9          http://www.apache.org/licenses/LICENSE-2.0
10
11     Unless required by applicable law or agreed to in writing, software
12     distributed under the License is distributed on an "AS IS" BASIS,
13     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14     See the License for the specific language governing permissions and
15     limitations under the License.
16-->
17
18<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
19              xmlns:app="http://schemas.android.com/apk/res-auto"
20              android:layout_width="match_parent"
21              android:layout_height="match_parent"
22              android:orientation="vertical"
23              android:padding="16dp">
24
25    <android.support.design.widget.TextInputLayout
26            android:id="@+id/input_username"
27            android:layout_width="match_parent"
28            android:layout_height="wrap_content"
29            app:errorEnabled="true">
30
31        <android.support.design.widget.TextInputEditText
32                android:id="@+id/edit_username"
33                android:layout_width="match_parent"
34                android:layout_height="wrap_content"
35                android:hint="@string/form_username"/>
36
37    </android.support.design.widget.TextInputLayout>
38
39    <LinearLayout android:layout_width="match_parent"
40                  android:layout_height="wrap_content"
41                  android:orientation="horizontal">
42
43        <Button
44                android:layout_width="wrap_content"
45                android:layout_height="wrap_content"
46                android:text="@string/show_error"
47                android:onClick="showError"/>
48
49        <Button
50                android:layout_width="wrap_content"
51                android:layout_height="wrap_content"
52                android:text="@string/clear_error"
53                android:onClick="clearError"/>
54
55    </LinearLayout>
56
57    <android.support.design.widget.TextInputLayout
58            android:id="@+id/input_email"
59            android:layout_width="match_parent"
60            android:layout_height="wrap_content"
61            android:layout_marginTop="8dp"
62            app:errorEnabled="true">
63
64        <android.support.design.widget.TextInputEditText
65                android:id="@+id/edit_email"
66                android:layout_width="match_parent"
67                android:layout_height="wrap_content"
68                android:hint="@string/form_email"/>
69
70    </android.support.design.widget.TextInputLayout>
71
72    <android.support.design.widget.TextInputLayout
73            android:id="@+id/input_description"
74            android:layout_width="match_parent"
75            android:layout_height="wrap_content"
76            android:layout_marginTop="8dp"
77            app:counterEnabled="true"
78            app:counterMaxLength="30">
79
80        <EditText
81                android:id="@+id/edit_description"
82                android:layout_width="match_parent"
83                android:layout_height="wrap_content"
84                android:hint="@string/form_description"/>
85
86    </android.support.design.widget.TextInputLayout>
87
88</LinearLayout>