diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..e131386 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + alias(libs.plugins.androidApplication) +} + +android { + namespace = "com.example.deliciousfoodapp" + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.deliciousfoodapp" + 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 { + viewBinding = true + } +} + +dependencies { + + implementation(libs.appcompat) + implementation(libs.material) + implementation(libs.activity) + implementation(libs.constraintlayout) + implementation(libs.legacy.support.v4) + implementation(libs.recyclerview) + testImplementation(libs.junit) + androidTestImplementation(libs.ext.junit) + androidTestImplementation(libs.espresso.core) +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/example/deliciousfoodapp/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/deliciousfoodapp/ExampleInstrumentedTest.java new file mode 100644 index 0000000..bbb5b6a --- /dev/null +++ b/app/src/androidTest/java/com/example/deliciousfoodapp/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.deliciousfoodapp; + +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.deliciousfoodapp", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..0a463f7 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/example/deliciousfoodapp/DataService.java b/app/src/main/java/com/example/deliciousfoodapp/DataService.java new file mode 100644 index 0000000..baa40b2 --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/DataService.java @@ -0,0 +1,85 @@ +package com.example.deliciousfoodapp; +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 FoodInfo(0, R.drawable.three, "牛羊肉串", "选用优质牛羊肉,经过精心腌制,烤制后肉质鲜嫩多汁,口感极佳。", 30)); + list.add(new FoodInfo(0, R.drawable.three, "牛羊肉串", "选用优质牛羊肉,经过精心腌制,烤制后肉质鲜嫩多汁,口感极佳。", 30)); + list.add(new FoodInfo(0, R.drawable.three, "牛羊肉串", "选用优质牛羊肉,经过精心腌制,烤制后肉质鲜嫩多汁,口感极佳。", 30)); + list.add(new FoodInfo(0, R.drawable.three, "牛羊肉串", "选用优质牛羊肉,经过精心腌制,烤制后肉质鲜嫩多汁,口感极佳。", 30)); + list.add(new FoodInfo(0, R.drawable.three, "牛羊肉串", "选用优质牛羊肉,经过精心腌制,烤制后肉质鲜嫩多汁,口感极佳。", 30)); + list.add(new FoodInfo(0, R.drawable.three, "牛羊肉串", "选用优质牛羊肉,经过精心腌制,烤制后肉质鲜嫩多汁,口感极佳。", 30)); + list.add(new FoodInfo(0, R.drawable.three, "牛羊肉串", "选用优质牛羊肉,经过精心腌制,烤制后肉质鲜嫩多汁,口感极佳。", 30)); + list.add(new FoodInfo(0, R.drawable.three, "牛羊肉串", "选用优质牛羊肉,经过精心腌制,烤制后肉质鲜嫩多汁,口感极佳。", 30)); + list.add(new FoodInfo(0, R.drawable.three, "牛羊肉串", "选用优质牛羊肉,经过精心腌制,烤制后肉质鲜嫩多汁,口感极佳。", 30)); + list.add(new FoodInfo(0, R.drawable.three, "牛羊肉串", "选用优质牛羊肉,经过精心腌制,烤制后肉质鲜嫩多汁,口感极佳。", 30)); + + } else if (position == 1) { + list.add(new FoodInfo(2, R.drawable.five, "火锅手剥鲜春笋", "新鲜春笋口感脆嫩,搭配火锅食用更是美味,是火锅爱好者的必点菜品。", 45)); + list.add(new FoodInfo(2, R.drawable.five, "火锅手剥鲜春笋", "新鲜春笋口感脆嫩,搭配火锅食用更是美味,是火锅爱好者的必点菜品。", 45)); + list.add(new FoodInfo(2, R.drawable.five, "火锅手剥鲜春笋", "新鲜春笋口感脆嫩,搭配火锅食用更是美味,是火锅爱好者的必点菜品。", 45)); + list.add(new FoodInfo(2, R.drawable.five, "火锅手剥鲜春笋", "新鲜春笋口感脆嫩,搭配火锅食用更是美味,是火锅爱好者的必点菜品。", 45)); + list.add(new FoodInfo(2, R.drawable.five, "火锅手剥鲜春笋", "新鲜春笋口感脆嫩,搭配火锅食用更是美味,是火锅爱好者的必点菜品。", 45)); + list.add(new FoodInfo(2, R.drawable.five, "火锅手剥鲜春笋", "新鲜春笋口感脆嫩,搭配火锅食用更是美味,是火锅爱好者的必点菜品。", 45)); + list.add(new FoodInfo(2, R.drawable.five, "火锅手剥鲜春笋", "新鲜春笋口感脆嫩,搭配火锅食用更是美味,是火锅爱好者的必点菜品。", 45)); + list.add(new FoodInfo(2, R.drawable.five, "火锅手剥鲜春笋", "新鲜春笋口感脆嫩,搭配火锅食用更是美味,是火锅爱好者的必点菜品。", 45)); + list.add(new FoodInfo(2, R.drawable.five, "火锅手剥鲜春笋", "新鲜春笋口感脆嫩,搭配火锅食用更是美味,是火锅爱好者的必点菜品。", 45)); + list.add(new FoodInfo(2, R.drawable.five, "火锅手剥鲜春笋", "新鲜春笋口感脆嫩,搭配火锅食用更是美味,是火锅爱好者的必点菜品。", 45)); + + + } else if (position == 2) { + list.add(new FoodInfo(4, R.drawable.one, "无骨鸡柳", "选用优质鸡胸肉,经过腌制和炸制,口感酥脆,味道鲜美。", 20)); + list.add(new FoodInfo(4, R.drawable.one, "无骨鸡柳", "选用优质鸡胸肉,经过腌制和炸制,口感酥脆,味道鲜美。", 20)); + list.add(new FoodInfo(4, R.drawable.one, "无骨鸡柳", "选用优质鸡胸肉,经过腌制和炸制,口感酥脆,味道鲜美。", 20)); + list.add(new FoodInfo(4, R.drawable.one, "无骨鸡柳", "选用优质鸡胸肉,经过腌制和炸制,口感酥脆,味道鲜美。", 20)); + list.add(new FoodInfo(4, R.drawable.one, "无骨鸡柳", "选用优质鸡胸肉,经过腌制和炸制,口感酥脆,味道鲜美。", 20)); + list.add(new FoodInfo(4, R.drawable.one, "无骨鸡柳", "选用优质鸡胸肉,经过腌制和炸制,口感酥脆,味道鲜美。", 20)); + list.add(new FoodInfo(4, R.drawable.one, "无骨鸡柳", "选用优质鸡胸肉,经过腌制和炸制,口感酥脆,味道鲜美。", 20)); + list.add(new FoodInfo(4, R.drawable.one, "无骨鸡柳", "选用优质鸡胸肉,经过腌制和炸制,口感酥脆,味道鲜美。", 20)); + list.add(new FoodInfo(4, R.drawable.one, "无骨鸡柳", "选用优质鸡胸肉,经过腌制和炸制,口感酥脆,味道鲜美。", 20)); + list.add(new FoodInfo(4, R.drawable.one, "无骨鸡柳", "选用优质鸡胸肉,经过腌制和炸制,口感酥脆,味道鲜美。", 20)); + + } else if (position == 3) { + list.add(new FoodInfo(6, R.drawable.four, "海蛎子", "口感独特且营养价值丰富,无论是生食还是加热烹制都能带来愉悦体验。", 50)); + list.add(new FoodInfo(6, R.drawable.four, "海蛎子", "口感独特且营养价值丰富,无论是生食还是加热烹制都能带来愉悦体验。", 50)); + list.add(new FoodInfo(6, R.drawable.four, "海蛎子", "口感独特且营养价值丰富,无论是生食还是加热烹制都能带来愉悦体验。", 50)); + list.add(new FoodInfo(6, R.drawable.four, "海蛎子", "口感独特且营养价值丰富,无论是生食还是加热烹制都能带来愉悦体验。", 50)); + list.add(new FoodInfo(6, R.drawable.four, "海蛎子", "口感独特且营养价值丰富,无论是生食还是加热烹制都能带来愉悦体验。", 50)); + list.add(new FoodInfo(6, R.drawable.four, "海蛎子", "口感独特且营养价值丰富,无论是生食还是加热烹制都能带来愉悦体验。", 50)); + list.add(new FoodInfo(6, R.drawable.four, "海蛎子", "口感独特且营养价值丰富,无论是生食还是加热烹制都能带来愉悦体验。", 50)); + list.add(new FoodInfo(6, R.drawable.four, "海蛎子", "口感独特且营养价值丰富,无论是生食还是加热烹制都能带来愉悦体验。", 50)); + list.add(new FoodInfo(6, R.drawable.four, "海蛎子", "口感独特且营养价值丰富,无论是生食还是加热烹制都能带来愉悦体验。", 50)); + + } else if (position == 4) { + list.add(new FoodInfo(8, R.drawable.seven, "功德林素食", "作为中国素食的佼佼者,功德林提供多种美味的素食产品,如素鸡、素鸭等。", 100)); + list.add(new FoodInfo(8, R.drawable.seven, "功德林素食", "作为中国素食的佼佼者,功德林提供多种美味的素食产品,如素鸡、素鸭等。", 100)); + list.add(new FoodInfo(8, R.drawable.seven, "功德林素食", "作为中国素食的佼佼者,功德林提供多种美味的素食产品,如素鸡、素鸭等。", 100)); + list.add(new FoodInfo(8, R.drawable.seven, "功德林素食", "作为中国素食的佼佼者,功德林提供多种美味的素食产品,如素鸡、素鸭等。", 100)); + list.add(new FoodInfo(8, R.drawable.seven, "功德林素食", "作为中国素食的佼佼者,功德林提供多种美味的素食产品,如素鸡、素鸭等。", 100)); + list.add(new FoodInfo(8, R.drawable.seven, "功德林素食", "作为中国素食的佼佼者,功德林提供多种美味的素食产品,如素鸡、素鸭等。", 100)); + list.add(new FoodInfo(8, R.drawable.seven, "功德林素食", "作为中国素食的佼佼者,功德林提供多种美味的素食产品,如素鸡、素鸭等。", 100)); + list.add(new FoodInfo(8, R.drawable.seven, "功德林素食", "作为中国素食的佼佼者,功德林提供多种美味的素食产品,如素鸡、素鸭等。", 100)); + list.add(new FoodInfo(8, R.drawable.seven, "功德林素食", "作为中国素食的佼佼者,功德林提供多种美味的素食产品,如素鸡、素鸭等。", 100)); + list.add(new FoodInfo(8, R.drawable.seven, "功德林素食", "作为中国素食的佼佼者,功德林提供多种美味的素食产品,如素鸡、素鸭等。", 100)); + + } else { + list.add(new FoodInfo(10, R.drawable.two, "芮源淀粉肠", "一款适合烧烤或煎炸的淀粉肠,口感Q弹,香味浓郁。", 10)); + list.add(new FoodInfo(10, R.drawable.two, "芮源淀粉肠", "一款适合烧烤或煎炸的淀粉肠,口感Q弹,香味浓郁。", 10)); + list.add(new FoodInfo(10, R.drawable.two, "芮源淀粉肠", "一款适合烧烤或煎炸的淀粉肠,口感Q弹,香味浓郁。", 10)); + list.add(new FoodInfo(10, R.drawable.two, "芮源淀粉肠", "一款适合烧烤或煎炸的淀粉肠,口感Q弹,香味浓郁。", 10)); + list.add(new FoodInfo(10, R.drawable.two, "芮源淀粉肠", "一款适合烧烤或煎炸的淀粉肠,口感Q弹,香味浓郁。", 10)); + list.add(new FoodInfo(10, R.drawable.two, "芮源淀粉肠", "一款适合烧烤或煎炸的淀粉肠,口感Q弹,香味浓郁。", 10)); + list.add(new FoodInfo(10, R.drawable.two, "芮源淀粉肠", "一款适合烧烤或煎炸的淀粉肠,口感Q弹,香味浓郁。", 10)); + list.add(new FoodInfo(10, R.drawable.two, "芮源淀粉肠", "一款适合烧烤或煎炸的淀粉肠,口感Q弹,香味浓郁。", 10)); + list.add(new FoodInfo(10, R.drawable.two, "芮源淀粉肠", "一款适合烧烤或煎炸的淀粉肠,口感Q弹,香味浓郁。", 10)); + list.add(new FoodInfo(10, R.drawable.two, "芮源淀粉肠", "一款适合烧烤或煎炸的淀粉肠,口感Q弹,香味浓郁。", 10)); + + } + return list; + } + +} diff --git a/app/src/main/java/com/example/deliciousfoodapp/FoodInfo.java b/app/src/main/java/com/example/deliciousfoodapp/FoodInfo.java new file mode 100644 index 0000000..66da393 --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/FoodInfo.java @@ -0,0 +1,57 @@ +package com.example.deliciousfoodapp; + +public class FoodInfo { + private int _id; + private int img; + private String title; + private String details; + private int price; + + public FoodInfo(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 get_id() { + return _id; + } + + public void set_id(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/app/src/main/java/com/example/deliciousfoodapp/IndexActivity.java b/app/src/main/java/com/example/deliciousfoodapp/IndexActivity.java new file mode 100644 index 0000000..1c070b5 --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/IndexActivity.java @@ -0,0 +1,73 @@ +package com.example.deliciousfoodapp; + +import android.graphics.Color; +import android.os.Bundle; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.activity.EdgeToEdge; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; + +public class IndexActivity extends AppCompatActivity implements View.OnClickListener{ + public LinearLayout homeline,foodline,shoppingline,personline; + private TextView lastSelectedText; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + EdgeToEdge.enable(this); + setContentView(R.layout.activity_index); + homeline=findViewById(R.id.home); + homeline.setOnClickListener(this); + foodline=findViewById(R.id.food); + foodline.setOnClickListener(this); + shoppingline=findViewById(R.id.shopping); + shoppingline.setOnClickListener(this); + personline=findViewById(R.id.person); + personline.setOnClickListener(this); + replaceFragment(new homeFragment()); + setDefaultTextColor(findViewById(R.id.shouye)); // 设置默认选中项的文字颜色 + lastSelectedText = findViewById(R.id.shouye); + } + private void setDefaultTextColor(TextView text) + { + text.setTextColor(Color.parseColor("#E64A19")); + } + private void resetTextColor(TextView text) { + text.setTextColor(Color.parseColor("#707070")); // 设置默认项的文字颜色为默认颜色 + } + @Override + public void onClick(View v) { + resetTextColor(lastSelectedText); // 恢复上一个选中项的文字颜色为默认颜色 + switch (v.getId()){ + case R.id.home: + replaceFragment(new homeFragment()); + lastSelectedText = findViewById(R.id.shouye); + setDefaultTextColor(lastSelectedText); + break; + case R.id.food: + replaceFragment(new foodFragment()); + lastSelectedText = findViewById(R.id.fenlei); + setDefaultTextColor(lastSelectedText); + break; + case R.id.shopping: + replaceFragment(new shopFragment()); + lastSelectedText = findViewById(R.id.dingdan); + setDefaultTextColor(lastSelectedText); + break; + case R.id.person: + replaceFragment(new personFragment()); + lastSelectedText = findViewById(R.id.wode); + setDefaultTextColor(lastSelectedText); + } + } + private void replaceFragment(Fragment fragment) { + FragmentManager fragmentManager=getSupportFragmentManager(); + FragmentTransaction transaction=fragmentManager.beginTransaction(); + transaction.replace(R.id.framlayout,fragment); + transaction.commit(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/deliciousfoodapp/LoginActivity.java b/app/src/main/java/com/example/deliciousfoodapp/LoginActivity.java new file mode 100644 index 0000000..bed9d8a --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/LoginActivity.java @@ -0,0 +1,43 @@ +package com.example.deliciousfoodapp; + +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; + +import androidx.activity.EdgeToEdge; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; + +public class LoginActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + EdgeToEdge.enable(this); + setContentView(R.layout.activity_login); + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + return insets; + }); + Button button1 = (Button) findViewById(R.id.button1); + Button button2 = (Button) findViewById(R.id.button2); + button1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent=new Intent(LoginActivity.this, IndexActivity.class); + startActivity(intent); + } + }); + button2.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent=new Intent(LoginActivity.this, RegisterActivity.class); + startActivity(intent); + } + }); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/deliciousfoodapp/MainActivity.java b/app/src/main/java/com/example/deliciousfoodapp/MainActivity.java new file mode 100644 index 0000000..22e6daf --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/MainActivity.java @@ -0,0 +1,36 @@ +package com.example.deliciousfoodapp; + +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; + +import androidx.activity.EdgeToEdge; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; + +public class MainActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + EdgeToEdge.enable(this); + setContentView(R.layout.activity_main); + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + return insets; + }); + + Button button = (Button) findViewById(R.id.button); + button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent=new Intent(MainActivity.this, LoginActivity.class); + startActivity(intent); + } + }); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/deliciousfoodapp/MyAdapter.java b/app/src/main/java/com/example/deliciousfoodapp/MyAdapter.java new file mode 100644 index 0000000..19d46d2 --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/MyAdapter.java @@ -0,0 +1,64 @@ +package com.example.deliciousfoodapp; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.ImageView; + +import java.util.List; +import java.util.Map; + +public class MyAdapter extends BaseAdapter { + private List> datas; + private Context mContext; + + public MyAdapter(List> datas, Context mContext) { + this.datas = datas; + this.mContext = mContext; + } + + @Override + public int getCount() { + // 返回数据的总数 + return datas.size(); + } + + @Override + public Object getItem(int position) { + // 返回在list中指定位置的数据的内容 + return datas.get(position); + } + + @Override + public long getItemId(int position) { + // 返回数据在list中所在的位置 + return position; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + final ViewHolder holder; + if (convertView == null) { + // 使用自定义的布局文件作为Layout + convertView = LayoutInflater.from(mContext).inflate( + R.layout.list_item_layout, null); + // 减少findView的次数 + holder = new ViewHolder(); + // 初始化布局中的元素 + holder.mImageView = (ImageView) + convertView.findViewById(R.id.imageview); + convertView.setTag(holder); + } else { + holder = (ViewHolder) convertView.getTag(); + } + // 从传入的数据中提取数据并绑定到指定的view中 + holder.mImageView.setImageResource((Integer) datas.get(position).get("img")); + return convertView; + } + static class ViewHolder { + ImageView mImageView; + } + +} diff --git a/app/src/main/java/com/example/deliciousfoodapp/NewAdapter.java b/app/src/main/java/com/example/deliciousfoodapp/NewAdapter.java new file mode 100644 index 0000000..d33684e --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/NewAdapter.java @@ -0,0 +1,53 @@ +package com.example.deliciousfoodapp; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.ImageView; + +import java.util.List; +import java.util.Map; + +public class NewAdapter extends BaseAdapter { + List> datas; + Context mContext; + NewAdapter(List> datas,Context mContext){ + this.datas=datas; + this.mContext=mContext; + } + @Override + public int getCount() { + return datas.size(); + } + @Override + public Object getItem(int position) { + return datas.get(position); + } + @Override + public long getItemId(int position) { + return position; + } + @Override + public View getView(int position, View convertView, ViewGroup parent) { + ViewHolder holder; + if(convertView==null){ + convertView= LayoutInflater.from(mContext).inflate(R.layout.list_item_layout,null); + holder=new ViewHolder(); + holder.mImageView=convertView.findViewById(R.id.imageview); + convertView.setTag(holder); + }else{ + holder= (ViewHolder) convertView.getTag(); + } + + holder.mImageView.setImageResource((Integer) datas.get(position).get("img")); + + return convertView; + } + + static class ViewHolder { + ImageView mImageView; + } +} + diff --git a/app/src/main/java/com/example/deliciousfoodapp/RegisterActivity.java b/app/src/main/java/com/example/deliciousfoodapp/RegisterActivity.java new file mode 100644 index 0000000..6ee2d42 --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/RegisterActivity.java @@ -0,0 +1,98 @@ +package com.example.deliciousfoodapp; + +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.CheckBox; +import android.widget.EditText; +import android.widget.RadioButton; +import android.widget.RadioGroup; + +import androidx.appcompat.app.AppCompatActivity; +public class RegisterActivity extends AppCompatActivity implements RadioGroup.OnCheckedChangeListener, View.OnClickListener { + //定义字符串用来保存各个信息 + private String username_str = ""; + private String password_str = ""; + private String surepassword_str = ""; + private String phone_str = ""; + private String email_str = ""; + private String address_str = ""; + //默认为男性选中 + private String genderRadioGroup_str = "男"; + private String taste_str = "1"; + + //组件定义 + EditText username_edit, password_edit, surepassword_edit, phone_edit, email_edit, address_edit; + RadioGroup genderRadioGroup_group; + RadioButton nan_but, nv_but; + CheckBox sour, sweet, spicy; + Button register; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_register); + //组件初始化 + username_edit = (EditText) findViewById(R.id.usernamebox); + password_edit = (EditText) findViewById(R.id.passwordbox); + surepassword_edit = (EditText) findViewById(R.id.surepasswordbox); + phone_edit = (EditText) findViewById(R.id.phonebox); + email_edit = (EditText) findViewById(R.id.emailbox); + address_edit = (EditText) findViewById(R.id.addressbox); + genderRadioGroup_group = (RadioGroup) findViewById(R.id.genderRadioGroup); + //添加监听事件 + genderRadioGroup_group.setOnCheckedChangeListener(this); + nan_but = (RadioButton) findViewById(R.id.maleRadioButton); + sour = (CheckBox) findViewById(R.id.checkbox_sour); + sweet = (CheckBox) findViewById(R.id.checkbox_sweet); + spicy = (CheckBox) findViewById(R.id.checkbox_spicy); + register = (Button) findViewById(R.id.referbutton); + register.setOnClickListener(this); + } + + @Override + public void onClick(View view) { + if (view.getId() == R.id.referbutton) { + // 获取用户名、手机号、密码等信息 + username_str = username_edit.getText().toString(); + password_str = password_edit.getText().toString(); + surepassword_str = surepassword_edit.getText().toString(); + phone_str = phone_edit.getText().toString(); + email_str = email_edit.getText().toString(); + address_str = address_edit.getText().toString(); + + // 获取喜欢的口味即复选框的值 + taste_str = ""; // 清除上一次已经选中的选项 + if (sour.isChecked()) { + taste_str += sour.getText().toString(); + } + if (sweet.isChecked()) { + taste_str += sweet.getText().toString(); + } + if (spicy.isChecked()) { + taste_str += spicy.getText().toString(); + } + + Intent intent = new Intent(this, RegisterinformationActivity.class); + Bundle bundle = new Bundle(); + bundle.putString("usernamebox", username_str); + bundle.putString("passwordbox", password_str); + bundle.putString("surepasswordbox", surepassword_str); + bundle.putString("phonebox", phone_str); + bundle.putString("emailbox", email_str); + bundle.putString("addressbox", address_str); + bundle.putString("genderRadioGroup", genderRadioGroup_str); + bundle.putString("tastebox", taste_str); + intent.putExtras(bundle); + startActivity(intent); + } + } + + @Override + public void onCheckedChanged(RadioGroup group, int checkedId) { + //根据用户选择来改变sex_str的值 + genderRadioGroup_str = checkedId == R.id.maleRadioButton ? "男性" : "女性"; + } + +} diff --git a/app/src/main/java/com/example/deliciousfoodapp/RegisterinformationActivity.java b/app/src/main/java/com/example/deliciousfoodapp/RegisterinformationActivity.java new file mode 100644 index 0000000..1739c21 --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/RegisterinformationActivity.java @@ -0,0 +1,227 @@ +package com.example.deliciousfoodapp; + +import android.content.DialogInterface; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; + +import androidx.activity.EdgeToEdge; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; + +public class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +RegisterinformationActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + EdgeToEdge.enable(this); + setContentView(R.layout.activity_registerinformation); + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + Intent intent=this.getIntent(); + Bundle bundle=intent.getExtras(); + String username=bundle.getString("usernamebox"); + String password=bundle.getString("passwordbox"); + String surepassword=bundle.getString("surepasswordbox"); + String phone=bundle.getString("phonebox"); + String email=bundle.getString("emailbox"); + String address=bundle.getString("addressbox"); + String gender=bundle.getString("genderRadioGroup"); + String taste=bundle.getString("tastebox"); + TextView show_text=(TextView)findViewById(R.id.show_content); + show_text.setText("用户名为:"+username+"\n"+"登录密码为:"+password+"\n"+"确认密码为:"+surepassword+"\n"+"手机号码为:"+phone+"\n"+"电子邮箱为:"+email+"\n"+"所在地为:"+address+"\n"+"性别是:"+gender+"\n"+"喜欢的口味是:"+taste+"\n"); + return insets; + }); + Button gobackbutton = (Button) findViewById(R.id.gobackbutton); + gobackbutton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + new AlertDialog.Builder(RegisterinformationActivity.this).setTitle("系统提示") + .setMessage("请确认所有信息都正确后再点击“确定") + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + Intent intent=new Intent(RegisterinformationActivity.this, LoginActivity.class); + startActivity(intent); + } + }).setNegativeButton("返回", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + } + }).show(); + } + }); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/deliciousfoodapp/adapter/LeftListAdapter.java b/app/src/main/java/com/example/deliciousfoodapp/adapter/LeftListAdapter.java new file mode 100644 index 0000000..414a7e7 --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/adapter/LeftListAdapter.java @@ -0,0 +1,79 @@ +package com.example.deliciousfoodapp.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.deliciousfoodapp.R; + +import java.util.ArrayList; +import java.util.List; + +public class LeftListAdapter extends RecyclerView.Adapter { + + private List dataList=new ArrayList<>(); + + private int currentIndex=0; + TextView name; + 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); + } + @SuppressLint("RecyclerView") + @Override + public void onBindViewHolder(@NonNull MyHolder holder, int position) { + //绑定数据 + String name=dataList.get(position); + holder.tv_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_selector_bg); + }else{ + holder.itemView.setBackgroundResource(R.drawable.type_selector_normal_bg); + + } + } + @Override + public int getItemCount() { + return dataList.size(); + } + static class MyHolder extends RecyclerView.ViewHolder{ + TextView tv_name; + + public MyHolder(@NonNull View itemView) { + super(itemView); + tv_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/app/src/main/java/com/example/deliciousfoodapp/adapter/RightListAdaper.java b/app/src/main/java/com/example/deliciousfoodapp/adapter/RightListAdaper.java new file mode 100644 index 0000000..436f49c --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/adapter/RightListAdaper.java @@ -0,0 +1,67 @@ +package com.example.deliciousfoodapp.adapter; + +import android.annotation.SuppressLint; +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.deliciousfoodapp.FoodInfo; +import com.example.deliciousfoodapp.R; + +import java.util.ArrayList; +import java.util.List; + +public class RightListAdaper extends RecyclerView.Adapter { + private List mFoodInfos=new ArrayList<>(); + public void setListData(List list){ + this.mFoodInfos=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); + } + + @SuppressLint("SetTextI18n") + @Override + public void onBindViewHolder(@NonNull MyHolder holder, int position) { + + //绑定数据 + FoodInfo foodInfo=mFoodInfos.get(position); + holder.img.setImageResource(foodInfo.getImg()); + holder.title.setText(foodInfo.getTitle()); + holder.details.setText(foodInfo.getDetails()); + //只能设置String类型 + holder.price.setText(foodInfo.getPrice()+""); + } + + @Override + public int getItemCount() { + return mFoodInfos.size(); + } + + static class MyHolder extends RecyclerView.ViewHolder{ + ImageView img; + TextView title; + TextView details; + TextView price; + + public MyHolder(@NonNull View itemView) { + super(itemView); + img=itemView.findViewById(R.id.img); + title=itemView.findViewById(R.id.title); + details=itemView.findViewById(R.id.details); + price=itemView.findViewById(R.id.price); + } + } +} diff --git a/app/src/main/java/com/example/deliciousfoodapp/foodFragment.java b/app/src/main/java/com/example/deliciousfoodapp/foodFragment.java new file mode 100644 index 0000000..0ef141d --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/foodFragment.java @@ -0,0 +1,67 @@ +package com.example.deliciousfoodapp; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; + +import com.example.deliciousfoodapp.adapter.LeftListAdapter; +import com.example.deliciousfoodapp.adapter.RightListAdaper; + +import java.util.ArrayList; +import java.util.List; + + +public class foodFragment extends Fragment { + private View rootView; + private RecyclerView leftRecyclerView; + private RecyclerView rightRecyclerView; + + private LeftListAdapter mLeftListAdapter; + private RightListAdaper mRightListAdapter; + private List leftDataList=new ArrayList<>(); + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + rootView=inflater.inflate(R.layout.fragment_food, container, false); + + //初始化控件 + leftRecyclerView=rootView.findViewById(R.id.leftRecyclerView); + rightRecyclerView=rootView.findViewById(R.id.rightRecyclerView); + return rootView; + } + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + leftDataList.add("烧烤"); + leftDataList.add("火锅"); + leftDataList.add("煎炸食品"); + leftDataList.add("海鲜"); + leftDataList.add("素食"); + leftDataList.add("面食"); + mLeftListAdapter=new LeftListAdapter(leftDataList); + leftRecyclerView.setAdapter(mLeftListAdapter); + + mRightListAdapter=new RightListAdaper(); + rightRecyclerView.setAdapter(mRightListAdapter); + //默认加载第一个 + mRightListAdapter.setListData(DataService.getListData(0)); + + //recyclerView点击事件 + 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/app/src/main/java/com/example/deliciousfoodapp/homeFragment.java b/app/src/main/java/com/example/deliciousfoodapp/homeFragment.java new file mode 100644 index 0000000..39f3adb --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/homeFragment.java @@ -0,0 +1,64 @@ +package com.example.deliciousfoodapp; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ListView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class homeFragment extends Fragment { + private ListView mListView; + private NewAdapter myAdapter; + private List> list = new ArrayList<>(); + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + View view = inflater.inflate(R.layout.fragment_home, container, false); + + initData(); + + mListView = view.findViewById(R.id.listview); + myAdapter = new NewAdapter(list, requireContext()); + mListView.setAdapter(myAdapter); + + return view; + } + + // 自定义数据,也可以添加网络数据 + private void initData() { + Map map = new HashMap<>(); + map.put("img", R.drawable.one); + list.add(map); + + map = new HashMap<>(); + map.put("img", R.drawable.two); + list.add(map); + + map = new HashMap<>(); + map.put("img", R.drawable.three); + list.add(map); + + map = new HashMap<>(); + map.put("img", R.drawable.four); + list.add(map); + + map = new HashMap<>(); + map.put("img", R.drawable.five); + list.add(map); + + map = new HashMap<>(); + map.put("img", R.drawable.six); + list.add(map); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/deliciousfoodapp/personFragment.java b/app/src/main/java/com/example/deliciousfoodapp/personFragment.java new file mode 100644 index 0000000..bf28900 --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/personFragment.java @@ -0,0 +1,28 @@ +package com.example.deliciousfoodapp; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.fragment.app.Fragment; + +import com.example.deliciousfoodapp.R; + + +public class personFragment extends Fragment { + + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + + return inflater.inflate(R.layout.fragment_person, container, false); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/deliciousfoodapp/placeholder/PlaceholderContent.java b/app/src/main/java/com/example/deliciousfoodapp/placeholder/PlaceholderContent.java new file mode 100644 index 0000000..b67302f --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/placeholder/PlaceholderContent.java @@ -0,0 +1,72 @@ +package com.example.deliciousfoodapp.placeholder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Helper class for providing sample content for user interfaces created by + * Android template wizards. + *

+ * TODO: Replace all uses of this class before publishing your app. + */ +public class PlaceholderContent { + + /** + * An array of sample (placeholder) items. + */ + public static final List ITEMS = new ArrayList(); + + /** + * A map of sample (placeholder) items, by ID. + */ + public static final Map ITEM_MAP = new HashMap(); + + private static final int COUNT = 25; + + static { + // Add some sample items. + for (int i = 1; i <= COUNT; i++) { + addItem(createPlaceholderItem(i)); + } + } + + private static void addItem(PlaceholderItem item) { + ITEMS.add(item); + ITEM_MAP.put(item.id, item); + } + + private static PlaceholderItem createPlaceholderItem(int position) { + return new PlaceholderItem(String.valueOf(position), "Item " + position, makeDetails(position)); + } + + private static String makeDetails(int position) { + StringBuilder builder = new StringBuilder(); + builder.append("Details about Item: ").append(position); + for (int i = 0; i < position; i++) { + builder.append("\nMore details information here."); + } + return builder.toString(); + } + + /** + * A placeholder item representing a piece of content. + */ + public static class PlaceholderItem { + public final String id; + public final String content; + public final String details; + + public PlaceholderItem(String id, String content, String details) { + this.id = id; + this.content = content; + this.details = details; + } + + @Override + public String toString() { + return content; + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/deliciousfoodapp/shopFragment.java b/app/src/main/java/com/example/deliciousfoodapp/shopFragment.java new file mode 100644 index 0000000..65c0cae --- /dev/null +++ b/app/src/main/java/com/example/deliciousfoodapp/shopFragment.java @@ -0,0 +1,26 @@ +package com.example.deliciousfoodapp; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.fragment.app.Fragment; + + +public class shopFragment extends Fragment { + + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + + return inflater.inflate(R.layout.fragment_shop, container, false); + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/baseline_currency_yen_24.xml b/app/src/main/res/drawable/baseline_currency_yen_24.xml new file mode 100644 index 0000000..0d567c3 --- /dev/null +++ b/app/src/main/res/drawable/baseline_currency_yen_24.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/drawable/bg.jpg b/app/src/main/res/drawable/bg.jpg new file mode 100644 index 0000000..41df2a3 Binary files /dev/null and b/app/src/main/res/drawable/bg.jpg differ diff --git a/app/src/main/res/drawable/bg2.jpg b/app/src/main/res/drawable/bg2.jpg new file mode 100644 index 0000000..1c744ff Binary files /dev/null and b/app/src/main/res/drawable/bg2.jpg differ diff --git a/app/src/main/res/drawable/edittext_border.xml b/app/src/main/res/drawable/edittext_border.xml new file mode 100644 index 0000000..1631c3d --- /dev/null +++ b/app/src/main/res/drawable/edittext_border.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/five.jpg b/app/src/main/res/drawable/five.jpg new file mode 100644 index 0000000..978c756 Binary files /dev/null and b/app/src/main/res/drawable/five.jpg differ diff --git a/app/src/main/res/drawable/food.png b/app/src/main/res/drawable/food.png new file mode 100644 index 0000000..07026cd Binary files /dev/null and b/app/src/main/res/drawable/food.png differ diff --git a/app/src/main/res/drawable/four.jpg b/app/src/main/res/drawable/four.jpg new file mode 100644 index 0000000..92dbda9 Binary files /dev/null and b/app/src/main/res/drawable/four.jpg differ diff --git a/app/src/main/res/drawable/gd1.png b/app/src/main/res/drawable/gd1.png new file mode 100644 index 0000000..8086548 Binary files /dev/null and b/app/src/main/res/drawable/gd1.png differ diff --git a/app/src/main/res/drawable/gd2.png b/app/src/main/res/drawable/gd2.png new file mode 100644 index 0000000..3db29d7 Binary files /dev/null and b/app/src/main/res/drawable/gd2.png differ diff --git a/app/src/main/res/drawable/home.png b/app/src/main/res/drawable/home.png new file mode 100644 index 0000000..afd6af2 Binary files /dev/null and b/app/src/main/res/drawable/home.png differ diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/icecream.jpg b/app/src/main/res/drawable/icecream.jpg new file mode 100644 index 0000000..480213f Binary files /dev/null and b/app/src/main/res/drawable/icecream.jpg differ diff --git a/app/src/main/res/drawable/information.jpg b/app/src/main/res/drawable/information.jpg new file mode 100644 index 0000000..a4c2d58 Binary files /dev/null and b/app/src/main/res/drawable/information.jpg differ diff --git a/app/src/main/res/drawable/jiancan.png b/app/src/main/res/drawable/jiancan.png new file mode 100644 index 0000000..509bd68 Binary files /dev/null and b/app/src/main/res/drawable/jiancan.png differ diff --git a/app/src/main/res/drawable/mango.jpg b/app/src/main/res/drawable/mango.jpg new file mode 100644 index 0000000..23fe438 Binary files /dev/null and b/app/src/main/res/drawable/mango.jpg differ diff --git a/app/src/main/res/drawable/mb.png b/app/src/main/res/drawable/mb.png new file mode 100644 index 0000000..aa8a425 Binary files /dev/null and b/app/src/main/res/drawable/mb.png differ diff --git a/app/src/main/res/drawable/meishi.jpg b/app/src/main/res/drawable/meishi.jpg new file mode 100644 index 0000000..72ce8c5 Binary files /dev/null and b/app/src/main/res/drawable/meishi.jpg differ diff --git a/app/src/main/res/drawable/mlt.png b/app/src/main/res/drawable/mlt.png new file mode 100644 index 0000000..150b57b Binary files /dev/null and b/app/src/main/res/drawable/mlt.png differ diff --git a/app/src/main/res/drawable/more.png b/app/src/main/res/drawable/more.png new file mode 100644 index 0000000..c68b765 Binary files /dev/null and b/app/src/main/res/drawable/more.png differ diff --git a/app/src/main/res/drawable/ms.png b/app/src/main/res/drawable/ms.png new file mode 100644 index 0000000..7125d11 Binary files /dev/null and b/app/src/main/res/drawable/ms.png differ diff --git a/app/src/main/res/drawable/noodles.jpg b/app/src/main/res/drawable/noodles.jpg new file mode 100644 index 0000000..bc28d95 Binary files /dev/null and b/app/src/main/res/drawable/noodles.jpg differ diff --git a/app/src/main/res/drawable/one.jpg b/app/src/main/res/drawable/one.jpg new file mode 100644 index 0000000..4e2ab58 Binary files /dev/null and b/app/src/main/res/drawable/one.jpg differ diff --git a/app/src/main/res/drawable/password.png b/app/src/main/res/drawable/password.png new file mode 100644 index 0000000..ab143ef Binary files /dev/null and b/app/src/main/res/drawable/password.png differ diff --git a/app/src/main/res/drawable/person.png b/app/src/main/res/drawable/person.png new file mode 100644 index 0000000..782c6b9 Binary files /dev/null and b/app/src/main/res/drawable/person.png differ diff --git a/app/src/main/res/drawable/pj.png b/app/src/main/res/drawable/pj.png new file mode 100644 index 0000000..0457862 Binary files /dev/null and b/app/src/main/res/drawable/pj.png differ diff --git a/app/src/main/res/drawable/qq.jpg b/app/src/main/res/drawable/qq.jpg new file mode 100644 index 0000000..7d43729 Binary files /dev/null and b/app/src/main/res/drawable/qq.jpg differ diff --git a/app/src/main/res/drawable/register.jpg b/app/src/main/res/drawable/register.jpg new file mode 100644 index 0000000..9c1808e Binary files /dev/null and b/app/src/main/res/drawable/register.jpg differ diff --git a/app/src/main/res/drawable/rl.png b/app/src/main/res/drawable/rl.png new file mode 100644 index 0000000..5c6da04 Binary files /dev/null and b/app/src/main/res/drawable/rl.png differ diff --git a/app/src/main/res/drawable/seven.jpg b/app/src/main/res/drawable/seven.jpg new file mode 100644 index 0000000..5e61bf4 Binary files /dev/null and b/app/src/main/res/drawable/seven.jpg differ diff --git a/app/src/main/res/drawable/shopping.png b/app/src/main/res/drawable/shopping.png new file mode 100644 index 0000000..ad037aa Binary files /dev/null and b/app/src/main/res/drawable/shopping.png differ diff --git a/app/src/main/res/drawable/six.jpg b/app/src/main/res/drawable/six.jpg new file mode 100644 index 0000000..18a47cd Binary files /dev/null and b/app/src/main/res/drawable/six.jpg differ diff --git a/app/src/main/res/drawable/sk.png b/app/src/main/res/drawable/sk.png new file mode 100644 index 0000000..8dc68dd Binary files /dev/null and b/app/src/main/res/drawable/sk.png differ diff --git a/app/src/main/res/drawable/td.png b/app/src/main/res/drawable/td.png new file mode 100644 index 0000000..b66f984 Binary files /dev/null and b/app/src/main/res/drawable/td.png differ diff --git a/app/src/main/res/drawable/three.jpg b/app/src/main/res/drawable/three.jpg new file mode 100644 index 0000000..2420649 Binary files /dev/null and b/app/src/main/res/drawable/three.jpg differ diff --git a/app/src/main/res/drawable/title.jpg b/app/src/main/res/drawable/title.jpg new file mode 100644 index 0000000..d2a9fb5 Binary files /dev/null and b/app/src/main/res/drawable/title.jpg differ diff --git a/app/src/main/res/drawable/two.jpg b/app/src/main/res/drawable/two.jpg new file mode 100644 index 0000000..fc01ad5 Binary files /dev/null and b/app/src/main/res/drawable/two.jpg differ diff --git a/app/src/main/res/drawable/type_selector_bg.xml b/app/src/main/res/drawable/type_selector_bg.xml new file mode 100644 index 0000000..9e06606 --- /dev/null +++ b/app/src/main/res/drawable/type_selector_bg.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/type_selector_normal_bg.xml b/app/src/main/res/drawable/type_selector_normal_bg.xml new file mode 100644 index 0000000..77dee58 --- /dev/null +++ b/app/src/main/res/drawable/type_selector_normal_bg.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/user.png b/app/src/main/res/drawable/user.png new file mode 100644 index 0000000..b1b6038 Binary files /dev/null and b/app/src/main/res/drawable/user.png differ diff --git a/app/src/main/res/drawable/weibo.jpg b/app/src/main/res/drawable/weibo.jpg new file mode 100644 index 0000000..48ed66b Binary files /dev/null and b/app/src/main/res/drawable/weibo.jpg differ diff --git a/app/src/main/res/drawable/weichat.jpg b/app/src/main/res/drawable/weichat.jpg new file mode 100644 index 0000000..9e7948d Binary files /dev/null and b/app/src/main/res/drawable/weichat.jpg differ diff --git a/app/src/main/res/drawable/xx.png b/app/src/main/res/drawable/xx.png new file mode 100644 index 0000000..5f4d7d0 Binary files /dev/null and b/app/src/main/res/drawable/xx.png differ diff --git a/app/src/main/res/layout/activity_index.xml b/app/src/main/res/layout/activity_index.xml new file mode 100644 index 0000000..5509091 --- /dev/null +++ b/app/src/main/res/layout/activity_index.xml @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml new file mode 100644 index 0000000..bbe5300 --- /dev/null +++ b/app/src/main/res/layout/activity_login.xml @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +