Skip to content

Commit 65575f8

Browse files
committed
ui
1 parent e602cdd commit 65575f8

File tree

3 files changed

+152
-101
lines changed

3 files changed

+152
-101
lines changed
Lines changed: 50 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,72 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
7-
android:orientation="vertical"
87
tools:context=".LoginActivity">
98

10-
<com.google.android.material.appbar.AppBarLayout
9+
<LinearLayout
1110
android:layout_width="match_parent"
12-
android:layout_height="wrap_content">
13-
<com.google.android.material.appbar.MaterialToolbar
11+
android:layout_height="wrap_content"
12+
android:padding="5dp"
13+
android:orientation="vertical">
14+
15+
<com.google.android.material.appbar.AppBarLayout
16+
android:layout_width="match_parent"
17+
android:layout_height="wrap_content">
18+
<com.google.android.material.appbar.MaterialToolbar
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content"
21+
android:minHeight="?attr/actionBarSize"
22+
app:title="@string/str_login" />
23+
</com.google.android.material.appbar.AppBarLayout>
24+
25+
<com.google.android.material.textfield.TextInputLayout
1426
android:layout_width="match_parent"
1527
android:layout_height="wrap_content"
16-
android:minHeight="?attr/actionBarSize"
17-
app:title="@string/str_login" />
18-
</com.google.android.material.appbar.AppBarLayout>
28+
android:hint="@string/str_input_username">
1929

20-
<com.google.android.material.textfield.TextInputLayout
21-
android:layout_width="match_parent"
22-
android:layout_height="wrap_content"
23-
android:hint="@string/str_input_username">
30+
<com.google.android.material.textfield.TextInputEditText
31+
android:id="@+id/et_login_user"
32+
android:layout_width="match_parent"
33+
android:layout_height="wrap_content"
34+
android:lines="1"
35+
android:singleLine="true"
36+
/>
37+
38+
</com.google.android.material.textfield.TextInputLayout>
2439

25-
<com.google.android.material.textfield.TextInputEditText
26-
android:id="@+id/et_login_user"
40+
<com.google.android.material.textfield.TextInputLayout
2741
android:layout_width="match_parent"
2842
android:layout_height="wrap_content"
29-
android:lines="1"
30-
android:singleLine="true"
31-
/>
43+
android:hint="@string/str_input_password">
3244

33-
</com.google.android.material.textfield.TextInputLayout>
45+
<com.google.android.material.textfield.TextInputEditText
46+
android:id="@+id/et_login_password"
47+
android:layout_width="match_parent"
48+
android:layout_height="wrap_content"
49+
android:lines="1"
50+
android:singleLine="true"
51+
android:inputType="textPassword"
52+
/>
3453

35-
<com.google.android.material.textfield.TextInputLayout
36-
android:layout_width="match_parent"
37-
android:layout_height="wrap_content"
38-
android:hint="@string/str_input_password">
54+
</com.google.android.material.textfield.TextInputLayout>
3955

40-
<com.google.android.material.textfield.TextInputEditText
41-
android:id="@+id/et_login_password"
56+
<Button
57+
android:id="@+id/btn_login"
4258
android:layout_width="match_parent"
4359
android:layout_height="wrap_content"
44-
android:lines="1"
45-
android:singleLine="true"
46-
android:inputType="textPassword"
47-
/>
60+
android:text="@string/str_login" />
4861

49-
</com.google.android.material.textfield.TextInputLayout>
50-
51-
<Button
52-
android:id="@+id/btn_login"
53-
android:layout_width="match_parent"
54-
android:layout_height="wrap_content"
55-
android:text="@string/str_login" />
62+
<TextView
63+
android:id="@+id/tv_registration"
64+
android:layout_width="match_parent"
65+
android:layout_height="30dp"
66+
android:layout_gravity="center"
67+
android:gravity="center"
68+
android:text="@string/str_reg" />
5669

57-
<TextView
58-
android:id="@+id/tv_registration"
59-
android:layout_width="match_parent"
60-
android:layout_height="30dp"
61-
android:layout_gravity="center"
62-
android:gravity="center"
63-
android:text="@string/str_reg" />
70+
</LinearLayout>
6471

65-
</LinearLayout>
72+
</ScrollView>
Lines changed: 97 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
@@ -8,75 +8,114 @@
88
android:padding="5dp"
99
tools:context=".RegistrationActivity">
1010

11-
<EditText
12-
android:id="@+id/et_login_user"
11+
<LinearLayout
1312
android:layout_width="match_parent"
1413
android:layout_height="wrap_content"
15-
android:maxLines="1"
16-
android:singleLine="true"
17-
android:hint="请输入邮箱" />
14+
android:orientation="vertical"
15+
android:padding="5dp">
1816

19-
<EditText
20-
android:id="@+id/et_nickname"
21-
android:layout_width="match_parent"
22-
android:layout_height="wrap_content"
23-
android:maxLines="1"
24-
android:singleLine="true"
25-
android:hint="请输入昵称" />
17+
<com.google.android.material.appbar.AppBarLayout
18+
android:layout_width="match_parent"
19+
android:layout_height="wrap_content">
20+
<com.google.android.material.appbar.MaterialToolbar
21+
android:layout_width="match_parent"
22+
android:layout_height="wrap_content"
23+
android:minHeight="?attr/actionBarSize"
24+
app:title="@string/str_reg" />
25+
</com.google.android.material.appbar.AppBarLayout>
2626

