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