修改登录页面代码格式,编写注册页面

master
liuyx 2 years ago
parent 9e60dd3d48
commit d8dc4ff2fa

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SaveActionSettings">
<option name="actions">
<set>
<option value="activate" />
<option value="reformat" />
<option value="missingOverrideAnnotation" />
</set>
</option>
<option name="configurationPath" value="" />
</component>
</project>

@ -3,11 +3,11 @@ plugins {
}
android {
namespace 'com.example.myapplication'
namespace 'cc.liuyx.app'
compileSdk 33
defaultConfig {
applicationId "com.example.myapplication"
applicationId "cc.liuyx.app"
minSdk 30
targetSdk 33
versionCode 1

@ -11,15 +11,17 @@
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication"
tools:targetApi="31">
<activity
android:name="cc.liuyx.app.LoginMenuActivity"
android:name=".LoginActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".RegisterActivity"
android:exported="false" />
</application>
</manifest>

@ -0,0 +1,25 @@
package cc.liuyx.app;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class LoginActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
TextView textView = findViewById(R.id.click_register);
textView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(LoginActivity.this, RegisterActivity.class));
}
});
}
}

@ -1,27 +0,0 @@
package cc.liuyx.app;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.example.myapplication.R;
public class LoginMenuActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_menu);
// Button loginBtn = findViewById(R.id.btn_login);
// loginBtn.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// startActivity(new Intent(LoginMenuActivity.this, RegisterActivity.class));
// }
// });
}
}

@ -0,0 +1,14 @@
package cc.liuyx.app;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class RegisterActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
}
}

@ -1,30 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

@ -3,49 +3,48 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FAF9FA"
android:gravity="center"
android:orientation="vertical"
android:background="#FAF9FA">
android:orientation="vertical">
<ImageView
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_marginTop="50dp"
android:layout_marginBottom="30dp"
android:src="@mipmap/ic_app_round"
android:contentDescription="ICON" />
android:contentDescription="ICON"
android:src="@mipmap/ic_app_round" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:text="Yo! Nice to see you!"
android:layout_marginBottom="15dp"
android:fontFamily="serif" />
android:text="Yo! Nice to see you!"
android:textSize="18sp" />
<EditText
android:id="@+id/editTextTextPersonName"
android:layout_width="357dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/sharp_input"
android:gravity="center"
android:textSize="15sp"
android:hint="请输入用户名"
android:inputType="textPersonName"
android:background="@drawable/input_sharp"
android:layout_margin="10dp"/>
android:textSize="15sp" />
<EditText
android:id="@+id/editTextTextPassword"
android:layout_width="357dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginBottom="20dp"
android:background="@drawable/sharp_input"
android:gravity="center"
android:textSize="15sp"
android:hint="请输入密码"
android:inputType="textPassword"
android:background="@drawable/input_sharp"
android:layout_margin="10dp" />
android:textSize="15sp" />
<Button
android:id="@+id/btn_login"
@ -57,14 +56,16 @@
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<TextView
android:id="@+id/click_register"
android:layout_width="256dp"
android:layout_height="wrap_content"
android:text="没有账号?点我注册~"
android:layout_alignParentBottom="true"
android:layout_marginBottom="20dp"
android:textSize="16sp"
android:textAlignment="center"/>
android:text="没有账号?点我注册~"
android:textAlignment="center"
android:textSize="16sp" />
</RelativeLayout>
</LinearLayout>

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FAF9FA"
android:orientation="vertical"
android:paddingLeft="30dp"
android:paddingRight="30dp"
tools:context=".RegisterActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="70dp"
android:gravity="center_horizontal"
android:text="设置账户信息"
android:textFontWeight="1000"
android:textSize="22sp" />
<EditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:background="@drawable/sharp_input"
android:drawableEnd="@drawable/ic_user"
android:hint="来将可留姓名?"
android:inputType="textPersonName"
android:lines="1"
android:textSize="15sp" />
<EditText
android:id="@+id/passwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:background="@drawable/sharp_input"
android:drawableEnd="@drawable/ic_passwd"
android:ems="10"
android:hint="对对暗号"
android:inputType="textPassword"
android:lines="1"
android:textSize="15sp" />
<EditText
android:id="@+id/passwd2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:background="@drawable/sharp_input"
android:drawableEnd="@drawable/ic_passwd"
android:ems="10"
android:hint="重复暗号"
android:inputType="textPassword"
android:lines="1"
android:textSize="15sp" />
<EditText
android:id="@+id/phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:background="@drawable/sharp_input"
android:drawableEnd="@drawable/ic_phone"
android:hint="留个联系方式~"
android:inputType="phone"
android:lines="1"
android:textAllCaps="false"
android:textSize="15sp" />
<EditText
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:background="@drawable/sharp_input"
android:drawableEnd="@drawable/ic_email"
android:hint="邮箱也留个噻"
android:inputType="textEmailAddress"
android:lines="1"
android:textSize="15sp" />
<Button
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="60dp"
android:text="立即注册" />
</LinearLayout>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_phone_background"/>
<foreground android:drawable="@mipmap/ic_phone_foreground"/>
</adaptive-icon>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_phone_background"/>
<foreground android:drawable="@mipmap/ic_phone_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_applauncher_background">#FFFFFF</color>
</resources>

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_phone_background">#FFFFFF</color>
</resources>
Loading…
Cancel
Save