27-
<EditText
28-
android:id="@+id/et_login_password"
29-
android:layout_width="match_parent"
30-
android:layout_height="wrap_content"
31-
android:inputType="textPassword"
32-
android:maxLines="1"
33-
android:singleLine="true"
34-
android:hint="请输入密码" />
27+
<com.google.android.material.textfield.TextInputLayout
28+
android:layout_width="match_parent"
29+
android:layout_height="wrap_content"
30+
android:hint="@string/str_input_email">
31+
<com.google.android.material.textfield.TextInputEditText
32+
android:id="@+id/et_login_user"
33+
android:layout_width="match_parent"
34+
android:layout_height="wrap_content"
35+
android:lines="1"
36+
android:singleLine="true"
37+
/>
38+
</com.google.android.material.textfield.TextInputLayout>
3539

36-
<LinearLayout
37-
android:layout_width="match_parent"
38-
android:layout_height="wrap_content"
39-
android:orientation="horizontal">
40+
<com.google.android.material.textfield.TextInputLayout
41+
android:layout_width="match_parent"
42+
android:layout_height="wrap_content"
43+
android:hint="@string/str_input_nickname">
44+
<com.google.android.material.textfield.TextInputEditText
45+
android:id="@+id/et_nickname"
46+
android:layout_width="match_parent"
47+
android:layout_height="wrap_content"
48+
android:lines="1"
49+
android:singleLine="true"
50+
/>
51+
</com.google.android.material.textfield.TextInputLayout>
4052

41-
<EditText
42-
android:id="@+id/et_login_code"
43-
android:layout_width="0dp"
53+
<com.google.android.material.textfield.TextInputLayout
54+
android:layout_width="match_parent"
4455
android:layout_height="wrap_content"
45-
android:layout_weight="0.6"
46-
android:inputType="text"
47-
android:maxLines="1"
48-
android:singleLine="true"
49-
android:hint="请输入验证码" />
56+
android:hint="@string/str_input_password">
57+
<com.google.android.material.textfield.TextInputEditText
58+
android:id="@+id/et_login_password"
59+
android:layout_width="match_parent"
60+
android:layout_height="wrap_content"
61+
android:inputType="textPassword"
62+
android:lines="1"
63+
android:singleLine="true"
64+
/>
65+
</com.google.android.material.textfield.TextInputLayout>
66+
67+
<LinearLayout
68+
android:layout_width="match_parent"
69+
android:layout_height="wrap_content"
70+
android:orientation="horizontal">
71+
72+
<com.google.android.material.textfield.TextInputLayout
73+
android:layout_width="0dp"
74+
android:layout_height="wrap_content"
75+
android:layout_weight="0.6"
76+
android:hint="@string/str_input_code">
77+
<com.google.android.material.textfield.TextInputEditText
78+
android:id="@+id/et_login_code"
79+
android:layout_width="match_parent"
80+
android:layout_height="wrap_content"
81+
android:lines="1"
82+
android:singleLine="true"
83+
/>
84+
</com.google.android.material.textfield.TextInputLayout>
85+
86+
<Button
87+
android:id="@+id/btn_send_code"
88+
android:layout_width="wrap_content"
89+
android:layout_height="wrap_content"
90+
android:text="@string/str_send" />
91+
92+
</LinearLayout>
5093

5194
<Button
52-
android:id="@+id/btn_send_code"
53-
android:layout_width="wrap_content"
95+
android:id="@+id/btn_registration"
96+
android:layout_width="match_parent"
5497
android:layout_height="wrap_content"
55-
android:text="发送" />
98+
android:text="@string/str_reg" />
99+
100+
<TextView
101+
android:id="@+id/tv_login"
102+
android:layout_width="match_parent"
103+
android:layout_height="30dp"
104+
android:layout_gravity="center"
105+
android:gravity="center"
106+
android:text="@string/str_login" />
107+
108+
<TextView
109+
android:id="@+id/tv_forgetpwd"
110+
android:layout_marginTop="50dp"
111+
android:layout_width="match_parent"
112+
android:layout_height="30dp"
113+
android:layout_gravity="center"
114+
android:gravity="center"
115+
android:text="@string/str_forget_password" />
56116

57117
</LinearLayout>
58118

59-
<Button
60-
android:id="@+id/btn_registration"
61-
android:layout_width="match_parent"
62-
android:layout_height="wrap_content"
63-
android:text="注册" />
64119

65-
<TextView
66-
android:id="@+id/tv_login"
67-
android:layout_width="match_parent"
68-
android:layout_height="30dp"
69-
android:layout_gravity="center"
70-
android:gravity="center"
71-
android:text="登录" />
72-
73-
<TextView
74-
android:id="@+id/tv_forgetpwd"
75-
android:layout_marginTop="50dp"
76-
android:layout_width="match_parent"
77-
android:layout_height="30dp"
78-
android:layout_gravity="center"
79-
android:gravity="center"
80-
android:text="忘记密码" />
81120

82-
</LinearLayout>
121+
</ScrollView>

app/src/main/res/values/strings.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@
1010
<string name="str_submit">提交</string>
1111
<string name="str_input_username">请输入用户名</string>
1212
<string name="str_reg">注册</string>
13+
<string name="str_input_email">请输入邮箱</string>
14+
<string name="str_input_nickname">请输入昵称</string>
15+
<string name="str_input_code">请输入验证码</string>
16+
<string name="str_send">发送</string>
17+
<string name="str_forget_password">忘记密码</string>
1318
</resources>

0 commit comments

Comments
 (0)