activity_enter_name.xml

 1<?xml version="1.0" encoding="utf-8"?>
 2<layout xmlns:android="http://schemas.android.com/apk/res/android">
 3
 4    <LinearLayout
 5        android:layout_width="match_parent"
 6        android:layout_height="match_parent"
 7        android:fitsSystemWindows="true"
 8        android:orientation="vertical">
 9
10
11        <com.google.android.material.appbar.AppBarLayout
12            android:layout_width="match_parent"
13            android:layout_height="wrap_content">
14
15            <com.google.android.material.appbar.MaterialToolbar
16                android:id="@+id/toolbar"
17                android:layout_width="match_parent"
18                android:layout_height="wrap_content"
19                android:minHeight="?attr/actionBarSize" />
20
21        </com.google.android.material.appbar.AppBarLayout>
22
23        <ScrollView
24            android:layout_width="match_parent"
25            android:layout_height="match_parent"
26            android:fillViewport="true">
27
28            <RelativeLayout
29                android:layout_width="match_parent"
30                android:layout_height="wrap_content">
31
32                <TextView
33                    android:id="@+id/instructions"
34                    android:layout_width="wrap_content"
35                    android:layout_height="wrap_content"
36                    android:layout_margin="16dp"
37                    android:gravity="center_horizontal"
38                    android:text="@string/enter_your_name_instructions"
39                    android:textAppearance="?textAppearanceBodyMedium" />
40
41                <LinearLayout
42                    android:id="@+id/name_box"
43                    android:layout_width="256dp"
44                    android:layout_height="wrap_content"
45                    android:layout_above="@+id/next"
46                    android:layout_below="@+id/instructions"
47                    android:layout_centerHorizontal="true"
48                    android:orientation="vertical">
49
50                    <com.google.android.material.textfield.TextInputLayout
51                        android:layout_width="match_parent"
52                        android:layout_height="wrap_content"
53                        android:hint="@string/your_name">
54
55                        <EditText
56                            android:id="@+id/name"
57                            android:layout_width="match_parent"
58                            android:layout_height="wrap_content"
59
60                            android:imeOptions="flagNoExtractUi" />
61
62                    </com.google.android.material.textfield.TextInputLayout>
63
64
65                </LinearLayout>
66
67                <Button
68                    android:id="@+id/next"
69                    style="@style/Widget.Material3.Button.ElevatedButton"
70                    android:layout_width="wrap_content"
71                    android:layout_height="wrap_content"
72                    android:layout_alignParentEnd="true"
73                    android:layout_alignParentBottom="true"
74                    android:layout_margin="16dp"
75                    android:text="@string/next" />
76            </RelativeLayout>
77        </ScrollView>
78    </LinearLayout>
79</layout>