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/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..49ca9da --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,40 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.myapplication' + compileSdk 33 + + defaultConfig { + applicationId "com.example.myapplication" + minSdk 24 + 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:1.1.0' +} \ 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/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..e6e318a --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + \ 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..0717cd4 --- /dev/null +++ b/app/src/main/java/com/example/myapplication/MainActivity.java @@ -0,0 +1,48 @@ +package com.example.myapplication; + +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; + +import androidx.appcompat.app.AppCompatActivity; + +import com.example.myapplication.activity.RegisterActivity; +import com.example.myapplication.activity.UserActivity; + +public class MainActivity extends AppCompatActivity implements View.OnClickListener { + private Button registerButton, loginButton; + private EditText usernameText, paswdEdit; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.user_login); + init(); + } + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.register: + Intent intent1 = new Intent(MainActivity.this, RegisterActivity.class); + startActivity(intent1); + break; + case R.id.login: + Intent intent2 = new Intent(MainActivity.this, UserActivity.class); + startActivity(intent2); + break; + } + } + + //界面组件初始化 + private void init() { + usernameText = findViewById(R.id.username); + paswdEdit = findViewById(R.id.password); + loginButton = findViewById(R.id.login); + loginButton.setOnClickListener(this); + registerButton = findViewById(R.id.register); + registerButton.setOnClickListener(this); + } +} diff --git a/app/src/main/java/com/example/myapplication/activity/RegisterActivity.java b/app/src/main/java/com/example/myapplication/activity/RegisterActivity.java new file mode 100644 index 0000000..82636b2 --- /dev/null +++ b/app/src/main/java/com/example/myapplication/activity/RegisterActivity.java @@ -0,0 +1,92 @@ + +package com.example.myapplication.activity; + +import android.graphics.Color; +import android.os.Bundle; +import android.view.View; +import android.widget.TextView; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; +import com.lljjcoder.citypickerview.widget.CityPicker; +import com.example.myapplication.R; + +public class RegisterActivity extends AppCompatActivity implements View.OnClickListener { + private TextView cityText; + // private citypicker cityPicker; + private CityPicker cityPicker; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.user_register); + init(); + } + + + + + + + private void init() { + cityText = findViewById(R.id.reg_province); + cityText.setOnClickListener(this); + } + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.reg_province: + initCityPicker(); + cityPicker.show(); + break; + + } + } + + + + + + + public void initCityPicker() { + cityPicker = new CityPicker.Builder(RegisterActivity.this) + .textSize(16) + .title("地址选择") + .backgroundPop(0xa0000000) + .titleBackgroundColor("#EFB81C") + .titleTextColor("#000000") + .backgroundPop(0xa0000000) + .confirTextColor("#000000") + .cancelTextColor("#000000") + .province("xx省") + .city("xx市") + .district("xx区") + .textColor(Color.parseColor("#000000")) + .provinceCyclic(true) + .cityCyclic(false) + .districtCyclic(false) + .visibleItemsCount(7) + .itemPadding(10) + .onlyShowProvinceAndCity(false) + .build(); + cityPicker.setOnCityItemClickListener(new CityPicker.OnCityItemClickListener() { + @Override + public void onSelected(String... strings) { + String province=strings[0]; + String city=strings[1]; + String district=strings[2]; + cityText.setText(String.format("%s %s %s", province, city, district)); + } + + @Override + public void onCancel() { + + } + }); + + } + +} + diff --git a/app/src/main/java/com/example/myapplication/activity/UserActivity.java b/app/src/main/java/com/example/myapplication/activity/UserActivity.java new file mode 100644 index 0000000..33e71d6 --- /dev/null +++ b/app/src/main/java/com/example/myapplication/activity/UserActivity.java @@ -0,0 +1,58 @@ +package com.example.myapplication.activity; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.Nullable; + +import com.example.myapplication.MainActivity; +import com.example.myapplication.R; + +public class UserActivity extends Activity { + private ImageView userIconImage; + private TextView usernameText, userSexText, userCityText; + private LinearLayout usernameLine, userSexline, userCityLine, userPayLine, userSettingLine, userGeneralLine; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.content_user); + init(); + + Button button; + button = findViewById(R.id.button); + + button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if(view.getId() == R.id.button){ + Intent intent = new Intent(UserActivity.this, MainActivity.class); + startActivity(intent); + } + } + }); + } + + /** + * 组件初始化 + */ + private void init() { + userIconImage = findViewById(R.id.user_icon); + usernameText = findViewById(R.id.user_username); + userSexText = findViewById(R.id.user_sex); + userCityText = findViewById(R.id.user_city); + usernameLine = findViewById(R.id.user_username_line); + userSexline = findViewById(R.id.user_sex_line); + userCityLine = findViewById(R.id.user_city_line); + userPayLine = findViewById(R.id.user_pay); + userSettingLine = findViewById(R.id.user_setting); + userGeneralLine = findViewById(R.id.user_general); + } + +} diff --git a/app/src/main/java/com/example/myapplication/entity/OrangeUser.java b/app/src/main/java/com/example/myapplication/entity/OrangeUser.java new file mode 100644 index 0000000..c5bdc00 --- /dev/null +++ b/app/src/main/java/com/example/myapplication/entity/OrangeUser.java @@ -0,0 +1,59 @@ +package com.example.myapplication.entity; + +public class OrangeUser { + private Integer id; + private String username; + private String password; + private String sex; + private String city; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + @Override + public String toString() { + return "OrangeUser{" + + "username='" + username + '\'' + + ", password='" + password + '\'' + + ", sex='" + sex + '\'' + + ", city='" + city + '\'' + + '}'; + } +} diff --git a/app/src/main/res/AndroidManifest.xml b/app/src/main/res/AndroidManifest.xml new file mode 100644 index 0000000..4213c87 --- /dev/null +++ b/app/src/main/res/AndroidManifest.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + \ 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/address.png b/app/src/main/res/drawable/address.png new file mode 100644 index 0000000..7318be0 Binary files /dev/null and b/app/src/main/res/drawable/address.png differ diff --git a/app/src/main/res/drawable/arrow_down.png b/app/src/main/res/drawable/arrow_down.png new file mode 100644 index 0000000..6d95bb5 Binary files /dev/null and b/app/src/main/res/drawable/arrow_down.png differ diff --git a/app/src/main/res/drawable/arrow_right.png b/app/src/main/res/drawable/arrow_right.png new file mode 100644 index 0000000..84ded85 Binary files /dev/null and b/app/src/main/res/drawable/arrow_right.png 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..3eb0673 --- /dev/null +++ b/app/src/main/res/drawable/button_register.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/city.png b/app/src/main/res/drawable/city.png new file mode 100644 index 0000000..710c9fd Binary files /dev/null and b/app/src/main/res/drawable/city.png differ diff --git a/app/src/main/res/drawable/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/drawable/address.png b/app/src/main/res/drawable/drawable/address.png new file mode 100644 index 0000000..7318be0 Binary files /dev/null and b/app/src/main/res/drawable/drawable/address.png differ diff --git a/app/src/main/res/drawable/drawable/arrow_down.png b/app/src/main/res/drawable/drawable/arrow_down.png new file mode 100644 index 0000000..6d95bb5 Binary files /dev/null and b/app/src/main/res/drawable/drawable/arrow_down.png differ diff --git a/app/src/main/res/drawable/drawable/arrow_right.png b/app/src/main/res/drawable/drawable/arrow_right.png new file mode 100644 index 0000000..84ded85 Binary files /dev/null and b/app/src/main/res/drawable/drawable/arrow_right.png differ diff --git a/app/src/main/res/drawable/drawable/button_login.xml b/app/src/main/res/drawable/drawable/button_login.xml new file mode 100644 index 0000000..d093f1b --- /dev/null +++ b/app/src/main/res/drawable/drawable/button_login.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/drawable/button_register.xml b/app/src/main/res/drawable/drawable/button_register.xml new file mode 100644 index 0000000..3eb0673 --- /dev/null +++ b/app/src/main/res/drawable/drawable/button_register.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/drawable/city.png b/app/src/main/res/drawable/drawable/city.png new file mode 100644 index 0000000..790fb2b Binary files /dev/null and b/app/src/main/res/drawable/drawable/city.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/address.png b/app/src/main/res/drawable/drawable/drawable/address.png new file mode 100644 index 0000000..7318be0 Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/address.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/arrow_down.png b/app/src/main/res/drawable/drawable/drawable/arrow_down.png new file mode 100644 index 0000000..6d95bb5 Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/arrow_down.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/arrow_right.png b/app/src/main/res/drawable/drawable/drawable/arrow_right.png new file mode 100644 index 0000000..84ded85 Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/arrow_right.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/button_login.xml b/app/src/main/res/drawable/drawable/drawable/button_login.xml new file mode 100644 index 0000000..d093f1b --- /dev/null +++ b/app/src/main/res/drawable/drawable/drawable/button_login.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/drawable/drawable/button_register.xml b/app/src/main/res/drawable/drawable/drawable/button_register.xml new file mode 100644 index 0000000..3eb0673 --- /dev/null +++ b/app/src/main/res/drawable/drawable/drawable/button_register.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/drawable/drawable/city.png b/app/src/main/res/drawable/drawable/drawable/city.png new file mode 100644 index 0000000..790fb2b Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/city.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/drawable/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..0d025f9 --- /dev/null +++ b/app/src/main/res/drawable/drawable/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/drawable/drawable/orange.png b/app/src/main/res/drawable/drawable/drawable/orange.png new file mode 100644 index 0000000..70e8db8 Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/orange.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/password.png b/app/src/main/res/drawable/drawable/drawable/password.png new file mode 100644 index 0000000..1c6c4f5 Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/password.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/setting.png b/app/src/main/res/drawable/drawable/drawable/setting.png new file mode 100644 index 0000000..34c2f2f Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/setting.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/sex.png b/app/src/main/res/drawable/drawable/drawable/sex.png new file mode 100644 index 0000000..acb8197 Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/sex.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/spinner_drop_down_shape.xml b/app/src/main/res/drawable/drawable/drawable/spinner_drop_down_shape.xml new file mode 100644 index 0000000..64306b1 --- /dev/null +++ b/app/src/main/res/drawable/drawable/drawable/spinner_drop_down_shape.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/drawable/drawable/sure_apssword.png b/app/src/main/res/drawable/drawable/drawable/sure_apssword.png new file mode 100644 index 0000000..0e7cee9 Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/sure_apssword.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/user.png b/app/src/main/res/drawable/drawable/drawable/user.png new file mode 100644 index 0000000..47d8362 Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/user.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/user_account.png b/app/src/main/res/drawable/drawable/drawable/user_account.png new file mode 100644 index 0000000..e70142a Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/user_account.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/user_general.png b/app/src/main/res/drawable/drawable/drawable/user_general.png new file mode 100644 index 0000000..cf57947 Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/user_general.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/user_icon.png b/app/src/main/res/drawable/drawable/drawable/user_icon.png new file mode 100644 index 0000000..d5309b1 Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/user_icon.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/user_pay.png b/app/src/main/res/drawable/drawable/drawable/user_pay.png new file mode 100644 index 0000000..3fd6f50 Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/user_pay.png differ diff --git a/app/src/main/res/drawable/drawable/drawable/user_sex.png b/app/src/main/res/drawable/drawable/drawable/user_sex.png new file mode 100644 index 0000000..da0e318 Binary files /dev/null and b/app/src/main/res/drawable/drawable/drawable/user_sex.png differ diff --git a/app/src/main/res/drawable/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..0d025f9 --- /dev/null +++ b/app/src/main/res/drawable/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/drawable/orange.png b/app/src/main/res/drawable/drawable/orange.png new file mode 100644 index 0000000..70e8db8 Binary files /dev/null and b/app/src/main/res/drawable/drawable/orange.png differ diff --git a/app/src/main/res/drawable/drawable/password.png b/app/src/main/res/drawable/drawable/password.png new file mode 100644 index 0000000..1c6c4f5 Binary files /dev/null and b/app/src/main/res/drawable/drawable/password.png differ diff --git a/app/src/main/res/drawable/drawable/setting.png b/app/src/main/res/drawable/drawable/setting.png new file mode 100644 index 0000000..34c2f2f Binary files /dev/null and b/app/src/main/res/drawable/drawable/setting.png differ diff --git a/app/src/main/res/drawable/drawable/sex.png b/app/src/main/res/drawable/drawable/sex.png new file mode 100644 index 0000000..acb8197 Binary files /dev/null and b/app/src/main/res/drawable/drawable/sex.png differ diff --git a/app/src/main/res/drawable/drawable/spinner_drop_down_shape.xml b/app/src/main/res/drawable/drawable/spinner_drop_down_shape.xml new file mode 100644 index 0000000..64306b1 --- /dev/null +++ b/app/src/main/res/drawable/drawable/spinner_drop_down_shape.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/drawable/sure_apssword.png b/app/src/main/res/drawable/drawable/sure_apssword.png new file mode 100644 index 0000000..0e7cee9 Binary files /dev/null and b/app/src/main/res/drawable/drawable/sure_apssword.png differ diff --git a/app/src/main/res/drawable/drawable/user.png b/app/src/main/res/drawable/drawable/user.png new file mode 100644 index 0000000..47d8362 Binary files /dev/null and b/app/src/main/res/drawable/drawable/user.png differ diff --git a/app/src/main/res/drawable/drawable/user_account.png b/app/src/main/res/drawable/drawable/user_account.png new file mode 100644 index 0000000..e70142a Binary files /dev/null and b/app/src/main/res/drawable/drawable/user_account.png differ diff --git a/app/src/main/res/drawable/drawable/user_general.png b/app/src/main/res/drawable/drawable/user_general.png new file mode 100644 index 0000000..cf57947 Binary files /dev/null and b/app/src/main/res/drawable/drawable/user_general.png differ diff --git a/app/src/main/res/drawable/drawable/user_icon.png b/app/src/main/res/drawable/drawable/user_icon.png new file mode 100644 index 0000000..d5309b1 Binary files /dev/null and b/app/src/main/res/drawable/drawable/user_icon.png differ diff --git a/app/src/main/res/drawable/drawable/user_pay.png b/app/src/main/res/drawable/drawable/user_pay.png new file mode 100644 index 0000000..3fd6f50 Binary files /dev/null and b/app/src/main/res/drawable/drawable/user_pay.png differ diff --git a/app/src/main/res/drawable/drawable/user_sex.png b/app/src/main/res/drawable/drawable/user_sex.png new file mode 100644 index 0000000..da0e318 Binary files /dev/null and b/app/src/main/res/drawable/drawable/user_sex.png 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/orange.png b/app/src/main/res/drawable/orange.png new file mode 100644 index 0000000..5ccdb29 Binary files /dev/null and b/app/src/main/res/drawable/orange.png differ diff --git a/app/src/main/res/drawable/password.png b/app/src/main/res/drawable/password.png new file mode 100644 index 0000000..1c6c4f5 Binary files /dev/null and b/app/src/main/res/drawable/password.png differ diff --git a/app/src/main/res/drawable/setting.png b/app/src/main/res/drawable/setting.png new file mode 100644 index 0000000..34c2f2f Binary files /dev/null and b/app/src/main/res/drawable/setting.png differ diff --git a/app/src/main/res/drawable/sex.png b/app/src/main/res/drawable/sex.png new file mode 100644 index 0000000..acb8197 Binary files /dev/null and b/app/src/main/res/drawable/sex.png differ diff --git a/app/src/main/res/drawable/spinner_drop_down_shape.xml b/app/src/main/res/drawable/spinner_drop_down_shape.xml new file mode 100644 index 0000000..64306b1 --- /dev/null +++ b/app/src/main/res/drawable/spinner_drop_down_shape.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/sure_apssword.png b/app/src/main/res/drawable/sure_apssword.png new file mode 100644 index 0000000..0e7cee9 Binary files /dev/null and b/app/src/main/res/drawable/sure_apssword.png differ diff --git a/app/src/main/res/drawable/user.png b/app/src/main/res/drawable/user.png new file mode 100644 index 0000000..47d8362 Binary files /dev/null and b/app/src/main/res/drawable/user.png differ diff --git a/app/src/main/res/drawable/user_account.png b/app/src/main/res/drawable/user_account.png new file mode 100644 index 0000000..3a1a415 Binary files /dev/null and b/app/src/main/res/drawable/user_account.png differ diff --git a/app/src/main/res/drawable/user_general.png b/app/src/main/res/drawable/user_general.png new file mode 100644 index 0000000..cf57947 Binary files /dev/null and b/app/src/main/res/drawable/user_general.png differ diff --git a/app/src/main/res/drawable/user_icon.png b/app/src/main/res/drawable/user_icon.png new file mode 100644 index 0000000..5ccdb29 Binary files /dev/null and b/app/src/main/res/drawable/user_icon.png differ diff --git a/app/src/main/res/drawable/user_pay.png b/app/src/main/res/drawable/user_pay.png new file mode 100644 index 0000000..093685d Binary files /dev/null and b/app/src/main/res/drawable/user_pay.png differ diff --git a/app/src/main/res/drawable/user_sex.png b/app/src/main/res/drawable/user_sex.png new file mode 100644 index 0000000..fd03468 Binary files /dev/null and b/app/src/main/res/drawable/user_sex.png differ diff --git a/app/src/main/res/layout/activity/RegisterActivity.java b/app/src/main/res/layout/activity/RegisterActivity.java new file mode 100644 index 0000000..e021cbe --- /dev/null +++ b/app/src/main/res/layout/activity/RegisterActivity.java @@ -0,0 +1,91 @@ + +package com.example.myapplication.activity; + +import android.graphics.Color; +import android.os.Bundle; +import android.view.View; +import android.widget.TextView; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + +import com.example.myapplication.R; + +public class RegisterActivity extends AppCompatActivity implements View.OnClickListener { + private TextView cityText; + private CityPickerView cityPicker; + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.user_register); + init(); + } + + + + + + + private void init() { + cityText = findViewById(R.id.reg_province); + cityText.setOnClickListener(this); + } + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.reg_province: + initCityPicker(); + cityPicker.show(); + break; + + } + } + + + + + + + public void initCityPicker() { + cityPicker = new CityPicker.Builder(RegisterActivity.this) + .textSize(16) + .title("地址选择") + .backgroundPop(0xa0000000) + .titleBackgroundColor("#EFB81C") + .titleTextColor("#000000") + .backgroundPop(0xa0000000) + .confirTextColor("#000000") + .cancelTextColor("#000000") + .province("xx省") + .city("xx市") + .district("xx区") + .textColor(Color.parseColor("#000000")) + .provinceCyclic(true) + .cityCyclic(false) + .districtCyclic(false) + .visibleItemsCount(7) + .itemPadding(10) + .onlyShowProvinceAndCity(false) + .build(); + cityPicker.setOnCityItemClickListener(new CityPicker.OnCityItemClickListener() { + @Override + public void onSelected(String... strings) { + String province=strings[0]; + String city=strings[1]; + String district=strings[2]; + cityText.setText(String.format("%s %s %s", province, city, district)); + } + + @Override + public void onCancel() { + + } + }); + + } + +} + diff --git a/app/src/main/res/layout/activity/UserActivity.java b/app/src/main/res/layout/activity/UserActivity.java new file mode 100644 index 0000000..9cf491d --- /dev/null +++ b/app/src/main/res/layout/activity/UserActivity.java @@ -0,0 +1,53 @@ +package com.example.myapplication.activity; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.Nullable; + +import com.example.myapplication.R; + +public class UserActivity extends Activity { + private ImageView userIconImage; + private TextView usernameText, userSexText, userCityText; + private LinearLayout usernameLine, userSexline, userCityLine, userPayLine, userSettingLine, userGeneralLine; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.content_user); + init(); + } + + /** + * 组件初始化 + */ + private void init() { + userIconImage = findViewById(R.id.user_icon); + usernameText = findViewById(R.id.user_username); + userSexText = findViewById(R.id.user_sex); + userCityText = findViewById(R.id.user_city); + usernameLine = findViewById(R.id.user_username_line); + userSexline = findViewById(R.id.user_sex_line); + userCityLine = findViewById(R.id.user_city_line); + userPayLine = findViewById(R.id.user_pay); + userSettingLine = findViewById(R.id.user_setting); + userGeneralLine = findViewById(R.id.user_general); + setData(); + } + + /** + * 组件赋值 + */ + private void setData() { + Intent intent = UserActivity.this.getIntent(); + Bundle bundle = intent.getExtras(); + usernameText.setText(String.format("用户名:%s", bundle.getString("username"))); + userSexText.setText(String.format("性别:%s", bundle.getString("sex"))); + userCityText.setText(String.format("城市:%s", bundle.getString("city"))); + } +} diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..f52a352 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/content_user.xml b/app/src/main/res/layout/content_user.xml new file mode 100644 index 0000000..91885e6 --- /dev/null +++ b/app/src/main/res/layout/content_user.xml @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +