diff --git a/flower-shop/.gitignore b/flower-shop/.gitignore
new file mode 100644
index 0000000..aa724b7
--- /dev/null
+++ b/flower-shop/.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/flower-shop/app/.gitignore b/flower-shop/app/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/flower-shop/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/flower-shop/app/build.gradle b/flower-shop/app/build.gradle
new file mode 100644
index 0000000..96911f8
--- /dev/null
+++ b/flower-shop/app/build.gradle
@@ -0,0 +1,36 @@
+plugins {
+ id 'com.android.application'
+}
+
+android {
+ namespace 'com.example.flowershop'
+ compileSdk 34
+
+ defaultConfig {
+ applicationId "com.example.flowershop"
+ minSdk 21
+ targetSdk 34
+ versionCode 1
+ versionName "1.0"
+ }
+
+ 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.3.1'
+ implementation 'com.google.android.material:material:1.4.0'
+
+ implementation 'com.github.bumptech.glide:glide:4.16.0'
+ annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0'
+ implementation "com.github.bumptech.glide:okhttp3-integration:4.16.0"
+}
\ No newline at end of file
diff --git a/flower-shop/app/proguard-rules.pro b/flower-shop/app/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/flower-shop/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/flower-shop/app/src/main/AndroidManifest.xml b/flower-shop/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..2ada20d
--- /dev/null
+++ b/flower-shop/app/src/main/AndroidManifest.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/MyApplication.java b/flower-shop/app/src/main/java/com/example/flowershop/MyApplication.java
new file mode 100644
index 0000000..83d7a17
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/MyApplication.java
@@ -0,0 +1,37 @@
+package com.example.flowershop;
+
+import android.app.Application;
+
+import com.example.flowershop.entity.Stuff;
+import com.example.flowershop.sqlite.DBStuff;
+import com.example.flowershop.utils.AppUtils;
+
+public class MyApplication extends Application {
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ if (AppUtils.isFirstTimeLaunch()) {
+ Stuff roseWhite = new Stuff("白玫瑰", "清新素雅的白色玫瑰,花瓣洁白如雪,散发着淡淡的清香", "玫瑰系列", "28");
+ DBStuff.add(roseWhite);
+
+ Stuff rosePink = new Stuff("粉玫瑰", "柔美粉色的玫瑰,娇艳欲滴,花语是甜蜜的爱情与温柔的关怀", "玫瑰系列", "22");
+ DBStuff.add(rosePink);
+
+ Stuff carnation = new Stuff("康乃馨", "康乃馨象征着母爱与关怀,花语是无尽的爱与感激,花瓣色彩丰富,芬芳宜人", "母亲节活动", "27");
+ DBStuff.add(carnation);
+
+ Stuff roseBlue = new Stuff("蓝玫瑰", "神秘而罕见的蓝色玫瑰,象征着奇迹与梦想,独特的色彩令人心驰神往", "玫瑰系列", "26");
+ DBStuff.add(roseBlue);
+
+ Stuff sunflower = new Stuff("向日葵", "向日葵是太阳的化身,代表着希望与积极的生命力,金黄色的花朵给人温暖与活力", "热卖款", "30");
+ DBStuff.add(sunflower);
+
+ Stuff tulip = new Stuff("郁金香", "郁金香是春天的使者,花语是美丽的爱情与真挚的情感,多姿多彩的花瓣散发着迷人的芳香", "热卖款", "21");
+ DBStuff.add(tulip);
+
+ AppUtils.setFirstTimeLaunch(false);
+
+ }
+ }
+}
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/activity/AboutActivity.java b/flower-shop/app/src/main/java/com/example/flowershop/activity/AboutActivity.java
new file mode 100644
index 0000000..cfa1bda
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/activity/AboutActivity.java
@@ -0,0 +1,22 @@
+package com.example.flowershop.activity;
+
+import android.os.Bundle;
+import android.view.View;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.example.flowershop.R;
+
+public class AboutActivity extends AppCompatActivity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_about);
+ findViewById(R.id.iv_back).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ finish();
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/activity/DetailActivity.java b/flower-shop/app/src/main/java/com/example/flowershop/activity/DetailActivity.java
new file mode 100644
index 0000000..81a83bb
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/activity/DetailActivity.java
@@ -0,0 +1,93 @@
+package com.example.flowershop.activity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.bumptech.glide.Glide;
+import com.example.flowershop.R;
+import com.example.flowershop.entity.Record;
+import com.example.flowershop.entity.Stuff;
+import com.example.flowershop.entity.User;
+import com.example.flowershop.sqlite.DBCart;
+import com.example.flowershop.sqlite.DBRecord;
+import com.example.flowershop.sqlite.DBStuff;
+import com.example.flowershop.utils.CurrentUserUtils;
+
+public class DetailActivity extends AppCompatActivity {
+ private TextView tvTitle, tvName, tvPrice, tvKind;
+ private ImageView ivImage, ivBack;
+ private Button btnBuy, btnAdd;
+
+ private Stuff stuff;
+
+ private User user;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_detail);
+ Intent intent = getIntent();
+ String id = intent.getStringExtra("id");
+ stuff = DBStuff.getById(Integer.parseInt(id));
+ user = CurrentUserUtils.getCurrentUser();
+ bindView();
+ initView();
+ }
+
+ private void bindView() {
+ tvTitle = findViewById(R.id.tv_title);
+ tvName = findViewById(R.id.tv_name);
+ tvPrice = findViewById(R.id.tv_price);
+ tvKind = findViewById(R.id.tv_kind);
+ ivImage = findViewById(R.id.iv_image);
+ btnBuy = findViewById(R.id.btn_buy);
+ btnAdd = findViewById(R.id.btn_add);
+ ivBack = findViewById(R.id.iv_back);
+ }
+
+ private void initView() {
+ tvTitle.setText(stuff.getTitle());
+ tvName.setText("名称:" + stuff.getName());
+ tvPrice.setText("价格:¥" + stuff.getPrice());
+
+ Glide.with(ivImage).load(stuff.getPic()).into(ivImage);
+
+ tvKind.setText("分类:" + stuff.getKind());
+ btnAdd.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (DBCart.add(stuff.getId(), user.getName())) {
+ Toast.makeText(DetailActivity.this, "加入购物车成功", Toast.LENGTH_SHORT).show();
+ } else {
+ Toast.makeText(DetailActivity.this, "加入购物车失败,或已在购物车中", Toast.LENGTH_SHORT).show();
+ }
+ }
+ });
+ ivBack.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ finish();
+ }
+ });
+ btnBuy.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Record r = new Record(user.getName(), stuff.getId(), tvName.getText().toString(), stuff.getPrice(), user.getAddress());
+ if (DBRecord.add(r)) {
+ Toast.makeText(DetailActivity.this, "价格" + stuff.getPrice() + "元,购买成功!", Toast.LENGTH_SHORT).show();
+ Log.d("-----", r.toString());
+ } else {
+ Toast.makeText(DetailActivity.this, "购买失败!", Toast.LENGTH_SHORT).show();
+ }
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/activity/InfoActivity.java b/flower-shop/app/src/main/java/com/example/flowershop/activity/InfoActivity.java
new file mode 100644
index 0000000..d6fbbd6
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/activity/InfoActivity.java
@@ -0,0 +1,43 @@
+package com.example.flowershop.activity;
+
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.example.flowershop.R;
+import com.example.flowershop.entity.User;
+import com.example.flowershop.utils.CurrentUserUtils;
+
+public class InfoActivity extends AppCompatActivity {
+ private TextView tvName, tvAddress;
+ private ImageView ivBack;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_info);
+ bindView();
+ initView();
+ }
+
+ private void bindView() {
+ tvName = findViewById(R.id.tv_name);
+ tvAddress = findViewById(R.id.tv_address);
+ ivBack = findViewById(R.id.iv_back);
+ }
+
+ private void initView() {
+ User user = CurrentUserUtils.getCurrentUser();
+ tvName.setText(user.getName());
+ tvAddress.setText(user.getAddress());
+ ivBack.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ finish();
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/activity/LoginActivity.java b/flower-shop/app/src/main/java/com/example/flowershop/activity/LoginActivity.java
new file mode 100644
index 0000000..3d1839b
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/activity/LoginActivity.java
@@ -0,0 +1,84 @@
+package com.example.flowershop.activity;
+
+import android.content.Intent;
+import android.content.SharedPreferences;
+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.appcompat.app.AppCompatActivity;
+
+import com.example.flowershop.R;
+import com.example.flowershop.entity.User;
+import com.example.flowershop.sqlite.DBUser;
+import com.example.flowershop.utils.CodeUtils;
+import com.example.flowershop.utils.CurrentUserUtils;
+
+public class LoginActivity extends AppCompatActivity {
+
+ private Button btnLogin;
+ private Button btnRegister;
+ private TextView tvCode;
+ private EditText etName, etPassword, etCode;
+
+ private String code;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_login);
+ bindView();
+ initView();
+ }
+
+
+ private void bindView() {
+ btnLogin = findViewById(R.id.btn_login);
+ etPassword = findViewById(R.id.et_password);
+ tvCode = findViewById(R.id.tv_code);
+ etName = findViewById(R.id.et_name);
+ etCode = findViewById(R.id.et_code);
+ btnRegister = findViewById(R.id.btn_register);
+ }
+
+ private void initView() {
+ User user = CurrentUserUtils.getCurrentUser();
+ if (user!=null){
+ etName.setText(user.getName());
+ }
+
+ btnLogin.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (!etCode.getText().toString().equals(code)) {
+ Toast.makeText(LoginActivity.this, "验证码错误", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ String n = etName.getText().toString();
+ String p = etPassword.getText().toString();
+ if (DBUser.check(n, p)) {
+ Toast.makeText(LoginActivity.this, "登录成功", Toast.LENGTH_SHORT).show();
+ CurrentUserUtils.setCurrentUser(DBUser.get(n));
+ Intent intent = new Intent();
+ intent.setClass(LoginActivity.this, MainActivity.class);
+ startActivity(intent);
+ } else {
+ Toast.makeText(LoginActivity.this, "登录失败,用户名或密码错误", Toast.LENGTH_SHORT).show();
+ }
+ }
+ });
+ btnRegister.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent();
+ intent.setClass(LoginActivity.this, RegisterActivity.class);
+ startActivity(intent);
+ }
+ });
+ code = CodeUtils.getCode();
+ tvCode.setText(code);
+ }
+}
\ No newline at end of file
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/activity/MainActivity.java b/flower-shop/app/src/main/java/com/example/flowershop/activity/MainActivity.java
new file mode 100644
index 0000000..27bd47c
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/activity/MainActivity.java
@@ -0,0 +1,60 @@
+package com.example.flowershop.activity;
+
+import android.os.Bundle;
+import android.view.MenuItem;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentTransaction;
+
+import com.example.flowershop.R;
+import com.example.flowershop.fragment.CartFragment;
+import com.example.flowershop.fragment.MainFragment;
+import com.example.flowershop.fragment.MeFragment;
+import com.google.android.material.bottomnavigation.BottomNavigationView;
+import com.google.android.material.navigation.NavigationBarView;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MainActivity extends AppCompatActivity {
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ List fragments = new ArrayList<>();
+ fragments.add(new MainFragment());
+ fragments.add(new CartFragment());
+ fragments.add(new MeFragment());
+
+ BottomNavigationView navigation = findViewById(R.id.navigation);
+ navigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() {
+ @Override
+ public boolean onNavigationItemSelected(@NonNull MenuItem item) {
+ int itemId = item.getItemId();
+ if (itemId == R.id.home) {
+ FragmentTransaction tran3 = getSupportFragmentManager().beginTransaction();
+ tran3.replace(R.id.main, fragments.get(0));
+ tran3.commit();
+ return true;
+ } else if (itemId == R.id.cart) {
+ FragmentTransaction tran2 = getSupportFragmentManager().beginTransaction();
+ tran2.replace(R.id.main, fragments.get(1));
+ tran2.commit();
+
+ return true;
+ } else if (itemId == R.id.me) {
+ FragmentTransaction tran1 = getSupportFragmentManager().beginTransaction();
+ tran1.replace(R.id.main, fragments.get(2));
+ tran1.commit();
+ return true;
+ }
+ return false;
+ }
+ });
+ navigation.setSelectedItemId(R.id.home);
+ }
+}
\ No newline at end of file
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/activity/RecordActivity.java b/flower-shop/app/src/main/java/com/example/flowershop/activity/RecordActivity.java
new file mode 100644
index 0000000..900c107
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/activity/RecordActivity.java
@@ -0,0 +1,56 @@
+package com.example.flowershop.activity;
+
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.TextView;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.example.flowershop.R;
+import com.example.flowershop.adapter.RecordAdapter;
+import com.example.flowershop.entity.Record;
+import com.example.flowershop.entity.User;
+import com.example.flowershop.sqlite.DBRecord;
+import com.example.flowershop.utils.CurrentUserUtils;
+
+import java.util.List;
+
+public class RecordActivity extends AppCompatActivity {
+ private ListView lvRecord;
+ private TextView tvEmpty;
+ private ImageView ivBack;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_record);
+ bindView();
+ initView();
+ }
+
+ private void bindView() {
+ lvRecord = findViewById(R.id.lv_record);
+ tvEmpty = findViewById(R.id.tv_empty);
+ ivBack = findViewById(R.id.iv_back);
+ }
+
+ private void initView() {
+ ivBack.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ finish();
+ }
+ });
+ User user = CurrentUserUtils.getCurrentUser();
+ List array = DBRecord.getAll(user.getName());
+ if (array.isEmpty()) {
+ tvEmpty.setVisibility(View.VISIBLE);
+ } else {
+ tvEmpty.setVisibility(View.GONE);
+ }
+ RecordAdapter adapter = new RecordAdapter(this, R.layout.item_record, array);
+ lvRecord.setAdapter(adapter);
+ }
+}
\ No newline at end of file
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/activity/RegisterActivity.java b/flower-shop/app/src/main/java/com/example/flowershop/activity/RegisterActivity.java
new file mode 100644
index 0000000..cdc9b5d
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/activity/RegisterActivity.java
@@ -0,0 +1,77 @@
+package com.example.flowershop.activity;
+
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.example.flowershop.R;
+import com.example.flowershop.entity.User;
+import com.example.flowershop.sqlite.DBUser;
+
+
+public class RegisterActivity extends AppCompatActivity {
+ private ImageView ivBack;
+ private EditText etName, etAddress;
+ private EditText etPassword;
+ private EditText etPasswordConfirm;
+ private Button btnRegister;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_register);
+ bindView();
+ initView();
+ }
+
+ private void bindView() {
+ etAddress = findViewById(R.id.et_address);
+ ivBack = findViewById(R.id.iv_back);
+ etName = findViewById(R.id.et_name);
+ etPassword = findViewById(R.id.et_password);
+ etPasswordConfirm = findViewById(R.id.et_password_confirm);
+ btnRegister = findViewById(R.id.btn_register);
+ }
+
+ private void initView() {
+ btnRegister.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (etPassword.getText().toString().isEmpty() || etPasswordConfirm.getText().toString().isEmpty() || etName.getText().toString().isEmpty() || etAddress.getText().toString().isEmpty()) {
+ Toast.makeText(RegisterActivity.this, "数据不能为空", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ if (!etPassword.getText().toString().equals(etPasswordConfirm.getText().toString())) {
+ Toast.makeText(RegisterActivity.this, "两次密码不一样", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ User u = new User(etName.getText().toString(), etPassword.getText().toString(), etAddress.getText().toString());
+ if (!TextUtils.isEmpty(DBUser.get(u.getName()).getName())) {
+ Toast.makeText(RegisterActivity.this, "用户名已存在", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ if (DBUser.add(u)) {
+ Toast.makeText(RegisterActivity.this, "注册成功", Toast.LENGTH_SHORT).show();
+ finish();
+ } else {
+ Toast.makeText(RegisterActivity.this, "注册失败", Toast.LENGTH_SHORT).show();
+ }
+
+
+ }
+ });
+ ivBack.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ finish();
+ }
+ });
+ }
+
+}
\ No newline at end of file
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/adapter/CartAdapter.java b/flower-shop/app/src/main/java/com/example/flowershop/adapter/CartAdapter.java
new file mode 100644
index 0000000..d6a687f
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/adapter/CartAdapter.java
@@ -0,0 +1,92 @@
+package com.example.flowershop.adapter;
+
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.core.content.ContextCompat;
+
+import com.bumptech.glide.Glide;
+import com.example.flowershop.R;
+import com.example.flowershop.entity.Record;
+import com.example.flowershop.entity.Stuff;
+import com.example.flowershop.entity.User;
+import com.example.flowershop.fragment.CartFragment;
+import com.example.flowershop.utils.CurrentUserUtils;
+
+import java.util.List;
+
+public class CartAdapter extends ArrayAdapter {
+
+ private final User user;
+
+ public CartAdapter(@NonNull Context context, int resource, @NonNull List objects) {
+ super(context, resource, objects);
+ user = CurrentUserUtils.getCurrentUser();
+ }
+
+ //每个子项被滚动到屏幕内的时候会被调用
+ @NonNull
+ @Override
+ public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
+ Stuff s = getItem(position);//得到当前项的 Stuff 实例
+
+ View view = LayoutInflater.from(getContext()).inflate(R.layout.item_cart, parent, false);
+
+ TextView title = view.findViewById(R.id.tv_title);
+ TextView price = view.findViewById(R.id.tv_price);
+ ImageView pic = view.findViewById(R.id.iv_pic);
+ CheckBox box = view.findViewById(R.id.box);
+ title.setText(s.getTitle());
+ price.setText("¥" + s.getPrice());
+
+ Glide.with(pic).load(s.getPic()).into(pic);
+
+ pic.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Toast.makeText(getContext(), s.getName(), Toast.LENGTH_SHORT).show();
+ }
+ });
+ /*
+ 点击多选框,把此商品的价格加去或减去,显示在购物车页面的总价total中
+ 添加或删除,商品到购买记录中。
+ */
+ box.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
+ double total = Double.parseDouble(CartFragment._tvTotal.getText().toString());
+ if (box.isChecked()) {
+ //Toast.makeText(getContext(), "选中了", Toast.LENGTH_SHORT).show();
+ Record r = new Record(user.getName(), s.getId(), s.getName(), s.getPrice(), user.getAddress());
+ CartFragment.record.add(r);
+ total += Double.parseDouble(r.getPrice());
+ } else {
+ int i = 0;
+ for (Record r : CartFragment.record) {
+ if (r.getId().equals(s.getId())) {
+ total -= Double.parseDouble(r.getPrice());
+ CartFragment.record.remove(i);
+ break;
+ }
+ i++;
+ }
+ }
+ CartFragment._tvTotal.setText(String.format("%.2f", total));
+ }
+ });
+ return view;
+ }
+
+}
+
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/adapter/RecordAdapter.java b/flower-shop/app/src/main/java/com/example/flowershop/adapter/RecordAdapter.java
new file mode 100644
index 0000000..355cb62
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/adapter/RecordAdapter.java
@@ -0,0 +1,55 @@
+package com.example.flowershop.adapter;
+
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.core.content.ContextCompat;
+
+import com.bumptech.glide.Glide;
+import com.example.flowershop.R;
+import com.example.flowershop.sqlite.DBStuff;
+import com.example.flowershop.entity.Record;
+import com.example.flowershop.entity.Stuff;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class RecordAdapter extends ArrayAdapter {
+ public RecordAdapter(@NonNull Context context, int resource, @NonNull List objects) {
+ super(context, resource, objects);
+ }
+ //每个子项被滚动到屏幕内的时候会被调用
+ @NonNull
+ @Override
+ public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
+ Record r=getItem(position);//得到当前项的 Fruit 实例
+
+ View view= LayoutInflater.from(getContext()).inflate(R.layout.item_record,parent,false);
+
+ String id=r.getId();
+ Stuff stuff=DBStuff.getById(Integer.valueOf(id));
+
+ TextView title =view.findViewById(R.id.tv_title);
+ TextView address =view.findViewById(R.id.et_address);
+ ImageView pic=view.findViewById(R.id.iv_pic);
+ TextView price =view.findViewById(R.id.tv_price);
+
+ price.setText("¥"+r.getPrice());
+ title.setText(stuff.getTitle());
+ address.setText("收货地址:"+r.getAddress());
+
+ Glide.with(pic).load(stuff.getPic()).into(pic);
+
+ return view;
+ }
+
+}
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/adapter/StuffAdapter.java b/flower-shop/app/src/main/java/com/example/flowershop/adapter/StuffAdapter.java
new file mode 100644
index 0000000..258dbac
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/adapter/StuffAdapter.java
@@ -0,0 +1,64 @@
+package com.example.flowershop.adapter;
+
+
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.core.content.ContextCompat;
+
+import com.bumptech.glide.Glide;
+import com.example.flowershop.R;
+import com.example.flowershop.entity.Stuff;
+
+import java.util.List;
+
+public class StuffAdapter extends ArrayAdapter {
+ public StuffAdapter(@NonNull Context context, int resource, @NonNull List objects) {
+ super(context, resource, objects);
+ }
+
+ //每个子项被滚动到屏幕内的时候会被调用
+ @NonNull
+ @Override
+ public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
+ Stuff s = getItem(position);//得到当前项的 Fruit 实例
+
+ View view = LayoutInflater.from(getContext()).inflate(R.layout.item_stuff, parent, false);
+
+ TextView kind = view.findViewById(R.id.tv_kind);
+ TextView title = view.findViewById(R.id.tv_title);
+ TextView name = view.findViewById(R.id.et_name);
+ ImageView pic = view.findViewById(R.id.iv_pic);
+ TextView price = view.findViewById(R.id.tv_price);
+
+ price.setText("¥" + s.getPrice());
+ kind.setText("分类:" + s.getKind());
+ title.setText(s.getTitle());
+ name.setText("名称:" + s.getName());
+
+ Glide.with(pic).load(s.getPic()).into(pic);
+
+ pic.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Toast.makeText(getContext(), s.getName(), Toast.LENGTH_SHORT).show();
+ }
+ });
+ return view;
+ }
+
+ public void setData(List stuffList) {
+ clear();
+ addAll(stuffList);
+ notifyDataSetChanged();
+ }
+}
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/entity/Record.java b/flower-shop/app/src/main/java/com/example/flowershop/entity/Record.java
new file mode 100644
index 0000000..b202ecf
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/entity/Record.java
@@ -0,0 +1,68 @@
+package com.example.flowershop.entity;
+
+public class Record {
+ private String username;
+ private String id;//商品id
+ private String name;//商品名称
+ private String price;
+ private String address;
+
+ @Override
+ public String toString() {
+ return "Record{" +
+ "username='" + username + '\'' +
+ ", id='" + id + '\'' +
+ ", name='" + name + '\'' +
+ ", price='" + price + '\'' +
+ ", address='" + address + '\'' +
+ '}';
+ }
+
+ public Record(String username, String id, String name, String price, String address) {
+ this.username = username;
+ this.id = id;
+ this.name = name;
+ this.price = price;
+ this.address = address;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPrice() {
+ return price;
+ }
+
+ public void setPrice(String price) {
+ this.price = price;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+}
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/entity/Stuff.java b/flower-shop/app/src/main/java/com/example/flowershop/entity/Stuff.java
new file mode 100644
index 0000000..7f04614
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/entity/Stuff.java
@@ -0,0 +1,117 @@
+package com.example.flowershop.entity;
+
+import com.example.flowershop.R;
+
+public class Stuff {
+ private String id;//id
+ private String name;//名称
+ private String title;//标题
+ private String kind;//分类
+ private String price;//价格
+ private int pic;//图片
+
+ public Stuff() {
+ this.id="-1";
+ }
+
+ public Stuff( String name, String title, String kind, String price ) {
+ this.id = "id";
+ this.name = name;
+ this.title = title;
+ this.kind = kind;
+ this.price = price;
+ this.pic = 0;
+ }
+
+
+ public Stuff(String id, String name, String title, String kind, String price) {
+ this.id = id;
+ this.name = name;
+ this.title = title;
+ this.kind = kind;
+ this.price = price;
+ switch (name){
+ case "白玫瑰":
+ this.pic= R.drawable.stuff_bmg;
+ break;
+ case "粉玫瑰":
+ this.pic=R.drawable.stuff_fmg;
+ break;
+ case "康乃馨":
+ this.pic=R.drawable.stuff_knx;
+ break;
+ case "蓝玫瑰":
+ this.pic=R.drawable.stuff_lmg;
+ break;
+ case "向日葵":
+ this.pic=R.drawable.stuff_xrk;
+ break;
+ case "郁金香":
+ this.pic=R.drawable.stuff_yjx;
+ break;
+ default:
+ this.pic=R.drawable.ic_about;
+ break;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "Stuff{" +
+ "id='" + id + '\'' +
+ ", name='" + name + '\'' +
+ ", title='" + title + '\'' +
+ ", kind='" + kind + '\'' +
+ ", price='" + price + '\'' +
+ ", pic=" + pic +
+ '}';
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getKind() {
+ return kind;
+ }
+
+ public void setKind(String kind) {
+ this.kind = kind;
+ }
+
+ public String getPrice() {
+ return price;
+ }
+
+ public void setPrice(String price) {
+ this.price = price;
+ }
+
+ public int getPic() {
+ return pic;
+ }
+
+ public void setPic(int pic) {
+ this.pic = pic;
+ }
+}
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/entity/User.java b/flower-shop/app/src/main/java/com/example/flowershop/entity/User.java
new file mode 100644
index 0000000..d1d4534
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/entity/User.java
@@ -0,0 +1,40 @@
+package com.example.flowershop.entity;
+
+public class User {
+ private String name;
+ private String psw;
+ private String address;
+
+ public User() {
+ }
+
+ public User(String name, String psw, String address) {
+ this.name = name;
+ this.psw = psw;
+ this.address = address;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPsw() {
+ return psw;
+ }
+
+ public void setPsw(String psw) {
+ this.psw = psw;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+}
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/fragment/CartFragment.java b/flower-shop/app/src/main/java/com/example/flowershop/fragment/CartFragment.java
new file mode 100644
index 0000000..248fd20
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/fragment/CartFragment.java
@@ -0,0 +1,118 @@
+package com.example.flowershop.fragment;
+
+import android.os.Bundle;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.fragment.app.Fragment;
+
+import com.example.flowershop.R;
+import com.example.flowershop.adapter.CartAdapter;
+import com.example.flowershop.entity.Record;
+import com.example.flowershop.entity.Stuff;
+import com.example.flowershop.entity.User;
+import com.example.flowershop.sqlite.DBCart;
+import com.example.flowershop.sqlite.DBRecord;
+import com.example.flowershop.sqlite.DBStuff;
+import com.example.flowershop.utils.CurrentUserUtils;
+
+import java.util.ArrayList;
+
+
+public class CartFragment extends Fragment {
+
+ public static ArrayList record = new ArrayList<>();
+ public static TextView _tvTotal;
+ private ListView lvCart;
+ private Button btnBuy;
+ private TextView etEmpty;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View v = inflater.inflate(R.layout.fragment_cart, container, false);
+ bindView(v);
+ initView();
+ return v;
+ }
+
+ private void bindView(View v) {
+ lvCart = v.findViewById(R.id.lv_cart);
+ etEmpty = v.findViewById(R.id.tv_empty);
+ _tvTotal = v.findViewById(R.id.tv_total);
+ btnBuy = v.findViewById(R.id.btn_buy);
+ }
+
+ private void initView() {
+ _tvTotal.setText("0.00");
+ //点击购买
+ btnBuy.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (CartFragment.record.size() == 0) {
+ Toast.makeText(getContext(), "你还未选择任何商品", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ double total = 0;
+ for (Record r : CartFragment.record) {
+ //添加购买记录到数据库
+ if (DBRecord.add(r)) {
+ total += Double.valueOf(r.getPrice());
+
+ Log.d("成功添加购买记录-----", r.toString());
+ //从购物车数据库中删除已经购买的商品
+ if (DBCart.del(r.getId(), r.getUsername())) {
+ Log.d("成功从购物车中删除-----", r.toString());
+ }
+ } else {
+ Log.d("失败添加购买记录-----", r.toString());
+ }
+ }
+ record = new ArrayList<>();
+ _tvTotal.setText("0.00");
+ Toast.makeText(getContext(), "价格总计" + String.format("%.2f", total) + "元,购买成功!", Toast.LENGTH_SHORT).show();
+ set();
+
+ }
+ });
+ set();
+ }
+
+ /**
+ * 从数据库中读取加入购物车的商品
+ */
+ private void set() {
+ User user = CurrentUserUtils.getCurrentUser();
+ ArrayList array = new ArrayList<>();
+ //获取购物车中商品的所有id
+ ArrayList allId = DBCart.getLikesTitle(user.getName());
+ if (allId.size() == 0) {
+ etEmpty.setVisibility(View.VISIBLE);
+ } else {
+ etEmpty.setVisibility(View.GONE);
+ }
+ //通过id依次获取商品信息
+ for (String s : allId) {
+ Stuff stuff = DBStuff.getById(Integer.parseInt(s));
+ array.add(stuff);
+ }
+ for (Stuff t : array) {
+ Log.d("--------", t.toString());
+ }
+ CartAdapter adapter = new CartAdapter(getContext(), R.layout.item_cart, array);
+ lvCart.setAdapter(adapter);
+ lvCart.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
+ String s = (array.get(i)).getName();
+ Toast.makeText(getContext(), "name:" + s, Toast.LENGTH_SHORT).show();
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/fragment/MainFragment.java b/flower-shop/app/src/main/java/com/example/flowershop/fragment/MainFragment.java
new file mode 100644
index 0000000..c0cf899
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/fragment/MainFragment.java
@@ -0,0 +1,94 @@
+package com.example.flowershop.fragment;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.Toast;
+
+import androidx.fragment.app.Fragment;
+
+import com.example.flowershop.R;
+import com.example.flowershop.activity.DetailActivity;
+import com.example.flowershop.adapter.StuffAdapter;
+import com.example.flowershop.entity.Stuff;
+import com.example.flowershop.sqlite.DBStuff;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class MainFragment extends Fragment {
+
+ private ListView lvStuff;
+ private EditText etSearch;
+ private ImageView ivSearch;
+
+ private List stuffList;
+
+ private StuffAdapter adapter;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View v = inflater.inflate(R.layout.fragment_main, container, false);
+ bindView(v);
+ initView();
+ ivSearch.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ String str = etSearch.getText().toString();
+ setSearch(str);
+ }
+ });
+ return v;
+ }
+
+ private void bindView(View v) {
+ lvStuff = v.findViewById(R.id.lv_stuff);
+ etSearch = v.findViewById(R.id.et_search);
+ ivSearch = v.findViewById(R.id.iv_search);
+ }
+
+ private void initView() {
+ stuffList = DBStuff.getAll();
+ adapter = new StuffAdapter(getContext(), R.layout.item_stuff, stuffList);
+ lvStuff.setAdapter(adapter);
+ lvStuff.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
+ Intent intent = new Intent();
+ intent.putExtra("id", (stuffList.get(i)).getId());
+ intent.setClass(getContext(), DetailActivity.class);
+ startActivity(intent);
+ }
+ });
+ }
+
+ private void setSearch(String str) {
+ List arrayTemp = DBStuff.getAll();
+ List array = new ArrayList<>();
+ for (Stuff t : arrayTemp) {
+ if (t.getName().contains(str) || t.getTitle().contains(str)) {
+ array.add(t);
+ }
+ }
+ if (array.size() == 0) {
+ Toast.makeText(getContext(), "未搜索到关键字商品", Toast.LENGTH_SHORT).show();
+ array = arrayTemp;
+ }
+ stuffList = array;
+ adapter.setData(stuffList);
+ }
+
+}
\ No newline at end of file
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/fragment/MeFragment.java b/flower-shop/app/src/main/java/com/example/flowershop/fragment/MeFragment.java
new file mode 100644
index 0000000..ad3256c
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/fragment/MeFragment.java
@@ -0,0 +1,120 @@
+package com.example.flowershop.fragment;
+
+import android.app.AlertDialog;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.fragment.app.Fragment;
+
+import com.example.flowershop.R;
+import com.example.flowershop.activity.AboutActivity;
+import com.example.flowershop.activity.InfoActivity;
+import com.example.flowershop.activity.RecordActivity;
+import com.example.flowershop.entity.User;
+import com.example.flowershop.sqlite.DBUser;
+import com.example.flowershop.utils.CurrentUserUtils;
+
+public class MeFragment extends Fragment {
+
+ private TextView tvName;
+ private LinearLayout llRecord, llChangeAddress, llInfo, llAbout, llContact;
+
+ private User user;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ user = CurrentUserUtils.getCurrentUser();
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View v = inflater.inflate(R.layout.fragment_me, container, false);
+ bindView(v);
+ initView();
+ return v;
+ }
+
+ private void bindView(View v) {
+ llRecord = v.findViewById(R.id.myrecord);
+ tvName = v.findViewById(R.id.tv_name);
+ llChangeAddress = v.findViewById(R.id.ll_change_address);
+ llInfo = v.findViewById(R.id.ll_info);
+ llAbout = v.findViewById(R.id.ll_about);
+ llContact = v.findViewById(R.id.ll_contact);
+ }
+
+ private void initView() {
+ tvName.setText("欢迎您,亲爱的" + user.getName());
+ llAbout.setOnClickListener(this::onClick);
+ llChangeAddress.setOnClickListener(this::onClick);
+ llRecord.setOnClickListener(this::onClick);
+ llContact.setOnClickListener(this::onClick);
+ llInfo.setOnClickListener(this::onClick);
+ }
+
+ void onClick(View v) {
+ int id = v.getId();
+ if (id == R.id.myrecord) {//Toast.makeText(getContext(), "record", Toast.LENGTH_SHORT).show();
+ Intent intent = new Intent(getActivity(), RecordActivity.class);
+ startActivity(intent);
+ } else if (id == R.id.ll_contact) {
+ joinPhone();
+ } else if (id == R.id.ll_info) {
+ Intent intent1 = new Intent(getActivity(), InfoActivity.class);
+ startActivity(intent1);
+ } else if (id == R.id.ll_change_address) {
+ changeAddress();
+ } else if (id == R.id.ll_about) {
+ Intent intent3 = new Intent(getActivity(), AboutActivity.class);
+ startActivity(intent3);
+ }
+ }
+
+ //修改收货地址
+ void changeAddress() {
+ View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_change_address, null);
+ AlertDialog.Builder customBuilder = new AlertDialog.Builder(getContext()).setTitle("修改收货地址").setView(view);
+ AlertDialog dialog = customBuilder.create();
+ dialog.show();
+ //自定义按钮并注册监听器
+ EditText ed_number = view.findViewById(R.id.et_address);
+
+ ed_number.setHint(user.getAddress());
+ Button btn_ok = view.findViewById(R.id.btn_confirm);
+ Button btn_cancel = view.findViewById(R.id.btn_cancel);
+ btn_ok.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ //Toast.makeText(getActivity(), ed_number.getText().toString(), Toast.LENGTH_LONG).show();
+ user.setAddress(ed_number.getText().toString());
+ if (DBUser.change(user)) {
+ CurrentUserUtils.setCurrentUser(user);
+ Toast.makeText(getContext(), "修改成功!", Toast.LENGTH_SHORT).show();
+ } else {
+ Toast.makeText(getContext(), "修改失败!", Toast.LENGTH_SHORT).show();
+ }
+ dialog.dismiss();
+ }
+ });
+ btn_cancel.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ dialog.dismiss();
+ }
+ });
+ }
+
+ void joinPhone() {
+ Toast.makeText(getContext(), "请联系:18888888888", Toast.LENGTH_SHORT).show();
+ }
+
+}
\ No newline at end of file
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/sqlite/DBCart.java b/flower-shop/app/src/main/java/com/example/flowershop/sqlite/DBCart.java
new file mode 100644
index 0000000..8742e30
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/sqlite/DBCart.java
@@ -0,0 +1,52 @@
+package com.example.flowershop.sqlite;
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.util.Log;
+
+import androidx.annotation.Nullable;
+
+import com.example.flowershop.utils.SqliteUtils;
+
+import java.util.ArrayList;
+
+public class DBCart {
+
+ public static boolean add(String id,String username){
+ ContentValues values=new ContentValues();
+ values.put("id",id);
+ values.put("username",username);
+ long i= SqliteUtils.getInstance().getWritableDatabase().insert("cart",null,values);
+ if(i>0){
+ Log.d("","插入成功");
+ return true;
+ }
+ return false;
+ }
+ public static boolean del(String id,String username){
+
+ long i=SqliteUtils.getInstance().getWritableDatabase().delete("cart","id=? and username=?",new String[]{id,username});
+ if(i>0){
+ Log.d("","删除成功");
+ return true;
+ }
+ return false;
+ }
+ public static ArrayList getLikesTitle(String username){
+ ArrayList array=new ArrayList();
+
+ Cursor cursor=SqliteUtils.getInstance().getReadableDatabase().query("cart",null,null,null,null,null,null);
+ while(cursor.moveToNext()){
+ @SuppressLint("Range") String id=cursor.getString( cursor.getColumnIndex("id"));
+ @SuppressLint("Range") String name=cursor.getString( cursor.getColumnIndex("username"));
+ if(name.equals(username)){
+ array.add(id );
+ }
+ }
+ return array;
+ }
+}
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/sqlite/DBRecord.java b/flower-shop/app/src/main/java/com/example/flowershop/sqlite/DBRecord.java
new file mode 100644
index 0000000..aef41a4
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/sqlite/DBRecord.java
@@ -0,0 +1,54 @@
+package com.example.flowershop.sqlite;
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.util.Log;
+
+import androidx.annotation.Nullable;
+
+import com.example.flowershop.entity.Record;
+import com.example.flowershop.utils.SqliteUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class DBRecord {
+
+ public static boolean add(Record s){
+ ContentValues values=new ContentValues();
+ values.put("username",s.getUsername());
+ values.put("id",s.getId());
+ values.put("name",s.getName());
+ values.put("price",s.getPrice());
+ values.put("address",s.getAddress());
+ long i= SqliteUtils.getInstance().getWritableDatabase().insert("record",null,values);
+ if(i>0){
+ Log.d("","插入成功");
+ return true;
+ }
+ Log.d("","插入失败");
+ return false;
+ }
+
+ public static List getAll(String user){
+ List array=new ArrayList<>();
+ Cursor cursor=SqliteUtils.getInstance().getReadableDatabase().query("record",null,null,null,null,null,null);
+ while(cursor.moveToNext()){
+ @SuppressLint("Range") String username=cursor.getString( cursor.getColumnIndex("username"));
+ @SuppressLint("Range") String id=cursor.getString( cursor.getColumnIndex("id"));
+ @SuppressLint("Range") String name=cursor.getString( cursor.getColumnIndex("name"));
+ @SuppressLint("Range") String address=cursor.getString( cursor.getColumnIndex("address"));
+ @SuppressLint("Range") String price=cursor.getString( cursor.getColumnIndex("price"));
+ if(user.equals(username)){
+ Record u=new Record(username,id,name ,price,address);
+ array.add(u);
+ }
+ }
+ return array;
+ }
+}
+
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/sqlite/DBStuff.java b/flower-shop/app/src/main/java/com/example/flowershop/sqlite/DBStuff.java
new file mode 100644
index 0000000..a18b463
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/sqlite/DBStuff.java
@@ -0,0 +1,75 @@
+package com.example.flowershop.sqlite;
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.database.Cursor;
+import android.util.Log;
+
+import com.example.flowershop.entity.Stuff;
+import com.example.flowershop.utils.SqliteUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class DBStuff {
+
+ public static boolean add(Stuff s) {
+ ContentValues values = new ContentValues();
+ Log.d("", "插入 ");
+ values.put("name", s.getName());
+ values.put("title", s.getTitle());
+ values.put("kind", s.getKind());
+ values.put("price", s.getPrice());
+ long i = SqliteUtils.getInstance().getWritableDatabase().insert("stuff", null, values);
+ if (i > 0) {
+ Log.d("", "插入成功");
+ return true;
+ }
+ Log.d("", "插入失败");
+ return false;
+ }
+
+ public static void deleteAll() {
+ List all = getAll();
+ for (int i = 0; i < all.size(); i++) {
+ String sqlStr = "id" + "=?";
+ String[] contentValuesArray = new String[]{all.get(i).getId()};
+ SqliteUtils.getInstance().getWritableDatabase().delete("stuff", sqlStr, contentValuesArray);
+ }
+ }
+
+ public static List getAll() {
+ List array = new ArrayList<>();
+ Cursor cursor = SqliteUtils.getInstance().getReadableDatabase().query("stuff", null, null, null, null, null, null);
+ while (cursor.moveToNext()) {
+ @SuppressLint("Range") int id = cursor.getInt(cursor.getColumnIndex("id"));
+ @SuppressLint("Range") String name = cursor.getString(cursor.getColumnIndex("name"));
+ @SuppressLint("Range") String title = cursor.getString(cursor.getColumnIndex("title"));
+ @SuppressLint("Range") String kind = cursor.getString(cursor.getColumnIndex("kind"));
+ @SuppressLint("Range") String price = cursor.getString(cursor.getColumnIndex("price"));
+
+ Stuff u = new Stuff(String.valueOf(id), name, title, kind, price);
+ array.add(u);
+
+ }
+ return array;
+ }
+
+ public static Stuff getById(int _id) {
+ Stuff s = new Stuff();
+ Cursor cursor = SqliteUtils.getInstance().getReadableDatabase().query("stuff", null, null, null, null, null, null);
+ while (cursor.moveToNext()) {
+ @SuppressLint("Range") int id = cursor.getInt(cursor.getColumnIndex("id"));
+ @SuppressLint("Range") String name = cursor.getString(cursor.getColumnIndex("name"));
+ @SuppressLint("Range") String title = cursor.getString(cursor.getColumnIndex("title"));
+ @SuppressLint("Range") String kind = cursor.getString(cursor.getColumnIndex("kind"));
+ @SuppressLint("Range") String price = cursor.getString(cursor.getColumnIndex("price"));
+ if (id == _id) {
+ s = new Stuff(String.valueOf(id), name, title, kind, price);
+ break;
+ }
+ }
+ return s;
+ }
+}
+
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/sqlite/DBUser.java b/flower-shop/app/src/main/java/com/example/flowershop/sqlite/DBUser.java
new file mode 100644
index 0000000..0219a47
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/sqlite/DBUser.java
@@ -0,0 +1,64 @@
+package com.example.flowershop.sqlite;
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.database.Cursor;
+import android.text.TextUtils;
+import android.util.Log;
+
+import com.example.flowershop.entity.User;
+import com.example.flowershop.utils.SqliteUtils;
+
+public class DBUser {
+
+ public static boolean add(User u) {
+ ContentValues values = new ContentValues();
+ values.put("name", u.getName());
+ values.put("psw", u.getPsw());
+ values.put("address", u.getAddress());
+ long i = SqliteUtils.getInstance().getWritableDatabase().insert("user", null, values);
+ if (i > 0) {
+ Log.d("", "插入成功");
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean change(User u) {
+ ContentValues values = new ContentValues();
+ values.put("address", u.getAddress());
+ long i = SqliteUtils.getInstance().getWritableDatabase().update("user", values, "name=?", new String[]{u.getName()});
+ if (i > 0) {
+ Log.d("", "修改成功");
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean check(String n, String p) {
+ Cursor cursor = SqliteUtils.getInstance().getReadableDatabase().query("user", null, null, null, null, null, null);
+ while (cursor.moveToNext()) {
+ @SuppressLint("Range") String name = cursor.getString(cursor.getColumnIndex("name"));
+ @SuppressLint("Range") String psw = cursor.getString(cursor.getColumnIndex("psw"));
+ if (n.equals(name) && p.equals(psw)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static User get(String n) {
+ User u = new User();
+ Cursor cursor = SqliteUtils.getInstance().getReadableDatabase().query("user", null, null, null, null, null, null);
+ while (cursor.moveToNext()) {
+ @SuppressLint("Range") String name = cursor.getString(cursor.getColumnIndex("name"));
+ @SuppressLint("Range") String psw = cursor.getString(cursor.getColumnIndex("psw"));
+ @SuppressLint("Range") String address = cursor.getString(cursor.getColumnIndex("address"));
+ if (n.equals(name)) {
+ u = new User(name, psw, address);
+ break;
+ }
+ }
+ return u;
+ }
+}
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/utils/AppUtils.java b/flower-shop/app/src/main/java/com/example/flowershop/utils/AppUtils.java
new file mode 100644
index 0000000..e781e06
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/utils/AppUtils.java
@@ -0,0 +1,58 @@
+package com.example.flowershop.utils;
+
+import android.app.Application;
+import android.content.Context;
+import android.content.SharedPreferences;
+
+public class AppUtils {
+
+ private static final String PREF_NAME = "app_pref";
+ private static final String IS_FIRST_TIME_LAUNCH = "IsFirstTimeLaunch";
+
+ private final SharedPreferences pref;
+ private final SharedPreferences.Editor editor;
+
+ private Application application;
+
+ public AppUtils() {
+ try {
+ Class> activityThreadClass = Class.forName("android.app.ActivityThread");
+ Object activityThread = activityThreadClass.getMethod("currentActivityThread").invoke(null);
+ application = (Application) activityThreadClass.getMethod("getApplication").invoke(activityThread);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ pref = application.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
+ editor = pref.edit();
+ }
+
+ /**
+ * 创建并获取单例
+ */
+ private static AppUtils getInstance() {
+ return InstanceHolder.instance;
+ }
+
+ public static boolean isFirstTimeLaunch() {
+ return getInstance().pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);
+ }
+
+ public static void setFirstTimeLaunch(boolean isFirstTime) {
+ getInstance().editor.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime);
+ getInstance().editor.commit();
+ }
+
+ /**
+ * 反射获取Application
+ */
+ public static Application getApplication() {
+ return getInstance().application;
+ }
+
+ private static final class InstanceHolder {
+ /**
+ * 单例
+ */
+ static final AppUtils instance = new AppUtils();
+ }
+}
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/utils/CodeUtils.java b/flower-shop/app/src/main/java/com/example/flowershop/utils/CodeUtils.java
new file mode 100644
index 0000000..8509272
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/utils/CodeUtils.java
@@ -0,0 +1,16 @@
+package com.example.flowershop.utils;
+
+import java.util.Random;
+
+public class CodeUtils {
+ public static String getCode(){
+ String str="abcdefghijklmnopqrstuvwxyz0123456789";
+ Random random=new Random();
+ StringBuffer sb=new StringBuffer();
+ for(int i=0;i<4;i++){
+ int number=random.nextInt(36);
+ sb.append(str.charAt(number));
+ }
+ return sb.toString();
+ }
+}
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/utils/CurrentUserUtils.java b/flower-shop/app/src/main/java/com/example/flowershop/utils/CurrentUserUtils.java
new file mode 100644
index 0000000..03c7ec0
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/utils/CurrentUserUtils.java
@@ -0,0 +1,49 @@
+package com.example.flowershop.utils;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+
+import com.example.flowershop.entity.User;
+
+public class CurrentUserUtils {
+
+ private static final String CURRENT_USER = "CURRENT_USER";
+
+ private final SharedPreferences sp;
+ /**
+ * 创建并获取单例
+ */
+ public static CurrentUserUtils getInstance() {
+ return CurrentUserUtils.InstanceHolder.instance;
+ }
+
+ public CurrentUserUtils() {
+ sp = AppUtils.getApplication().getSharedPreferences(CURRENT_USER, Context.MODE_PRIVATE);
+ }
+
+ public static User getCurrentUser() {
+ String username = getInstance().sp.getString("username", null);
+ String address = getInstance().sp.getString("address", null);
+ if (username == null) {
+ return null;
+ }
+ User user = new User();
+ user.setName(username);
+ user.setAddress(address);
+ return user;
+ }
+
+ public static void setCurrentUser(User user) {
+ SharedPreferences.Editor editor = getInstance().sp.edit();
+ editor.putString("username", user.getName());
+ editor.putString("address", user.getAddress());
+ editor.apply();
+ }
+
+ private static final class InstanceHolder {
+ /**
+ * 单例
+ */
+ static final CurrentUserUtils instance = new CurrentUserUtils();
+ }
+}
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/utils/MyGlideModule.java b/flower-shop/app/src/main/java/com/example/flowershop/utils/MyGlideModule.java
new file mode 100644
index 0000000..df8d3a6
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/utils/MyGlideModule.java
@@ -0,0 +1,24 @@
+package com.example.flowershop.utils;
+
+import android.content.Context;
+
+import androidx.annotation.NonNull;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.Registry;
+import com.bumptech.glide.annotation.GlideModule;
+import com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader;
+import com.bumptech.glide.load.model.GlideUrl;
+import com.bumptech.glide.module.AppGlideModule;
+
+import java.io.InputStream;
+
+@GlideModule
+public class MyGlideModule extends AppGlideModule {
+
+ @Override
+ public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
+ registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory());
+ }
+
+}
diff --git a/flower-shop/app/src/main/java/com/example/flowershop/utils/SqliteUtils.java b/flower-shop/app/src/main/java/com/example/flowershop/utils/SqliteUtils.java
new file mode 100644
index 0000000..8950c7e
--- /dev/null
+++ b/flower-shop/app/src/main/java/com/example/flowershop/utils/SqliteUtils.java
@@ -0,0 +1,46 @@
+package com.example.flowershop.utils;
+
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+
+public class SqliteUtils extends SQLiteOpenHelper {
+
+ public SqliteUtils() {
+ super(AppUtils.getApplication(), "flower_shop.db", null, 1);
+ }
+
+
+ /**
+ * 创建并获取单例
+ */
+ public static SqliteUtils getInstance() {
+ return InstanceHolder.instance;
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL("create table user(name text primary key,psw text not null,address text not null)");
+ db.execSQL("create table stuff(id INTEGER primary key AUTOINCREMENT,name text not null,title text not null,kind text not null,price text not null)");
+ db.execSQL("create table record(username text not null,id text not null,name text not null,price text not null,address text not null)");
+ db.execSQL("create table cart(id text not null,username text not null,PRIMARY KEY(id,username))");
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int i, int i1) {
+ //删除表
+ db.execSQL("DROP TABLE IF EXISTS user");
+ db.execSQL("DROP TABLE IF EXISTS stuff");
+ db.execSQL("DROP TABLE IF EXISTS record");
+ db.execSQL("DROP TABLE IF EXISTS cart");
+ //重新创建表
+ onCreate(db);
+ }
+
+ private static final class InstanceHolder {
+ /**
+ * 单例
+ */
+ static final SqliteUtils instance = new SqliteUtils();
+ }
+
+}
diff --git a/flower-shop/app/src/main/res/drawable-v1/bg_common.jpg b/flower-shop/app/src/main/res/drawable-v1/bg_common.jpg
new file mode 100644
index 0000000..68526e7
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/bg_common.jpg differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/ic_about.png b/flower-shop/app/src/main/res/drawable-v1/ic_about.png
new file mode 100644
index 0000000..7cca405
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/ic_about.png differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/ic_back.png b/flower-shop/app/src/main/res/drawable-v1/ic_back.png
new file mode 100644
index 0000000..8414b33
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/ic_back.png differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/ic_cart.png b/flower-shop/app/src/main/res/drawable-v1/ic_cart.png
new file mode 100644
index 0000000..a5fd50f
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/ic_cart.png differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/ic_change.png b/flower-shop/app/src/main/res/drawable-v1/ic_change.png
new file mode 100644
index 0000000..5816597
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/ic_change.png differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/ic_contact.png b/flower-shop/app/src/main/res/drawable-v1/ic_contact.png
new file mode 100644
index 0000000..2071db1
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/ic_contact.png differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/ic_home.png b/flower-shop/app/src/main/res/drawable-v1/ic_home.png
new file mode 100644
index 0000000..c561ad3
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/ic_home.png differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/ic_me.png b/flower-shop/app/src/main/res/drawable-v1/ic_me.png
new file mode 100644
index 0000000..45d9236
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/ic_me.png differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/ic_order.png b/flower-shop/app/src/main/res/drawable-v1/ic_order.png
new file mode 100644
index 0000000..2b345bc
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/ic_order.png differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/ic_right.png b/flower-shop/app/src/main/res/drawable-v1/ic_right.png
new file mode 100644
index 0000000..fcb095e
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/ic_right.png differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/ic_search.png b/flower-shop/app/src/main/res/drawable-v1/ic_search.png
new file mode 100644
index 0000000..e2535ad
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/ic_search.png differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/icon.png b/flower-shop/app/src/main/res/drawable-v1/icon.png
new file mode 100644
index 0000000..1ada268
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/icon.png differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/stuff_bmg.jpg b/flower-shop/app/src/main/res/drawable-v1/stuff_bmg.jpg
new file mode 100644
index 0000000..18bfc18
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/stuff_bmg.jpg differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/stuff_fmg.jpg b/flower-shop/app/src/main/res/drawable-v1/stuff_fmg.jpg
new file mode 100644
index 0000000..061e5bb
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/stuff_fmg.jpg differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/stuff_knx.jpg b/flower-shop/app/src/main/res/drawable-v1/stuff_knx.jpg
new file mode 100644
index 0000000..62dcb79
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/stuff_knx.jpg differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/stuff_lmg.jpg b/flower-shop/app/src/main/res/drawable-v1/stuff_lmg.jpg
new file mode 100644
index 0000000..a4a37d6
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/stuff_lmg.jpg differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/stuff_xrk.jpg b/flower-shop/app/src/main/res/drawable-v1/stuff_xrk.jpg
new file mode 100644
index 0000000..64336c3
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/stuff_xrk.jpg differ
diff --git a/flower-shop/app/src/main/res/drawable-v1/stuff_yjx.jpg b/flower-shop/app/src/main/res/drawable-v1/stuff_yjx.jpg
new file mode 100644
index 0000000..7ae6e70
Binary files /dev/null and b/flower-shop/app/src/main/res/drawable-v1/stuff_yjx.jpg differ
diff --git a/flower-shop/app/src/main/res/drawable/bg_border.xml b/flower-shop/app/src/main/res/drawable/bg_border.xml
new file mode 100644
index 0000000..73cc684
--- /dev/null
+++ b/flower-shop/app/src/main/res/drawable/bg_border.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/drawable/bg_btn_common.xml b/flower-shop/app/src/main/res/drawable/bg_btn_common.xml
new file mode 100644
index 0000000..b67264c
--- /dev/null
+++ b/flower-shop/app/src/main/res/drawable/bg_btn_common.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/drawable/bg_et_border.xml b/flower-shop/app/src/main/res/drawable/bg_et_border.xml
new file mode 100644
index 0000000..000d194
--- /dev/null
+++ b/flower-shop/app/src/main/res/drawable/bg_et_border.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/layout/activity_about.xml b/flower-shop/app/src/main/res/layout/activity_about.xml
new file mode 100644
index 0000000..a422aef
--- /dev/null
+++ b/flower-shop/app/src/main/res/layout/activity_about.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/layout/activity_detail.xml b/flower-shop/app/src/main/res/layout/activity_detail.xml
new file mode 100644
index 0000000..9a5f7d5
--- /dev/null
+++ b/flower-shop/app/src/main/res/layout/activity_detail.xml
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/layout/activity_info.xml b/flower-shop/app/src/main/res/layout/activity_info.xml
new file mode 100644
index 0000000..29535f8
--- /dev/null
+++ b/flower-shop/app/src/main/res/layout/activity_info.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/layout/activity_login.xml b/flower-shop/app/src/main/res/layout/activity_login.xml
new file mode 100644
index 0000000..bcba9aa
--- /dev/null
+++ b/flower-shop/app/src/main/res/layout/activity_login.xml
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/layout/activity_main.xml b/flower-shop/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..c84ba46
--- /dev/null
+++ b/flower-shop/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/layout/activity_record.xml b/flower-shop/app/src/main/res/layout/activity_record.xml
new file mode 100644
index 0000000..2b41a9a
--- /dev/null
+++ b/flower-shop/app/src/main/res/layout/activity_record.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/layout/activity_register.xml b/flower-shop/app/src/main/res/layout/activity_register.xml
new file mode 100644
index 0000000..7901202
--- /dev/null
+++ b/flower-shop/app/src/main/res/layout/activity_register.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/layout/dialog_change_address.xml b/flower-shop/app/src/main/res/layout/dialog_change_address.xml
new file mode 100644
index 0000000..ca624a4
--- /dev/null
+++ b/flower-shop/app/src/main/res/layout/dialog_change_address.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/layout/fragment_cart.xml b/flower-shop/app/src/main/res/layout/fragment_cart.xml
new file mode 100644
index 0000000..1ab6e50
--- /dev/null
+++ b/flower-shop/app/src/main/res/layout/fragment_cart.xml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/layout/fragment_main.xml b/flower-shop/app/src/main/res/layout/fragment_main.xml
new file mode 100644
index 0000000..3461abe
--- /dev/null
+++ b/flower-shop/app/src/main/res/layout/fragment_main.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/layout/fragment_me.xml b/flower-shop/app/src/main/res/layout/fragment_me.xml
new file mode 100644
index 0000000..81d60eb
--- /dev/null
+++ b/flower-shop/app/src/main/res/layout/fragment_me.xml
@@ -0,0 +1,248 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/layout/item_cart.xml b/flower-shop/app/src/main/res/layout/item_cart.xml
new file mode 100644
index 0000000..d3a11ee
--- /dev/null
+++ b/flower-shop/app/src/main/res/layout/item_cart.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/layout/item_record.xml b/flower-shop/app/src/main/res/layout/item_record.xml
new file mode 100644
index 0000000..1cf2399
--- /dev/null
+++ b/flower-shop/app/src/main/res/layout/item_record.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/layout/item_stuff.xml b/flower-shop/app/src/main/res/layout/item_stuff.xml
new file mode 100644
index 0000000..429286c
--- /dev/null
+++ b/flower-shop/app/src/main/res/layout/item_stuff.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/menu/navigation.xml b/flower-shop/app/src/main/res/menu/navigation.xml
new file mode 100644
index 0000000..d115169
--- /dev/null
+++ b/flower-shop/app/src/main/res/menu/navigation.xml
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/flower-shop/app/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/flower-shop/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/flower-shop/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/flower-shop/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/flower-shop/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/flower-shop/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/flower-shop/app/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/flower-shop/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/flower-shop/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/flower-shop/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/flower-shop/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/flower-shop/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/flower-shop/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/flower-shop/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/flower-shop/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/flower-shop/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/flower-shop/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/flower-shop/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/flower-shop/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/flower-shop/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/flower-shop/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/flower-shop/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/flower-shop/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/flower-shop/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/flower-shop/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/flower-shop/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/flower-shop/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/flower-shop/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/flower-shop/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/flower-shop/app/src/main/res/values/colors.xml b/flower-shop/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..5edba15
--- /dev/null
+++ b/flower-shop/app/src/main/res/values/colors.xml
@@ -0,0 +1,13 @@
+
+
+ #D9BAFF
+ #FBC679
+ #FFB59E
+ #FF03DAC5
+ #FF018786
+ #FF000000
+ #FFFFFFFF
+
+ #006400
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/values/strings.xml b/flower-shop/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..d47661d
--- /dev/null
+++ b/flower-shop/app/src/main/res/values/strings.xml
@@ -0,0 +1,5 @@
+
+ SmallShop
+
+ Hello blank fragment
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/values/style.xml b/flower-shop/app/src/main/res/values/style.xml
new file mode 100644
index 0000000..bf1963a
--- /dev/null
+++ b/flower-shop/app/src/main/res/values/style.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/app/src/main/res/values/themes.xml b/flower-shop/app/src/main/res/values/themes.xml
new file mode 100644
index 0000000..13c2a4f
--- /dev/null
+++ b/flower-shop/app/src/main/res/values/themes.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/flower-shop/build.gradle b/flower-shop/build.gradle
new file mode 100644
index 0000000..5fedb00
--- /dev/null
+++ b/flower-shop/build.gradle
@@ -0,0 +1,4 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+plugins {
+ id 'com.android.application' version '8.2.2' apply false
+}
diff --git a/flower-shop/flower.jks b/flower-shop/flower.jks
new file mode 100644
index 0000000..513d748
Binary files /dev/null and b/flower-shop/flower.jks differ
diff --git a/flower-shop/gradle.properties b/flower-shop/gradle.properties
new file mode 100644
index 0000000..dab7c28
--- /dev/null
+++ b/flower-shop/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. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec: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/flower-shop/gradle/wrapper/gradle-wrapper.jar b/flower-shop/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..e708b1c
Binary files /dev/null and b/flower-shop/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/flower-shop/gradle/wrapper/gradle-wrapper.properties b/flower-shop/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..d6c154b
--- /dev/null
+++ b/flower-shop/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sun Dec 22 21:40:32 CST 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/flower-shop/gradlew b/flower-shop/gradlew
new file mode 100644
index 0000000..4f906e0
--- /dev/null
+++ b/flower-shop/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/flower-shop/gradlew.bat b/flower-shop/gradlew.bat
new file mode 100644
index 0000000..107acd3
--- /dev/null
+++ b/flower-shop/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/flower-shop/settings.gradle b/flower-shop/settings.gradle
new file mode 100644
index 0000000..11278ce
--- /dev/null
+++ b/flower-shop/settings.gradle
@@ -0,0 +1,35 @@
+pluginManagement {
+ repositories {
+ maven { url 'https://maven.aliyun.com/repository/public' }
+ maven { url 'https://maven.aliyun.com/repository/google' }
+ maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
+ mavenCentral()
+ google {
+ content {
+ includeGroupByRegex("com\\.android.*")
+ includeGroupByRegex("com\\.google.*")
+ includeGroupByRegex("androidx.*")
+ }
+ }
+ maven { url "https://jitpack.io" }
+ }
+}
+dependencyResolutionManagement {
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+ repositories {
+ maven { url 'https://maven.aliyun.com/repository/public' }
+ maven { url 'https://maven.aliyun.com/repository/google' }
+ maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
+ mavenCentral()
+ google {
+ content {
+ includeGroupByRegex("com\\.android.*")
+ includeGroupByRegex("com\\.google.*")
+ includeGroupByRegex("androidx.*")
+ }
+ }
+ maven { url "https://jitpack.io" }
+ }
+}
+rootProject.name = "flower-shop"
+include ':app'