commit 45dfa4bf8d86f0a85f0b9c6ea0a61e1dacc68421 Author: GongJie <2542215481@qq.com> Date: Tue Apr 4 13:02:05 2023 +0800 2023/4/4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..b3405b3 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +My Application \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a2d7c21 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..711baa0 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..bdd9278 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..dec9b03 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,41 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.myapplication' + compileSdk 33 + + defaultConfig { + applicationId "com.example.myapplication" + minSdk 32 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.4.1' + implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + implementation 'liji.library.dev:citypickerview:5.2.2' + +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/shiyan2.rar b/app/shiyan2.rar new file mode 100644 index 0000000..200a9da Binary files /dev/null and b/app/shiyan2.rar differ diff --git a/app/shiyanyi.rar b/app/shiyanyi.rar new file mode 100644 index 0000000..2e0bf1d Binary files /dev/null and b/app/shiyanyi.rar differ diff --git a/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java new file mode 100644 index 0000000..982ba51 --- /dev/null +++ b/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.myapplication; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.myapplication", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..9449764 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/MainActivity.java b/app/src/main/java/com/example/myapplication/MainActivity.java new file mode 100644 index 0000000..2c9a336 --- /dev/null +++ b/app/src/main/java/com/example/myapplication/MainActivity.java @@ -0,0 +1,22 @@ +package com.example.myapplication; + +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.EditText; + +public class MainActivity extends AppCompatActivity { + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.user_login); + } + public void startRegister(View view) { + startActivity(new Intent(this,RegisterActivity.class)); + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/RegisterActivity.java b/app/src/main/java/com/example/myapplication/RegisterActivity.java new file mode 100644 index 0000000..97336fe --- /dev/null +++ b/app/src/main/java/com/example/myapplication/RegisterActivity.java @@ -0,0 +1,114 @@ +package com.example.myapplication; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.RecyclerView; + +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.RadioGroup; +import android.widget.TextView; +import android.widget.Toast; + +import com.lljjcoder.style.citylist.utils.CityListLoader; +import com.lljjcoder.style.citythreelist.CityBean; +import com.lljjcoder.style.citythreelist.ProvinceActivity; + +public class RegisterActivity extends AppCompatActivity implements + View.OnClickListener,RadioGroup.OnCheckedChangeListener{ + + private EditText edt_name; + private EditText edt_password; + private EditText edt_surePassword; + private Button regButton; + private RadioGroup sexGroup; + private TextView cityText; + private String sexStr="男"; + + CityBean province, city,area; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.register_login); + init(); + CityListLoader.getInstance().loadProData(this); + findViewById(R.id.reg_province).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(RegisterActivity.this, ProvinceActivity.class); + + startActivityForResult(intent, ProvinceActivity.RESULT_DATA); + + } + }); + + + } + public void init(){ + cityText =findViewById(R.id.reg_province); + cityText.setOnClickListener(this); + edt_name=findViewById(R.id.reg_username); + edt_password=findViewById(R.id.reg_password); + edt_surePassword=findViewById(R.id.sure_password); + regButton=findViewById(R.id.reg_login); + regButton.setOnClickListener(this); + sexGroup=findViewById(R.id.sex); + sexGroup.setOnCheckedChangeListener(this); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == ProvinceActivity.RESULT_DATA) { + if (resultCode == RESULT_OK) { + if (data == null) { + return; + } + //省份结果 + province = data.getParcelableExtra("province"); + //城市结果 + city = data.getParcelableExtra("city"); + //区域结果 + area = data.getParcelableExtra("area"); + + TextView textView = findViewById(R.id.reg_province); + textView.setText(String.format("%s %s %s", province.getName(), city.getName(), area.getName())); + } + } + } + public void onClick(View view){ + Intent intent = new Intent(RegisterActivity.this, UserActivity.class); + String username = edt_name.getText().toString(); + String password = edt_password.getText().toString(); + String surePassword = edt_surePassword.getText().toString(); + String city = cityText.getText().toString(); + if (password.equals(surePassword)) { + if (!username.equals("") || !password.equals("")) { + if (!city.equals("")) { + Bundle bundle = new Bundle(); + bundle.putString("username", username); + bundle.putString("password", password); + bundle.putString("sex", sexStr); + bundle.putString("city", city); + intent.putExtras(bundle); + startActivity(intent); + } else { + Toast.makeText(RegisterActivity.this, "请选择地址", Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(RegisterActivity.this, "用户名或密码未填写", Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(RegisterActivity.this, "两次密码输入不一致", Toast.LENGTH_SHORT).show(); + } + } + + @Override + public void onCheckedChanged(RadioGroup radioGroup,int checkedId) { + sexStr=checkedId==R.id.man?"男":"女"; + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/myapplication/UserActivity.java b/app/src/main/java/com/example/myapplication/UserActivity.java new file mode 100644 index 0000000..d0d72d9 --- /dev/null +++ b/app/src/main/java/com/example/myapplication/UserActivity.java @@ -0,0 +1,17 @@ +package com.example.myapplication; + +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.os.Bundle; +import android.widget.EditText; + +public class UserActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.user2_login); + } + +} \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/arrow_down.jpg b/app/src/main/res/drawable/arrow_down.jpg new file mode 100644 index 0000000..23981a5 Binary files /dev/null and b/app/src/main/res/drawable/arrow_down.jpg differ diff --git a/app/src/main/res/drawable/bg.jpg b/app/src/main/res/drawable/bg.jpg new file mode 100644 index 0000000..bb473ea Binary files /dev/null and b/app/src/main/res/drawable/bg.jpg differ diff --git a/app/src/main/res/drawable/bg2.jpg b/app/src/main/res/drawable/bg2.jpg new file mode 100644 index 0000000..c1db5a5 Binary files /dev/null and b/app/src/main/res/drawable/bg2.jpg differ diff --git a/app/src/main/res/drawable/button_login.xml b/app/src/main/res/drawable/button_login.xml new file mode 100644 index 0000000..d093f1b --- /dev/null +++ b/app/src/main/res/drawable/button_login.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/button_register.xml b/app/src/main/res/drawable/button_register.xml new file mode 100644 index 0000000..d093f1b --- /dev/null +++ b/app/src/main/res/drawable/button_register.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/card.jpg b/app/src/main/res/drawable/card.jpg new file mode 100644 index 0000000..29e311e Binary files /dev/null and b/app/src/main/res/drawable/card.jpg differ diff --git a/app/src/main/res/drawable/fruit_party.jpg b/app/src/main/res/drawable/fruit_party.jpg new file mode 100644 index 0000000..b3d6e2d Binary files /dev/null and b/app/src/main/res/drawable/fruit_party.jpg differ diff --git a/app/src/main/res/drawable/home.jpg b/app/src/main/res/drawable/home.jpg new file mode 100644 index 0000000..32d311e Binary files /dev/null and b/app/src/main/res/drawable/home.jpg differ diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/jt.jpg b/app/src/main/res/drawable/jt.jpg new file mode 100644 index 0000000..abac898 Binary files /dev/null and b/app/src/main/res/drawable/jt.jpg differ diff --git a/app/src/main/res/drawable/password.jpg b/app/src/main/res/drawable/password.jpg new file mode 100644 index 0000000..cd4fee6 Binary files /dev/null and b/app/src/main/res/drawable/password.jpg differ diff --git a/app/src/main/res/drawable/setting.jpg b/app/src/main/res/drawable/setting.jpg new file mode 100644 index 0000000..0abc7b9 Binary files /dev/null and b/app/src/main/res/drawable/setting.jpg differ diff --git a/app/src/main/res/drawable/sex.jpg b/app/src/main/res/drawable/sex.jpg new file mode 100644 index 0000000..9fc4a71 Binary files /dev/null and b/app/src/main/res/drawable/sex.jpg differ diff --git a/app/src/main/res/drawable/sharp.xml b/app/src/main/res/drawable/sharp.xml new file mode 100644 index 0000000..9845e04 --- /dev/null +++ b/app/src/main/res/drawable/sharp.xml @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/user.jpg b/app/src/main/res/drawable/user.jpg new file mode 100644 index 0000000..7796cd9 Binary files /dev/null and b/app/src/main/res/drawable/user.jpg differ diff --git a/app/src/main/res/drawable/user2.jpg b/app/src/main/res/drawable/user2.jpg new file mode 100644 index 0000000..9d59f1b Binary files /dev/null and b/app/src/main/res/drawable/user2.jpg differ diff --git a/app/src/main/res/layout/register_login.xml b/app/src/main/res/layout/register_login.xml new file mode 100644 index 0000000..aaa87ab --- /dev/null +++ b/app/src/main/res/layout/register_login.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +