diff --git "a/D:\\Android\\ex3" "b/D:\\Android\\ex3"
deleted file mode 100644
index e69de29..0000000
diff --git a/My/.gitignore b/My/.gitignore
new file mode 100644
index 0000000..aa724b7
--- /dev/null
+++ b/My/.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/My/.idea/.gitignore b/My/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/My/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/My/.idea/compiler.xml b/My/.idea/compiler.xml
new file mode 100644
index 0000000..b589d56
--- /dev/null
+++ b/My/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/.idea/deploymentTargetDropDown.xml b/My/.idea/deploymentTargetDropDown.xml
new file mode 100644
index 0000000..2f0367c
--- /dev/null
+++ b/My/.idea/deploymentTargetDropDown.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/.idea/gradle.xml b/My/.idea/gradle.xml
new file mode 100644
index 0000000..0897082
--- /dev/null
+++ b/My/.idea/gradle.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/.idea/migrations.xml b/My/.idea/migrations.xml
new file mode 100644
index 0000000..f8051a6
--- /dev/null
+++ b/My/.idea/migrations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/.idea/misc.xml b/My/.idea/misc.xml
new file mode 100644
index 0000000..0ad17cb
--- /dev/null
+++ b/My/.idea/misc.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/.gitignore b/My/app/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/My/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/My/app/build.gradle.kts b/My/app/build.gradle.kts
new file mode 100644
index 0000000..de530ef
--- /dev/null
+++ b/My/app/build.gradle.kts
@@ -0,0 +1,46 @@
+plugins {
+ alias(libs.plugins.androidApplication)
+}
+
+android {
+ namespace = "com.example.my"
+ compileSdk = 34
+
+ defaultConfig {
+ applicationId = "com.example.my"
+ minSdk = 24
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro"
+ )
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+ buildFeatures {
+ aidl = true
+ }
+}
+
+dependencies {
+
+ implementation(libs.appcompat)
+ implementation(libs.material)
+ implementation(libs.activity)
+ implementation(libs.constraintlayout)
+ testImplementation(libs.junit)
+ androidTestImplementation(libs.ext.junit)
+ androidTestImplementation(libs.espresso.core)
+}
\ No newline at end of file
diff --git a/My/app/proguard-rules.pro b/My/app/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/My/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/My/app/src/androidTest/java/com/example/my/ExampleInstrumentedTest.java b/My/app/src/androidTest/java/com/example/my/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..962e700
--- /dev/null
+++ b/My/app/src/androidTest/java/com/example/my/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.my;
+
+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.my", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/My/app/src/main/AndroidManifest.xml b/My/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..e7b0187
--- /dev/null
+++ b/My/app/src/main/AndroidManifest.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/java/com/example/my/Adapter/LeftListAdapter.java b/My/app/src/main/java/com/example/my/Adapter/LeftListAdapter.java
new file mode 100644
index 0000000..87918dd
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/Adapter/LeftListAdapter.java
@@ -0,0 +1,88 @@
+package com.example.my.Adapter;
+
+import android.annotation.SuppressLint;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.example.my.R;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class LeftListAdapter extends RecyclerView.Adapter {
+
+ private List dataList = new ArrayList<>();
+
+ private int currentIndex=0;
+
+ public LeftListAdapter(List dataList) {
+ this.dataList = dataList;
+ }
+
+ @NonNull
+ @Override
+ public MyHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.left_list_item, null);
+ return new MyHolder(view);
+ }
+
+ @Override
+ @SuppressLint("RecyclerView")
+ public void onBindViewHolder(@NonNull MyHolder holder, int position) {
+ //绑定数据
+ String name = dataList.get(position);
+ holder.name.setText(name);
+
+ //分类的点击事件
+ holder.itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (null != mLeftListOnClickItemListener) {
+ mLeftListOnClickItemListener.onItemClick(position);
+ }
+ }
+ });
+
+ if (currentIndex == position) {
+ holder.itemView.setBackgroundResource(R.drawable.type_select_bg);
+ }else {
+ holder.itemView.setBackgroundResource(R.drawable.type_selected_no);
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return dataList.size();
+ }
+
+ static class MyHolder extends RecyclerView.ViewHolder {
+ TextView name;
+
+ public MyHolder(@NonNull View itemView) {
+ super(itemView);
+ name = itemView.findViewById(R.id.name);
+ }
+ }
+
+ private LeftListOnClickItemListener mLeftListOnClickItemListener;
+
+
+ public void setmLeftListOnClickItemListener(LeftListOnClickItemListener mLeftListOnClickItemListener) {
+ this.mLeftListOnClickItemListener = mLeftListOnClickItemListener;
+ }
+
+ public interface LeftListOnClickItemListener {
+ void onItemClick(int position);
+ }
+
+ public void setCurrentIndex(int position) {
+ this.currentIndex = position;
+ notifyDataSetChanged();
+ }
+
+}
diff --git a/My/app/src/main/java/com/example/my/Adapter/RightListAdapter.java b/My/app/src/main/java/com/example/my/Adapter/RightListAdapter.java
new file mode 100644
index 0000000..ea4f3dd
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/Adapter/RightListAdapter.java
@@ -0,0 +1,67 @@
+package com.example.my.Adapter;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.example.my.R;
+import com.example.my.entity.ProductInfo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class RightListAdapter extends RecyclerView.Adapter {
+
+ private List mProductInfo = new ArrayList<>();
+
+ public void setListData(List list) {
+ this.mProductInfo = list;
+ //刷新
+ notifyDataSetChanged();
+ }
+
+ @NonNull
+ @Override
+ public MyHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.right_list_item, null);
+ return new MyHolder(view);
+
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull MyHolder holder, int position) {
+ //绑定数据
+ ProductInfo productInfo = mProductInfo.get(position);
+ holder.pro_img.setImageResource(productInfo.getImg());
+ holder.pro_title.setText(productInfo.getTitle());
+ holder.pro_detail.setText(productInfo.getDetails());
+ holder.pro_price.setText("¥" + productInfo.getPrice()); //int+String 变成文本类型
+
+ }
+
+ @Override
+ public int getItemCount() {
+ return mProductInfo.size();
+ }
+
+ static class MyHolder extends RecyclerView.ViewHolder {
+ ImageView pro_img;
+ TextView pro_title;
+ TextView pro_detail;
+ TextView pro_price;
+
+ public MyHolder(@NonNull View itemView) {
+ super(itemView);
+ pro_img = itemView.findViewById(R.id.pro_img);
+ pro_title = itemView.findViewById(R.id.pro_title);
+ pro_detail = itemView.findViewById(R.id.pro_detail);
+ pro_price = itemView.findViewById(R.id.pro_price);
+
+ }
+ }
+}
diff --git a/My/app/src/main/java/com/example/my/BlankActivity.java b/My/app/src/main/java/com/example/my/BlankActivity.java
new file mode 100644
index 0000000..a62ae55
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/BlankActivity.java
@@ -0,0 +1,57 @@
+package com.example.my;
+
+import android.content.Intent;
+import android.database.sqlite.SQLiteDatabase;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+public class BlankActivity extends AppCompatActivity implements View.OnClickListener {
+
+ public MySQLiteOpenHelper user;
+ public SQLiteDatabase sqL_read;
+ private Button search_del_btn, insert_btn, update_btn;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_blank);
+ user = new MySQLiteOpenHelper(BlankActivity.this);
+ System.out.println("userDB=" + user);
+ /*只有调用getReadableDatabase()或者getWriteableDatabase()函数后才能返回一个SQLiteDatabase对象*/
+ sqL_read = user.getReadableDatabase();
+ System.out.println("sqLiteDatabase=" + sqL_read);
+
+ init();
+ }
+
+ //组件初始化方法
+ public void init() {
+ search_del_btn = findViewById(R.id.search_delete);
+ insert_btn = findViewById(R.id.add);
+ update_btn = findViewById(R.id.update);
+ //添加监听
+ search_del_btn.setOnClickListener(this);
+ insert_btn.setOnClickListener(this);
+ update_btn.setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View view) {
+ Intent intent;
+ if (view.getId() == R.id.search_delete) {
+ intent = new Intent(BlankActivity.this, Sea_deluser_Activity.class);
+ startActivity(intent);
+ } else if (view.getId() == R.id.add) {
+ intent = new Intent(BlankActivity.this, RegisterActivity.class);
+ startActivity(intent);
+ } else if (view.getId() == R.id.update) {
+ intent = new Intent(BlankActivity.this, Updareuser_Activity.class);
+ startActivity(intent);
+ } else {
+ // 默认情况
+ }
+ }
+}
\ No newline at end of file
diff --git a/My/app/src/main/java/com/example/my/LoginActivity.java b/My/app/src/main/java/com/example/my/LoginActivity.java
new file mode 100644
index 0000000..9437bf7
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/LoginActivity.java
@@ -0,0 +1,80 @@
+package com.example.my;
+
+import android.annotation.SuppressLint;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.activity.EdgeToEdge;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.graphics.Insets;
+import androidx.core.view.ViewCompat;
+import androidx.core.view.WindowInsetsCompat;
+
+import com.example.my.entity.User;
+
+public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
+ private TextView register, login;
+ private EditText username, password;
+ private MySQLiteOpenHelper mySQLiteOpenHelper;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ mySQLiteOpenHelper = new MySQLiteOpenHelper(this);
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_login);
+ find();
+
+ }
+ public void find(){
+ login = findViewById(R.id.login);
+ register = findViewById(R.id.register);
+ username = findViewById(R.id.userEdit);
+ password = findViewById(R.id.passEdit);
+ login.setOnClickListener(this);
+ register.setOnClickListener(this);
+ }
+ @Override
+ public void onClick(View v) {
+ if (v.getId() == R.id.login) {
+ String n = username.getText().toString();
+ String p = password.getText().toString();
+ if (n.equals("")) {
+ Toast.makeText(this, "请输入账号", Toast.LENGTH_SHORT).show();
+ } else if (p.equals("")) {
+ Toast.makeText(this, "请输入密码", Toast.LENGTH_SHORT).show();
+ } else {
+ boolean login = mySQLiteOpenHelper.login(n, p);
+ if (login) {
+ Toast.makeText(this, "登录成功!", Toast.LENGTH_SHORT).show();
+ User select = mySQLiteOpenHelper.select(n);
+ Intent home = new Intent(LoginActivity.this, MainActivity.class);
+ Bundle bundle = new Bundle();
+ bundle.putString("username", select.username);
+ bundle.putString("emil", select.email);
+ bundle.putString("phone", select.phone);
+ home.putExtras(bundle);
+ username.setText("");
+ password.setText("");
+ startActivity(home);
+ } else {
+ Toast.makeText(this, "账号或密码错误,请重新输入", Toast.LENGTH_SHORT).show();
+ password.setText("");
+ }
+ }
+ }
+ else if(v.getId()==R.id.register){
+ Intent re = new Intent(LoginActivity.this, RegisterActivity.class);
+ startActivity(re);
+ }
+ }
+ @Override
+ public void onPointerCaptureChanged(boolean hasCapture) {
+ super.onPointerCaptureChanged(hasCapture);
+ }
+
+}
diff --git a/My/app/src/main/java/com/example/my/MainActivity.java b/My/app/src/main/java/com/example/my/MainActivity.java
new file mode 100644
index 0000000..3e600b8
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/MainActivity.java
@@ -0,0 +1,125 @@
+package com.example.my;
+
+import android.app.FragmentTransaction;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.MenuItem;
+
+import androidx.activity.EdgeToEdge;
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.graphics.Insets;
+import androidx.core.view.ViewCompat;
+import androidx.core.view.WindowInsetsCompat;
+
+import com.example.my.fragment.BlankFragment;
+import com.example.my.fragment.ChatFragment;
+import com.example.my.fragment.HomeFragment;
+import com.example.my.fragment.RegFragment;
+import com.example.my.fragment.SearchFragment;
+import com.google.android.material.bottomnavigation.BottomNavigationView;
+
+public class MainActivity extends AppCompatActivity {
+
+ private HomeFragment homeFragment;
+ private ChatFragment chatFragment;
+ private SearchFragment searchFragment;
+ private RegFragment regFragment;
+ private BlankFragment blankFragment;
+
+ private BottomNavigationView bottomNavigationView;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ //初始化控件
+ bottomNavigationView = findViewById(R.id.BottomNavigation);
+ //bottomNavigationView设置点击事件
+ bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
+ @Override
+ public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
+ if (menuItem.getItemId() == R.id.home) {
+ selectedFragment(0);
+ } else if (menuItem.getItemId() == R.id.chat) {
+ selectedFragment(1);
+ } else if (menuItem.getItemId() == R.id.search) {
+ selectedFragment(2);
+ } else if (menuItem.getItemId() == R.id.reg) {
+ selectedFragment(3);
+ } else {
+ selectedFragment(4);
+ }
+ return true;
+ }
+ });
+ }
+ //默认首页选中
+
+ private void selectedFragment(int position) {
+ androidx.fragment.app.FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
+ hideFragment(fragmentTransaction);
+ if (position == 0) {
+ if (homeFragment == null) {
+ homeFragment = new HomeFragment();
+ fragmentTransaction.add(R.id.content, homeFragment);
+ } else {
+ fragmentTransaction.show(homeFragment);
+ }
+ } else if (position == 1) {
+ if (chatFragment == null) {
+ chatFragment = new ChatFragment();
+ fragmentTransaction.add(R.id.content, chatFragment);
+ } else {
+ fragmentTransaction.show(chatFragment);
+ }
+ } else if (position == 2) {
+ if (searchFragment == null) {
+ searchFragment = new SearchFragment();
+ fragmentTransaction.add(R.id.content, searchFragment);
+ } else {
+ fragmentTransaction.show(searchFragment);
+ }
+ } else if (position == 3) {
+ if (regFragment == null) {
+ regFragment = new RegFragment();
+ fragmentTransaction.add(R.id.content, regFragment);
+ } else {
+ fragmentTransaction.show(regFragment);
+ }
+ } else {
+
+ if (blankFragment == null ) { // shouldStartBlankActivity 可以是一个额外的条件,用于判断是否应该启动 Activity
+ Intent intent = new Intent(this, BlankActivity.class);
+ // 你可以在这里添加额外的数据到 intent 中
+ // 例如: intent.putExtra("key", value);
+ startActivity(intent);
+ } else {
+ // 如果 blankFragment 不为 null,并且不应该启动新的 Activity,
+ // 那么你可以在这里处理 blankFragment 的显示逻辑,比如使用 fragmentTransaction 来显示它
+ // 例如: fragmentTransaction.show(blankFragment);
+ // 但根据你的原始代码,这部分逻辑看起来是省略的,因为你只在 else 分支中显示了 Fragment
+ }
+ }
+
+ //提交
+ fragmentTransaction.commit();
+
+ }
+
+ private void hideFragment(androidx.fragment.app.FragmentTransaction fragmentTransaction) {
+ if (homeFragment != null) {
+ fragmentTransaction.hide(homeFragment);
+ }
+ if (chatFragment != null) {
+ fragmentTransaction.hide(chatFragment);
+ }
+ if (searchFragment != null) {
+ fragmentTransaction.hide(searchFragment);
+ }
+ if (regFragment != null) {
+ fragmentTransaction.hide(regFragment);
+ }
+ }
+}
diff --git a/My/app/src/main/java/com/example/my/MySQLiteOpenHelper.java b/My/app/src/main/java/com/example/my/MySQLiteOpenHelper.java
new file mode 100644
index 0000000..44a67b6
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/MySQLiteOpenHelper.java
@@ -0,0 +1,172 @@
+package com.example.my;
+
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteConstraintException;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.util.Log;
+
+import androidx.annotation.Nullable;
+
+import com.example.my.entity.User;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MySQLiteOpenHelper extends SQLiteOpenHelper {
+
+ //数据库名字
+ private static final String DATABASE_NAME = "mydatabase";
+ private static final int DATABASE_VERSION = 1;
+ private static final String TABLE_USERS = "users";
+ private static final String COLUMN_ID = "id";
+ private static final String COLUMN_USERNAME = "username";
+ private static final String COLUMN_EMAIL = "email";
+ private static final String COLUMN_PHONE = "phone";
+ private static final String COLUMN_PASSWORD = "password";
+
+ // 数据库创建语句
+ private static final String DATABASE_CREATE =
+ "CREATE TABLE " + TABLE_USERS + " (" +
+ COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
+ COLUMN_USERNAME + " TEXT NOT NULL, " +
+ COLUMN_EMAIL + " TEXT NOT NULL, " +
+ COLUMN_PHONE + " TEXT NOT NULL, " +
+ COLUMN_PASSWORD + " TEXT NOT NULL);";
+
+ public MySQLiteOpenHelper(Context context) {
+ super(context, DATABASE_NAME, null, DATABASE_VERSION);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase database) {
+ database.execSQL(DATABASE_CREATE);
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+
+ }
+
+ public long register(User user) {
+ SQLiteDatabase db = getWritableDatabase();
+ ContentValues values = new ContentValues();
+ values.put("username", user.getUsername());
+ values.put("password", user.getPassword());
+ values.put("phone", user.getPhone());
+ values.put("email", user.getEmil());
+
+ try {
+ long userId = db.insert("users", null, values);
+ // 添加日志记录以便调试
+ Log.d("Register", "New user inserted with ID: " + userId);
+ return userId;
+ } catch (SQLiteConstraintException e) {
+ // 处理主键冲突等异常
+ Log.e("Register", "Error inserting new user: " + e.getMessage());
+ return -1;
+ } catch (Exception e) {
+ // 处理其他可能的异常
+ Log.e("Register", "Error inserting new user: " + e.getMessage());
+ return -1;
+ }
+ }
+
+ //登录方法实现
+ public boolean login(String username, String password) {
+ SQLiteDatabase db = getWritableDatabase();
+ boolean result = false;
+ Cursor users = db.query("users", null, "username like?", new String[]{username}, null, null, null);
+ if (users != null) {
+ while (users.moveToNext()) {
+ @SuppressLint("Range") String username1 = users.getString(users.getColumnIndex("username"));
+ Log.i("users", "login: " + username1);
+ @SuppressLint("Range") String password1 = users.getString(users.getColumnIndex("password"));
+ Log.i("users", "login: " + password1);
+ // 假设我们在这里验证密码
+ if (password1.equals(password)) {
+ result = true;
+ break; // 找到匹配的用户名和密码,退出循环
+ }
+ }
+ users.close();
+ }
+ return result;
+ }
+
+ //根据用户名查找当前登录用户信息
+ public User select(String username) {
+ SQLiteDatabase db = getWritableDatabase();
+ User SelectUser = new User();
+ Cursor user = db.query("users", new String[]{"username", "phone", "email"}, "username=?", new String[]{username}, null, null, null);
+ while (user.moveToNext()) {
+ @SuppressLint("Range") String uname = user.getString(user.getColumnIndex("username"));
+ @SuppressLint("Range") String phone = user.getString(user.getColumnIndex("phone"));
+ @SuppressLint("Range") String email = user.getString(user.getColumnIndex("email"));
+ SelectUser.setUsername(uname);
+ SelectUser.setPhone(phone);
+ SelectUser.setEmail(email);
+ }
+ user.close();
+ return SelectUser;
+ }
+
+ public void adddata(SQLiteDatabase sqLiteDatabase, String username, String paswd, String email, String phone) {
+ ContentValues values = new ContentValues();
+ values.put("username", username);
+ values.put("paswd", paswd);
+ values.put("email", email);
+ values.put("phone", phone);
+ sqLiteDatabase.insert("users", null, values);
+ sqLiteDatabase.close();
+ }
+
+ //删除数据
+ public void delete(SQLiteDatabase sqLiteDatabase, int id) {
+ /*第一个参数:表名;第二个参数:需要删除的属性名,?代表占位符;第三个参数:属性名的属性值*/
+ sqLiteDatabase.delete("users", "id=?", new String[]{id + ""});
+ sqLiteDatabase.close();
+ }
+
+ //更新数据
+ public void update(SQLiteDatabase sqLiteDatabase, int id, String username,
+ String paswd, String phone, int email) {
+ //创建一个ContentValues对象
+ ContentValues values = new ContentValues();
+ //以键值对的形式插入
+ values.put("username", username);
+ values.put("paswd", paswd);
+ values.put("phone", phone);
+ values.put("email", email);
+ //执行修改的方法
+ sqLiteDatabase.update("users", values, "id=?", new String[]{id + ""});
+ sqLiteDatabase.close();
+ }
+
+ //查询数据
+ public List querydata(SQLiteDatabase sqLiteDatabase) {
+ Cursor cursor = sqLiteDatabase.query("users", null, null, null, null, null, "id ASC");
+ List list = new ArrayList();
+ while (cursor.moveToNext()) {
+ @SuppressLint("Range") int id = cursor.getInt(cursor.getColumnIndex("id"));
+ Log.i("SQLite", "id=" + id);
+ String username = cursor.getString(0);
+ Log.i("SQLite", "username=" + username);
+ String paswd = cursor.getString(1);
+ Log.i("SQLite", "paswd=" + paswd);
+ String phone = cursor.getString(2);
+ Log.i("SQLite", "phone=" + phone);
+ String email = cursor.getString(4);
+ Log.i("SQLite", "email=" + email);
+ list.add(new User(id, username, paswd, phone, email));
+ }
+ cursor.close();
+ sqLiteDatabase.close();
+ return list;
+ }
+
+}
\ No newline at end of file
diff --git a/My/app/src/main/java/com/example/my/RegisterActivity.java b/My/app/src/main/java/com/example/my/RegisterActivity.java
new file mode 100644
index 0000000..1a5f200
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/RegisterActivity.java
@@ -0,0 +1,105 @@
+package com.example.my;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.Toast;
+
+import androidx.activity.EdgeToEdge;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.example.my.entity.User;
+
+public class RegisterActivity extends AppCompatActivity implements View.OnClickListener {
+
+ private String name_str = "";
+ private String phone_str = " ";
+ private String email_str = " ";
+ private String paswd_str = " ";
+ EditText name_edit, phone_edit, email_edit, paswd_edit;
+ Button button;
+ //使用MySQLiteOpenHelper类中的方法
+ private MySQLiteOpenHelper mySQLiteOpenHelper;
+
+
+ //控制注册按钮点击完后不给点击了
+ boolean flag = false;
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ mySQLiteOpenHelper = new MySQLiteOpenHelper(this);
+ super.onCreate(savedInstanceState);
+ EdgeToEdge.enable(this);
+ setContentView(R.layout.activity_register);
+
+// 组件初始化
+ name_edit = (EditText) findViewById(R.id.nameEdit);
+ phone_edit = (EditText) findViewById(R.id.pnumEdit);
+ email_edit = (EditText) findViewById(R.id.userEdit);
+ paswd_edit = (EditText) findViewById(R.id.passEdit);
+// 添加监听事件
+ button = (Button) findViewById(R.id.submit);
+ button.setOnClickListener((View.OnClickListener) this);
+ }
+
+ @Override
+ public void onClick(View view) {
+ if (view.getId() == R.id.submit) {
+// name_str = name_edit.getText().toString();
+// phone_str = phone_edit.getText().toString();
+// email_str = email_edit.getText().toString();
+// paswd_str = paswd_edit.getText().toString();
+// Intent intent = new Intent(RegisterActivity.this, RegisterActivity2.class);
+// Bundle bundle = new Bundle();
+// bundle.putString("name", name_str);
+// bundle.putString("phone", phone_str);
+// bundle.putString("email", email_str);
+// bundle.putString("paswd", paswd_str);
+// intent.putExtras(bundle);
+// startActivity(intent);
+ register();
+ gobak(view);
+ }
+ }
+
+ public void register(){
+ String ru = name_edit.getText().toString();
+ String rps = paswd_edit.getText().toString();
+ String rph = phone_edit.getText().toString();
+ String rem = email_edit.getText().toString();
+ User user = new User(ru,rps,rph,rem);
+ if(ru.equals("")){
+ Toast.makeText(this, "账号不能为空!", Toast.LENGTH_SHORT).show();
+ } else if (rps.equals("")) {
+ Toast.makeText(this, "密码不能为空!", Toast.LENGTH_SHORT).show();
+ } else if (rph.equals("")) {
+ Toast.makeText(this, "电话不能为空!", Toast.LENGTH_SHORT).show();
+ }else if(rem.equals("")){
+ Toast.makeText(this, "邮箱不能为空!", Toast.LENGTH_SHORT).show();
+ }else{
+ long r1 = mySQLiteOpenHelper.register(user);
+ button.setEnabled(false);
+ button.setTextColor(0xFFD0EFC6);
+ if(r1!=-1){
+ Toast.makeText(this, "注册成功", Toast.LENGTH_SHORT).show();
+ }else{
+ Toast.makeText(this, "注册失败!", Toast.LENGTH_SHORT).show();
+ }
+ }
+ }
+ //跳转回登录页面
+ public void gobak(View view){
+ Intent gl = new Intent(RegisterActivity.this,LoginActivity.class);
+ startActivity(gl);
+ }
+ @Override
+ public void onPointerCaptureChanged(boolean hasCapture) {
+ super.onPointerCaptureChanged(hasCapture);
+ }
+
+
+
+}
\ No newline at end of file
diff --git a/My/app/src/main/java/com/example/my/Sea_deluser_Activity.java b/My/app/src/main/java/com/example/my/Sea_deluser_Activity.java
new file mode 100644
index 0000000..3e78111
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/Sea_deluser_Activity.java
@@ -0,0 +1,104 @@
+package com.example.my;
+
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.database.sqlite.SQLiteDatabase;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.view.Window;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.ListView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.example.my.entity.User;
+
+import java.util.List;
+
+public class Sea_deluser_Activity extends AppCompatActivity {
+ public ListView user_list;
+ private List list;
+ private SQLiteDatabase sqLiteDatabase;
+ //假设数据库用户不超过10个
+ private String[] user_mes;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+
+ super.onCreate(savedInstanceState);
+ Log.i("SQLite","Sea_del");
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ setContentView(R.layout.user_search_delete);
+ user_list=findViewById(R.id.mes);
+ MySQLiteOpenHelper users=new MySQLiteOpenHelper(Sea_deluser_Activity.this);
+ sqLiteDatabase=users.getReadableDatabase();
+ //获取从数据库查询到的数据
+ list=users.querydata(sqLiteDatabase);
+ Log.i("SQLite","list.size()="+list.size());
+ //把获取到的信息添加到用户名数组中
+ if (list != null && list.size() > 0) {
+ // 把获取到的信息添加到用户名数组中
+ user_mes = new String[list.size()];
+ for (int i = 0; i < list.size(); i++) {
+ user_mes[i] = list.get(i).getUsername() + " " +
+ list.get(i).getPassword() + " " +
+ list.get(i).getPhone() + " " +
+ list.get(i).getEmil();
+ }
+
+ // 把用户名显示在ListView上
+ final ArrayAdapter adapter = new ArrayAdapter(
+ Sea_deluser_Activity.this, android.R.layout.simple_list_item_1, user_mes);
+
+ // 检查user_mes是否为空
+ if (user_mes != null && user_mes.length > 0) {
+ user_list.setAdapter(adapter);
+ } else {
+ // user_mes为空的情况处理
+ Toast.makeText(Sea_deluser_Activity.this, "没有数据可显示", Toast.LENGTH_SHORT).show();
+ }
+ } else {
+ // list为空的情况处理
+ Toast.makeText(Sea_deluser_Activity.this, "查询没有返回任何数据", Toast.LENGTH_SHORT).show();
+ }
+
+
+ //为listview每个元素添加点击事件
+ user_list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
+ final int id=list.get(i).getId();
+ //弹出一个对话框
+ new AlertDialog.Builder(Sea_deluser_Activity.this).setTitle("系统提示")
+ //设置显示的内容
+ .setMessage("确定删除该条数据吗!")
+ //添加确定按钮
+ .setPositiveButton("确定",new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ //删除数据操作,首先获取到id
+ MySQLiteOpenHelper user_database=new MySQLiteOpenHelper(Sea_deluser_Activity.this);
+ SQLiteDatabase sqLiteDatabase=user_database.getWritableDatabase();
+ user_database.delete(sqLiteDatabase,id);
+ refresh();
+ Toast.makeText(Sea_deluser_Activity.this,"删除成功",Toast.LENGTH_SHORT).show();
+ }
+ }).setNegativeButton("取消",new DialogInterface.OnClickListener() {//添加返回按钮
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+
+ }
+ }).show();//在按键响应事件中显示此对话框
+ }
+ });
+ }
+ //刷新页面方法
+ private void refresh() {
+ finish();
+ Intent intent = new Intent(Sea_deluser_Activity.this, Sea_deluser_Activity.class);
+ startActivity(intent);
+ }
+}
diff --git a/My/app/src/main/java/com/example/my/Updareuser_Activity.java b/My/app/src/main/java/com/example/my/Updareuser_Activity.java
new file mode 100644
index 0000000..0435c23
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/Updareuser_Activity.java
@@ -0,0 +1,13 @@
+package com.example.my;
+
+import android.os.Bundle;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+public class Updareuser_Activity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ }
+}
diff --git a/My/app/src/main/java/com/example/my/entity/DataService.java b/My/app/src/main/java/com/example/my/entity/DataService.java
new file mode 100644
index 0000000..788db18
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/entity/DataService.java
@@ -0,0 +1,37 @@
+package com.example.my.entity;
+
+import com.example.my.R;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class DataService {
+
+ public static List getListData(int position) {
+ List list = new ArrayList<>();
+ if (position == 0) {
+ list.add(new ProductInfo(0, R.drawable.zz1, "张江碧云苑", "张江集团专浦东地区人员量身定制的服务型租赁社区,坐落于张江高科园南区毗邻中环线申江路段。国企房源,品质有保证", 8500));
+ list.add(new ProductInfo(0, R.drawable.zz2, "云湖壹号", "该项目小区规划得分高于90.6%本区同类型物业楼盘,社区内配备了访客系统、可视对讲系统、周界防范警报系统等等", 12000));
+ list.add(new ProductInfo(0, R.drawable.zz3, "新江湾城", "该户型拥有270°观景阳台,超明亮采光,小区生活、交通便捷,环境宜人,物业完备", 8233));
+ } else if (position == 1) {
+ list.add(new ProductInfo(0, R.drawable.zz2, "云湖壹号", "该项目小区规划得分高于90.6%本区同类型物业楼盘,社区内配备了访客系统、可视对讲系统、周界防范警报系统等等", 12000));
+ list.add(new ProductInfo(0, R.drawable.zz3, "新江湾城", "该户型拥有270°观景阳台,超明亮采光,小区生活、交通便捷,环境宜人,物业完备", 8233));
+ } else if (position == 2) {
+ list.add(new ProductInfo(0, R.drawable.zz1, "张江碧云苑", "张江集团专浦东地区人员量身定制的服务型租赁社区,坐落于张江高科园南区毗邻中环线申江路段。国企房源,品质有保证", 8500));
+ list.add(new ProductInfo(0, R.drawable.zz2, "云湖壹号", "该项目小区规划得分高于90.6%本区同类型物业楼盘,社区内配备了访客系统、可视对讲系统、周界防范警报系统等等", 12000));
+ list.add(new ProductInfo(0, R.drawable.zz3, "新江湾城", "该户型拥有270°观景阳台,超明亮采光,小区生活、交通便捷,环境宜人,物业完备", 8233));
+ } else if (position == 3) {
+ list.add(new ProductInfo(0, R.drawable.zz2, "云湖壹号", "该项目小区规划得分高于90.6%本区同类型物业楼盘,社区内配备了访客系统、可视对讲系统、周界防范警报系统等等", 12000));
+ list.add(new ProductInfo(0, R.drawable.zz3, "新江湾城", "该户型拥有270°观景阳台,超明亮采光,小区生活、交通便捷,环境宜人,物业完备", 8233));
+
+ } else if (position == 4) {
+ list.add(new ProductInfo(0, R.drawable.zz1, "张江碧云苑", "张江集团专浦东地区人员量身定制的服务型租赁社区,坐落于张江高科园南区毗邻中环线申江路段。国企房源,品质有保证", 8500));
+ list.add(new ProductInfo(0, R.drawable.zz2, "云湖壹号", "该项目小区规划得分高于90.6%本区同类型物业楼盘,社区内配备了访客系统、可视对讲系统、周界防范警报系统等等", 12000));
+ list.add(new ProductInfo(0, R.drawable.zz3, "新江湾城", "该户型拥有270°观景阳台,超明亮采光,小区生活、交通便捷,环境宜人,物业完备", 8233));
+ } else if (position == 5) {
+ list.add(new ProductInfo(0, R.drawable.zz1, "张江碧云苑", "张江集团专浦东地区人员量身定制的服务型租赁社区,坐落于张江高科园南区毗邻中环线申江路段。国企房源,品质有保证", 8500));
+ list.add(new ProductInfo(0, R.drawable.zz2, "云湖壹号", "该项目小区规划得分高于90.6%本区同类型物业楼盘,社区内配备了访客系统、可视对讲系统、周界防范警报系统等等", 12000));
+ }
+ return list;
+ }
+}
diff --git a/My/app/src/main/java/com/example/my/entity/ProductInfo.java b/My/app/src/main/java/com/example/my/entity/ProductInfo.java
new file mode 100644
index 0000000..6fb2ccc
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/entity/ProductInfo.java
@@ -0,0 +1,57 @@
+package com.example.my.entity;
+
+public class ProductInfo {
+ private int id;
+ private int img;
+ private String title;
+ private String details;
+ private int price;
+
+ public ProductInfo(int id, int img, String title, String details, int price) {
+ this.id = id;
+ this.img = img;
+ this.title = title;
+ this.details = details;
+ this.price = price;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public int getImg() {
+ return img;
+ }
+
+ public void setImg(int img) {
+ this.img = img;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getDetails() {
+ return details;
+ }
+
+ public void setDetails(String details) {
+ this.details = details;
+ }
+
+ public int getPrice() {
+ return price;
+ }
+
+ public void setPrice(int price) {
+ this.price = price;
+ }
+}
diff --git a/My/app/src/main/java/com/example/my/entity/User.java b/My/app/src/main/java/com/example/my/entity/User.java
new file mode 100644
index 0000000..b223b26
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/entity/User.java
@@ -0,0 +1,99 @@
+package com.example.my.entity;
+
+public class User {
+ public String username;
+ public String password;
+ public String phone;
+ public String email;
+
+ public String age;
+
+ public String sex;
+
+ public int id;
+
+ public User() {
+ }
+
+ public User(String username, String password, String phone, String emil) {
+ this.username = username;
+ this.password = password;
+ this.phone = phone;
+ this.email = emil;
+ }
+
+ public User(int id,String username, String password, String phone, String emil ) {
+ this.username = username;
+ this.password = password;
+ this.phone = phone;
+ this.email = emil;
+ 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 getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getEmil() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getAge() {
+ return age;
+ }
+
+ public void setAge(String age) {
+ this.age = age;
+ }
+
+ public String getSex() {
+ return sex;
+ }
+
+ public void setSex(String sex) {
+ this.sex = sex;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ @Override
+ public String toString() {
+ return "User{" +
+ "username='" + username + '\'' +
+ ", password='" + password + '\'' +
+ ", phone='" + phone + '\'' +
+ ", emil='" + email + '\'' +
+ ", id=" + id +
+ '}';
+ }
+}
diff --git a/My/app/src/main/java/com/example/my/fragment/BlankFragment.java b/My/app/src/main/java/com/example/my/fragment/BlankFragment.java
new file mode 100644
index 0000000..b97dfea
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/fragment/BlankFragment.java
@@ -0,0 +1,62 @@
+package com.example.my.fragment;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.database.sqlite.SQLiteDatabase;
+import android.os.Bundle;
+
+import android.view.View;
+import android.widget.Button;
+
+import com.example.my.MySQLiteOpenHelper;
+import com.example.my.R;
+import com.example.my.RegisterActivity;
+import com.example.my.Sea_deluser_Activity;
+import com.example.my.Updareuser_Activity;
+
+public class BlankFragment extends Activity implements View.OnClickListener{
+
+ public MySQLiteOpenHelper user;
+ public SQLiteDatabase sqL_read;
+ private Button search_del_btn, insert_btn, update_btn;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ MySQLiteOpenHelper user = new MySQLiteOpenHelper(this);
+ System.out.println("userDB=" + user);
+ /*只有调用getReadableDatabase()或者getWriteableDatabase()函数后才能返回一个SQLiteDatabase对象*/
+ SQLiteDatabase sqLiteDatabase = user.getReadableDatabase();
+ System.out.println("sqLiteDatabase=" + sqLiteDatabase);
+ init();
+ }
+
+ //组件初始化方法
+ public void init() {
+// search_del_btn = findViewById(R.id.search_delete);
+// insert_btn = findViewById(R.id.add);
+// update_btn = findViewById(R.id.update);
+// //添加监听
+// search_del_btn.setOnClickListener(this);
+// insert_btn.setOnClickListener(this);
+// update_btn.setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View view) {
+// Intent intent;
+// if (view.getId() == R.id.search_delete) {
+// intent = new Intent(BlankFragment.this, Sea_deluser_Activity.class);
+// startActivity(intent);
+// } else if (view.getId() == R.id.add) {
+// intent = new Intent(BlankFragment.this, RegisterActivity.class);
+// startActivity(intent);
+// } else if (view.getId() == R.id.update) {
+// intent = new Intent(BlankFragment.this, Updareuser_Activity.class);
+// startActivity(intent);
+// } else {
+// // 默认情况
+// }
+ }
+}
\ No newline at end of file
diff --git a/My/app/src/main/java/com/example/my/fragment/ChatFragment.java b/My/app/src/main/java/com/example/my/fragment/ChatFragment.java
new file mode 100644
index 0000000..25da839
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/fragment/ChatFragment.java
@@ -0,0 +1,23 @@
+package com.example.my.fragment;
+
+import android.os.Bundle;
+
+import androidx.fragment.app.Fragment;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.example.my.R;
+
+
+public class ChatFragment extends Fragment {
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_chat, container, false);
+ }
+}
\ No newline at end of file
diff --git a/My/app/src/main/java/com/example/my/fragment/HomeFragment.java b/My/app/src/main/java/com/example/my/fragment/HomeFragment.java
new file mode 100644
index 0000000..d83094e
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/fragment/HomeFragment.java
@@ -0,0 +1,78 @@
+package com.example.my.fragment;
+
+import android.os.Bundle;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.recyclerview.widget.RecyclerView;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Toast;
+
+import com.example.my.Adapter.LeftListAdapter;
+import com.example.my.Adapter.RightListAdapter;
+import com.example.my.R;
+import com.example.my.entity.DataService;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class HomeFragment extends Fragment {
+
+ private View rootView;
+ private RecyclerView leftRecyclerView;
+ private LeftListAdapter mLeftListAdapter;
+
+ private List left_date = new ArrayList<>();
+ private RecyclerView rightRecyclerView;
+
+ private RightListAdapter mRightListAdapter;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+
+ // Inflate the layout for this fragment
+ rootView = inflater.inflate(R.layout.fragment_home, container, false);
+
+ //初始化控件
+ leftRecyclerView = rootView.findViewById(R.id.leftlist);
+ rightRecyclerView=rootView.findViewById(R.id.rightlist);
+ return rootView;
+ }
+
+ @Override
+ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+
+ left_date.add("整租");
+ left_date.add("合租");
+ left_date.add("短租");
+ left_date.add("公寓");
+ left_date.add("新房");
+ left_date.add("二手房");
+
+ mLeftListAdapter = new LeftListAdapter(left_date);
+ leftRecyclerView.setAdapter(mLeftListAdapter);
+
+ mRightListAdapter=new RightListAdapter();
+ rightRecyclerView.setAdapter(mRightListAdapter);
+ //默认加载数据
+ mRightListAdapter.setListData(DataService.getListData(0));
+
+ //点击事件
+ mLeftListAdapter.setmLeftListOnClickItemListener(new LeftListAdapter.LeftListOnClickItemListener() {
+ @Override
+ public void onItemClick(int position) {
+ mLeftListAdapter.setCurrentIndex(position);
+ //点击左侧分类切换对应的列表数据
+ mRightListAdapter.setListData(DataService.getListData(position));
+
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/My/app/src/main/java/com/example/my/fragment/RegFragment.java b/My/app/src/main/java/com/example/my/fragment/RegFragment.java
new file mode 100644
index 0000000..ed3bda7
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/fragment/RegFragment.java
@@ -0,0 +1,23 @@
+package com.example.my.fragment;
+
+import android.os.Bundle;
+
+import androidx.fragment.app.Fragment;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.example.my.R;
+
+
+public class RegFragment extends Fragment {
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_reg, container, false);
+ }
+}
\ No newline at end of file
diff --git a/My/app/src/main/java/com/example/my/fragment/SearchFragment.java b/My/app/src/main/java/com/example/my/fragment/SearchFragment.java
new file mode 100644
index 0000000..31dad2f
--- /dev/null
+++ b/My/app/src/main/java/com/example/my/fragment/SearchFragment.java
@@ -0,0 +1,75 @@
+package com.example.my.fragment;
+
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.recyclerview.widget.RecyclerView;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.example.my.Adapter.LeftListAdapter;
+import com.example.my.Adapter.RightListAdapter;
+import com.example.my.R;
+import com.example.my.entity.DataService;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class SearchFragment extends Fragment {
+
+ private View rootView;
+ private RecyclerView leftRecyclerView;
+ private LeftListAdapter nLeftListAdapter;
+
+ private List left_date1 = new ArrayList<>();
+ private RecyclerView rightRecyclerView;
+
+ private RightListAdapter nRightListAdapter;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ rootView = inflater.inflate(R.layout.fragment_search, container, false);
+
+
+ //初始化控件
+ leftRecyclerView = rootView.findViewById(R.id.leftlist);
+ rightRecyclerView = rootView.findViewById(R.id.rightlist);
+ return rootView;
+ }
+
+ @Override
+ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+
+ left_date1.add("整租");
+ left_date1.add("合租");
+ left_date1.add("短租");
+ left_date1.add("公寓");
+ left_date1.add("新房");
+ left_date1.add("二手房");
+
+ nLeftListAdapter = new LeftListAdapter(left_date1);
+ leftRecyclerView.setAdapter(nLeftListAdapter);
+
+ nRightListAdapter = new RightListAdapter();
+ rightRecyclerView.setAdapter(nRightListAdapter);
+ //默认加载数据
+ nRightListAdapter.setListData(DataService.getListData(0));
+
+ //点击事件
+ nLeftListAdapter.setmLeftListOnClickItemListener(new LeftListAdapter.LeftListOnClickItemListener() {
+ @Override
+ public void onItemClick(int position) {
+ nLeftListAdapter.setCurrentIndex(position);
+ //点击左侧分类切换对应的列表数据
+ nRightListAdapter.setListData(DataService.getListData(position));
+
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/My/app/src/main/res/drawable/add.png b/My/app/src/main/res/drawable/add.png
new file mode 100644
index 0000000..ef9d9c7
Binary files /dev/null and b/My/app/src/main/res/drawable/add.png differ
diff --git a/My/app/src/main/res/drawable/bookmark.png b/My/app/src/main/res/drawable/bookmark.png
new file mode 100644
index 0000000..39d5255
Binary files /dev/null and b/My/app/src/main/res/drawable/bookmark.png differ
diff --git a/My/app/src/main/res/drawable/chat.png b/My/app/src/main/res/drawable/chat.png
new file mode 100644
index 0000000..ffc321f
Binary files /dev/null and b/My/app/src/main/res/drawable/chat.png differ
diff --git a/My/app/src/main/res/drawable/darkgreen_button_background.xml b/My/app/src/main/res/drawable/darkgreen_button_background.xml
new file mode 100644
index 0000000..b50816a
--- /dev/null
+++ b/My/app/src/main/res/drawable/darkgreen_button_background.xml
@@ -0,0 +1,9 @@
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/drawable/edit_shape.xml b/My/app/src/main/res/drawable/edit_shape.xml
new file mode 100644
index 0000000..ade080f
--- /dev/null
+++ b/My/app/src/main/res/drawable/edit_shape.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/drawable/edittext_background.xml b/My/app/src/main/res/drawable/edittext_background.xml
new file mode 100644
index 0000000..d8cc039
--- /dev/null
+++ b/My/app/src/main/res/drawable/edittext_background.xml
@@ -0,0 +1,9 @@
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/drawable/edittext_background2.xml b/My/app/src/main/res/drawable/edittext_background2.xml
new file mode 100644
index 0000000..43cd1b8
--- /dev/null
+++ b/My/app/src/main/res/drawable/edittext_background2.xml
@@ -0,0 +1,9 @@
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/drawable/exit.png b/My/app/src/main/res/drawable/exit.png
new file mode 100644
index 0000000..5fd8696
Binary files /dev/null and b/My/app/src/main/res/drawable/exit.png differ
diff --git a/My/app/src/main/res/drawable/facebook.png b/My/app/src/main/res/drawable/facebook.png
new file mode 100644
index 0000000..5a8d3ef
Binary files /dev/null and b/My/app/src/main/res/drawable/facebook.png differ
diff --git a/My/app/src/main/res/drawable/favorite.png b/My/app/src/main/res/drawable/favorite.png
new file mode 100644
index 0000000..444ac0a
Binary files /dev/null and b/My/app/src/main/res/drawable/favorite.png differ
diff --git a/My/app/src/main/res/drawable/favorite2.png b/My/app/src/main/res/drawable/favorite2.png
new file mode 100644
index 0000000..88dfab5
Binary files /dev/null and b/My/app/src/main/res/drawable/favorite2.png differ
diff --git a/My/app/src/main/res/drawable/google.png b/My/app/src/main/res/drawable/google.png
new file mode 100644
index 0000000..17d2576
Binary files /dev/null and b/My/app/src/main/res/drawable/google.png differ
diff --git a/My/app/src/main/res/drawable/grey_background.xml b/My/app/src/main/res/drawable/grey_background.xml
new file mode 100644
index 0000000..81458c2
--- /dev/null
+++ b/My/app/src/main/res/drawable/grey_background.xml
@@ -0,0 +1,9 @@
+
+
+-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/drawable/home.png b/My/app/src/main/res/drawable/home.png
new file mode 100644
index 0000000..0428cf1
Binary files /dev/null and b/My/app/src/main/res/drawable/home.png differ
diff --git a/My/app/src/main/res/drawable/home1.png b/My/app/src/main/res/drawable/home1.png
new file mode 100644
index 0000000..803878c
Binary files /dev/null and b/My/app/src/main/res/drawable/home1.png differ
diff --git a/My/app/src/main/res/drawable/ic_launcher_background.xml b/My/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/My/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/My/app/src/main/res/drawable/ic_launcher_foreground.xml b/My/app/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/My/app/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/drawable/light_green_background.xml b/My/app/src/main/res/drawable/light_green_background.xml
new file mode 100644
index 0000000..a48e9f8
--- /dev/null
+++ b/My/app/src/main/res/drawable/light_green_background.xml
@@ -0,0 +1,9 @@
+
+
+-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/drawable/location.png b/My/app/src/main/res/drawable/location.png
new file mode 100644
index 0000000..b125927
Binary files /dev/null and b/My/app/src/main/res/drawable/location.png differ
diff --git a/My/app/src/main/res/drawable/login.png b/My/app/src/main/res/drawable/login.png
new file mode 100644
index 0000000..37a2da7
Binary files /dev/null and b/My/app/src/main/res/drawable/login.png differ
diff --git a/My/app/src/main/res/drawable/menu.png b/My/app/src/main/res/drawable/menu.png
new file mode 100644
index 0000000..464608c
Binary files /dev/null and b/My/app/src/main/res/drawable/menu.png differ
diff --git a/My/app/src/main/res/drawable/more.png b/My/app/src/main/res/drawable/more.png
new file mode 100644
index 0000000..9ddfd57
Binary files /dev/null and b/My/app/src/main/res/drawable/more.png differ
diff --git a/My/app/src/main/res/drawable/pearson.png b/My/app/src/main/res/drawable/pearson.png
new file mode 100644
index 0000000..90cf0eb
Binary files /dev/null and b/My/app/src/main/res/drawable/pearson.png differ
diff --git a/My/app/src/main/res/drawable/product.png b/My/app/src/main/res/drawable/product.png
new file mode 100644
index 0000000..8f5cb21
Binary files /dev/null and b/My/app/src/main/res/drawable/product.png differ
diff --git a/My/app/src/main/res/drawable/reg.png b/My/app/src/main/res/drawable/reg.png
new file mode 100644
index 0000000..a1dd758
Binary files /dev/null and b/My/app/src/main/res/drawable/reg.png differ
diff --git a/My/app/src/main/res/drawable/register.png b/My/app/src/main/res/drawable/register.png
new file mode 100644
index 0000000..e547ccd
Binary files /dev/null and b/My/app/src/main/res/drawable/register.png differ
diff --git a/My/app/src/main/res/drawable/register2.png b/My/app/src/main/res/drawable/register2.png
new file mode 100644
index 0000000..7faaaff
Binary files /dev/null and b/My/app/src/main/res/drawable/register2.png differ
diff --git a/My/app/src/main/res/drawable/search.png b/My/app/src/main/res/drawable/search.png
new file mode 100644
index 0000000..ffe191f
Binary files /dev/null and b/My/app/src/main/res/drawable/search.png differ
diff --git a/My/app/src/main/res/drawable/setting.png b/My/app/src/main/res/drawable/setting.png
new file mode 100644
index 0000000..34c2f2f
Binary files /dev/null and b/My/app/src/main/res/drawable/setting.png differ
diff --git a/My/app/src/main/res/drawable/shoppingcart.png b/My/app/src/main/res/drawable/shoppingcart.png
new file mode 100644
index 0000000..76c06de
Binary files /dev/null and b/My/app/src/main/res/drawable/shoppingcart.png differ
diff --git a/My/app/src/main/res/drawable/star.png b/My/app/src/main/res/drawable/star.png
new file mode 100644
index 0000000..58d700e
Binary files /dev/null and b/My/app/src/main/res/drawable/star.png differ
diff --git a/My/app/src/main/res/drawable/submit_button.xml b/My/app/src/main/res/drawable/submit_button.xml
new file mode 100644
index 0000000..a170839
--- /dev/null
+++ b/My/app/src/main/res/drawable/submit_button.xml
@@ -0,0 +1,9 @@
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/drawable/twitter.png b/My/app/src/main/res/drawable/twitter.png
new file mode 100644
index 0000000..77d7481
Binary files /dev/null and b/My/app/src/main/res/drawable/twitter.png differ
diff --git a/My/app/src/main/res/drawable/type_select_bg.xml b/My/app/src/main/res/drawable/type_select_bg.xml
new file mode 100644
index 0000000..434845a
--- /dev/null
+++ b/My/app/src/main/res/drawable/type_select_bg.xml
@@ -0,0 +1,18 @@
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/drawable/type_selected_no.xml b/My/app/src/main/res/drawable/type_selected_no.xml
new file mode 100644
index 0000000..eda3ba2
--- /dev/null
+++ b/My/app/src/main/res/drawable/type_selected_no.xml
@@ -0,0 +1,11 @@
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/drawable/zz1.png b/My/app/src/main/res/drawable/zz1.png
new file mode 100644
index 0000000..2acaed6
Binary files /dev/null and b/My/app/src/main/res/drawable/zz1.png differ
diff --git a/My/app/src/main/res/drawable/zz2.jpg b/My/app/src/main/res/drawable/zz2.jpg
new file mode 100644
index 0000000..2942705
Binary files /dev/null and b/My/app/src/main/res/drawable/zz2.jpg differ
diff --git a/My/app/src/main/res/drawable/zz3.jpg b/My/app/src/main/res/drawable/zz3.jpg
new file mode 100644
index 0000000..bb49de8
Binary files /dev/null and b/My/app/src/main/res/drawable/zz3.jpg differ
diff --git a/My/app/src/main/res/layout/activity_blank.xml b/My/app/src/main/res/layout/activity_blank.xml
new file mode 100644
index 0000000..4c3af11
--- /dev/null
+++ b/My/app/src/main/res/layout/activity_blank.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/layout/activity_login.xml b/My/app/src/main/res/layout/activity_login.xml
new file mode 100644
index 0000000..98e6fd3
--- /dev/null
+++ b/My/app/src/main/res/layout/activity_login.xml
@@ -0,0 +1,193 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/layout/activity_main.xml b/My/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..bb248b4
--- /dev/null
+++ b/My/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/layout/activity_register.xml b/My/app/src/main/res/layout/activity_register.xml
new file mode 100644
index 0000000..3d4c528
--- /dev/null
+++ b/My/app/src/main/res/layout/activity_register.xml
@@ -0,0 +1,195 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/layout/activity_search.xml b/My/app/src/main/res/layout/activity_search.xml
new file mode 100644
index 0000000..c33a9b3
--- /dev/null
+++ b/My/app/src/main/res/layout/activity_search.xml
@@ -0,0 +1,129 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/layout/fragment_chat.xml b/My/app/src/main/res/layout/fragment_chat.xml
new file mode 100644
index 0000000..767727d
--- /dev/null
+++ b/My/app/src/main/res/layout/fragment_chat.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/layout/fragment_home.xml b/My/app/src/main/res/layout/fragment_home.xml
new file mode 100644
index 0000000..c266f44
--- /dev/null
+++ b/My/app/src/main/res/layout/fragment_home.xml
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/layout/fragment_reg.xml b/My/app/src/main/res/layout/fragment_reg.xml
new file mode 100644
index 0000000..869e615
--- /dev/null
+++ b/My/app/src/main/res/layout/fragment_reg.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/layout/fragment_search.xml b/My/app/src/main/res/layout/fragment_search.xml
new file mode 100644
index 0000000..baf80a4
--- /dev/null
+++ b/My/app/src/main/res/layout/fragment_search.xml
@@ -0,0 +1,131 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/layout/left_list_item.xml b/My/app/src/main/res/layout/left_list_item.xml
new file mode 100644
index 0000000..aa3526f
--- /dev/null
+++ b/My/app/src/main/res/layout/left_list_item.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/layout/nearby_view.xml b/My/app/src/main/res/layout/nearby_view.xml
new file mode 100644
index 0000000..3d3c11c
--- /dev/null
+++ b/My/app/src/main/res/layout/nearby_view.xml
@@ -0,0 +1,131 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/layout/recommended_viewholder.xml b/My/app/src/main/res/layout/recommended_viewholder.xml
new file mode 100644
index 0000000..7194bc2
--- /dev/null
+++ b/My/app/src/main/res/layout/recommended_viewholder.xml
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/layout/right_list_item.xml b/My/app/src/main/res/layout/right_list_item.xml
new file mode 100644
index 0000000..a6bc097
--- /dev/null
+++ b/My/app/src/main/res/layout/right_list_item.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/layout/user_search_delete.xml b/My/app/src/main/res/layout/user_search_delete.xml
new file mode 100644
index 0000000..cb7a808
--- /dev/null
+++ b/My/app/src/main/res/layout/user_search_delete.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/menu/navigation.xml b/My/app/src/main/res/menu/navigation.xml
new file mode 100644
index 0000000..6d61aa9
--- /dev/null
+++ b/My/app/src/main/res/menu/navigation.xml
@@ -0,0 +1,24 @@
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/My/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/My/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/My/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/My/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/My/app/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/My/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/My/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/My/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/My/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/My/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/My/app/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/My/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/My/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/My/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/My/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/My/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/My/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/My/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/My/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/My/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/My/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/My/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/My/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/My/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/My/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/My/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/My/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/My/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/My/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/My/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/My/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/My/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/My/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/My/app/src/main/res/values-night/themes.xml b/My/app/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..d25b0f2
--- /dev/null
+++ b/My/app/src/main/res/values-night/themes.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/values/colors.xml b/My/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..c415e0d
--- /dev/null
+++ b/My/app/src/main/res/values/colors.xml
@@ -0,0 +1,14 @@
+
+
+ #FF000000
+ #FFFFFFFF
+ #3D5943
+ #62762f
+ #BB8A52
+ #D7C3B8
+ #FFBA00
+ #F5F5F5
+
+
+
+
diff --git a/My/app/src/main/res/values/strings.xml b/My/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..4738671
--- /dev/null
+++ b/My/app/src/main/res/values/strings.xml
@@ -0,0 +1,7 @@
+
+ 城市
+ Welcome
+ Alex Johnson
+
+ Hello blank fragment
+
\ No newline at end of file
diff --git a/My/app/src/main/res/values/themes.xml b/My/app/src/main/res/values/themes.xml
new file mode 100644
index 0000000..9c35a52
--- /dev/null
+++ b/My/app/src/main/res/values/themes.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/xml/backup_rules.xml b/My/app/src/main/res/xml/backup_rules.xml
new file mode 100644
index 0000000..fa0f996
--- /dev/null
+++ b/My/app/src/main/res/xml/backup_rules.xml
@@ -0,0 +1,13 @@
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/main/res/xml/data_extraction_rules.xml b/My/app/src/main/res/xml/data_extraction_rules.xml
new file mode 100644
index 0000000..9ee9997
--- /dev/null
+++ b/My/app/src/main/res/xml/data_extraction_rules.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My/app/src/test/java/com/example/my/ExampleUnitTest.java b/My/app/src/test/java/com/example/my/ExampleUnitTest.java
new file mode 100644
index 0000000..dc8a68f
--- /dev/null
+++ b/My/app/src/test/java/com/example/my/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.my;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/My/build.gradle.kts b/My/build.gradle.kts
new file mode 100644
index 0000000..2bbd2a9
--- /dev/null
+++ b/My/build.gradle.kts
@@ -0,0 +1,4 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+plugins {
+ alias(libs.plugins.androidApplication) apply false
+}
\ No newline at end of file
diff --git a/My/gradle.properties b/My/gradle.properties
new file mode 100644
index 0000000..4387edc
--- /dev/null
+++ b/My/gradle.properties
@@ -0,0 +1,21 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. For more details, visit
+# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app's APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Enables namespacing of each library's R class so that its R class includes only the
+# resources declared in the library itself and none from the library's dependencies,
+# thereby reducing the size of the R class for that library
+android.nonTransitiveRClass=true
\ No newline at end of file
diff --git a/My/gradle/libs.versions.toml b/My/gradle/libs.versions.toml
new file mode 100644
index 0000000..111057a
--- /dev/null
+++ b/My/gradle/libs.versions.toml
@@ -0,0 +1,22 @@
+[versions]
+agp = "8.3.0"
+junit = "4.13.2"
+junitVersion = "1.1.5"
+espressoCore = "3.5.1"
+appcompat = "1.6.1"
+material = "1.10.0"
+activity = "1.8.0"
+constraintlayout = "2.1.4"
+
+[libraries]
+junit = { group = "junit", name = "junit", version.ref = "junit" }
+ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
+espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
+appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
+material = { group = "com.google.android.material", name = "material", version.ref = "material" }
+activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
+constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
+
+[plugins]
+androidApplication = { id = "com.android.application", version.ref = "agp" }
+
diff --git a/My/gradle/wrapper/gradle-wrapper.jar b/My/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..e708b1c
Binary files /dev/null and b/My/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/My/gradle/wrapper/gradle-wrapper.properties b/My/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..6725ea3
--- /dev/null
+++ b/My/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Apr 01 21:35:27 CST 2024
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/My/gradlew b/My/gradlew
new file mode 100644
index 0000000..4f906e0
--- /dev/null
+++ b/My/gradlew
@@ -0,0 +1,185 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/My/gradlew.bat b/My/gradlew.bat
new file mode 100644
index 0000000..107acd3
--- /dev/null
+++ b/My/gradlew.bat
@@ -0,0 +1,89 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/My/settings.gradle.kts b/My/settings.gradle.kts
new file mode 100644
index 0000000..e731bfa
--- /dev/null
+++ b/My/settings.gradle.kts
@@ -0,0 +1,24 @@
+pluginManagement {
+ repositories {
+ google {
+ content {
+ includeGroupByRegex("com\\.android.*")
+ includeGroupByRegex("com\\.google.*")
+ includeGroupByRegex("androidx.*")
+ }
+ }
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
+dependencyResolutionManagement {
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+rootProject.name = "My"
+include(":app")
+
\ No newline at end of file
diff --git a/README.md b/README.md
deleted file mode 100644
index 5d5681f..0000000
--- a/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# App
-