第四次代码

main
杨松林 8 months ago
parent 74e7aeb384
commit f18cb2a676

@ -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

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
</component>
</project>

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="app">
<State>
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\songl\.android\avd\Pixel_3a_API_34_extension_level_7_x86_64.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2024-04-01T06:33:15.175480700Z" />
</State>
</entry>
</value>
</component>
</project>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<component name="VisualizationToolProject">
<option name="state">
<ProjectState>
<option name="scale" value="0.6388508891928865" />
</ProjectState>
</option>
</component>
</project>

@ -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)
}

@ -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

@ -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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@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());
}
}

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.DeliciousFoodApp"
tools:targetApi="31">
<activity
android:name=".IndexActivity"
android:exported="true" />
<activity
android:name=".testActivity2"
android:exported="false" />
<activity
android:name=".RegisterinformationActivity"
android:exported="false" />
<activity
android:name=".RegisterActivity"
android:exported="false" />
<activity
android:name=".LoginActivity"
android:exported="true" />
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

@ -0,0 +1,66 @@
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 com.example.deliciousfoodapp.R;
import java.util.List;
import java.util.Map;
public class HomeMyAdapter extends BaseAdapter {
private List<Map<String, Object>> datas;
private Context mContext;
public HomeMyAdapter(List<Map<String, Object>> 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.homelist_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;
}
}

@ -0,0 +1,58 @@
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 com.example.deliciousfoodapp.R;
import java.util.List;
import java.util.Map;
public class HomeNewAdapter extends BaseAdapter {
List<Map<String,Object>> datas;
Context mContext;
HomeNewAdapter(List<Map<String,Object>> 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.homelist_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;
}
}

@ -0,0 +1,53 @@
package com.example.deliciousfoodapp;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
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;
@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());
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.home:
replaceFragment(new homeFragment());
break;
case R.id.food:
replaceFragment(new foodFragment());
break;
case R.id.shopping:
replaceFragment(new shopFragment());
break;
case R.id.person:
replaceFragment(new personFragment());
}
}
private void replaceFragment(Fragment fragment) {
FragmentManager fragmentManager=getSupportFragmentManager();
FragmentTransaction transaction=fragmentManager.beginTransaction();
transaction.replace(R.id.framlayout,fragment);
transaction.commit();
}
}

@ -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.buttonlogin);
Button button2 = (Button) findViewById(R.id.buttonregister);
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);
}
});
}
}

@ -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);
}
});
}
}

@ -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 ? "男性" : "女性";
}
}

@ -0,0 +1,60 @@
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();
}
});
}
}

@ -0,0 +1,94 @@
package com.example.deliciousfoodapp.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
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 FoodLeftAdapter extends RecyclerView.Adapter<FoodLeftAdapter.MyHolder> {
private List<String>dataList=new ArrayList<>();
private int currentIndex=0;
public FoodLeftAdapter(List<String> dataList){
this.dataList=dataList;
}
@NonNull
@Override
public MyHolder onCreateViewHolder(@NonNull ViewGroup parent,int viewType){
View view=LayoutInflater.from(parent.getContext()).inflate(R.layout.item_left_food,null);
return new MyHolder(view);
}
@SuppressLint("RecyclerView")
@Override
public void onBindViewHolder (@NonNull MyHolder holder,int position){
//绑定数据
String name = dataList.get(position);
holder.textView.setText(name);
if (currentIndex == position) {
holder.itemView.setBackgroundResource(R.drawable.type_selector_bg);
} else {
holder.itemView.setBackgroundResource(0); // 清除背景
}
//分类的点击事件
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(null!=mLeftListOnClickItemListener){//点击事件作用于左边整条列表上
mLeftListOnClickItemListener.onItemClick(position);//如果它不为空回调一个position
setCurrentIndex(position); // 更新选中项索引
}
}
});
//点击它就出现高亮前面有一个标识
if(currentIndex==position){
holder.itemView.setBackgroundResource(R.drawable.type_selector_bg);
}
}
@Override
public int getItemCount(){
return dataList.size();
}
static class MyHolder extends RecyclerView.ViewHolder {
TextView textView;
public MyHolder(@NonNull View itemView) {
super(itemView);
textView=itemView.findViewById(R.id.name);
}
}
private LeftListOnClickItemListener mLeftListOnClickItemListener;
// public LeftListOnClickItemListener getLeftListOnClickItemListener(){
// return mLeftListOnClickItemListener;
// }
public void setLeftListOnClickItemListener(LeftListOnClickItemListener leftListOnClickItemListener){
mLeftListOnClickItemListener=leftListOnClickItemListener;
}
//写一个点击事件
public interface LeftListOnClickItemListener{
void onItemClick(int position);
}
public void setCurrentIndex(int position){
this.currentIndex=position;
notifyDataSetChanged();//刷新一下
}
}

@ -0,0 +1,68 @@
package com.example.deliciousfoodapp.adapter;
import android.content.Context;
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.R;
import com.example.deliciousfoodapp.entity.FoodInfo;
import java.util.ArrayList;
import java.util.List;
public class FoodRightAdapter extends RecyclerView.Adapter<FoodRightAdapter.ViewHolder> {
private List<FoodInfo> mFoodInfos=new ArrayList<>();
public void setListData(List<FoodInfo> list){
this.mFoodInfos=list;
//刷新
notifyDataSetChanged();
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
//加布局
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_right_food, null);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
//绑定数据
FoodInfo foodInfo =mFoodInfos.get(position);
holder.food_img.setImageResource(foodInfo.getFood_img());
holder.food_title.setText(foodInfo.getFood_title());
holder.food_details.setText(foodInfo.getFood_details());
//价格是int类型但是只能设置为文本类型在后面加个+加引号
holder.food_price.setText(foodInfo.getFood_price()+"");
holder.food_next.setText(foodInfo.getFood_next());
}
@Override
public int getItemCount() {
return mFoodInfos.size();
}
static class ViewHolder extends RecyclerView.ViewHolder {
ImageView food_img;
TextView food_title;
TextView food_details;
TextView food_price;
TextView food_next;
public ViewHolder(@NonNull View itemView) {
super(itemView);
food_img = itemView.findViewById(R.id.food_img);
food_title = itemView.findViewById(R.id.food_title);
food_details = itemView.findViewById(R.id.food_details);
food_price= itemView.findViewById(R.id.food_price);
food_next= itemView.findViewById(R.id.food_next);
}
}
}

@ -0,0 +1,159 @@
package com.example.deliciousfoodapp.entity;
import com.example.deliciousfoodapp.R;
import java.util.ArrayList;
import java.util.List;
public class FoodDataService {
//提供数据
public static List<FoodInfo> getListData(int position){
List<FoodInfo> list=new ArrayList<>();
if(position==0){
list.add(new FoodInfo(0, R.drawable.grapefruit,"天然清爽,健康选择。","酸甜可口,带有清新的果香,满足你对健康生活的追求。",12,"元/斤"));
list.add(new FoodInfo(1, R.drawable.dragonfruit,"独特魅力,色彩斑斓。","口感清爽,果肉细腻,多汁爽口,是时尚人士的首选。",15,"元/斤"));
list.add(new FoodInfo(2, R.drawable.hamimelon,"果香四溢,甜蜜滋味。","水分丰富,果肉细腻,口感清甜,让你尽情享受夏日的清凉。",14,"元/斤"));
list.add(new FoodInfo(3, R.drawable.pineapple,"酸甜可口,果香扑鼻。","口感丰富多汁爽口富含维生素C是夏日解暑的最佳选择。",8,"元/斤"));
list.add(new FoodInfo(4, R.drawable.cherry,"美味小巧,诱人色泽。","果肉鲜嫩,酸甜可口,口感丰富,是爱情的象征。",46,"元/1斤"));
list.add(new FoodInfo(5, R.drawable.lemon,"清新怡人,酸甜可口。","富含维生素C口感鲜爽可制作饮料或调味料增添生活情趣。",13,"元/斤"));
list.add(new FoodInfo(6, R.drawable.starfruit,"果肉细腻,香甜可口。","鲜红诱人,汁水丰富,口感浓郁,是夏日水果中的佳品。",36,"元/斤"));
list.add(new FoodInfo(7, R.drawable.sweetcherry,"明星风采,独特风味。","口感清爽果肉多汁味道独特富含维生素C让你倍感清新。",10,"元/斤"));
}else if(position==1){
list.add(new FoodInfo(8, R.drawable.one,"新鲜炒酱、烹饪必备。","汁水丰富,口感鲜甜,色泽鲜艳,是健康餐桌上的明星。",6,"元/斤"));
list.add(new FoodInfo(9, R.drawable.three,"凉拌、生吃首选。","口感清脆,汁水丰富,清凉解暑,是夏日的必备蔬菜。",3,"元/斤"));
list.add(new FoodInfo(10, R.drawable.one,"蔬菜沙拉、炖汤佳品。","口感甘甜,营养丰富,富含胡萝卜素,有益眼睛健康。",5,"元/斤"));
list.add(new FoodInfo(11, R.drawable.three,"清炒、煮汤、火锅必备。","叶片脆嫩,汁水鲜甜,营养丰富,是家常菜的主角。",2,"元/斤"));
list.add(new FoodInfo(12, R.drawable.one,"烧茄子、酱茄子、烤茄子。","肉质细嫩,口感鲜美,烹饪多样,满足不同口味需求。",4,"元/斤"));
list.add(new FoodInfo(13, R.drawable.three,"炒菜、凉拌、烧烤。","口感爽脆,香气诱人,是各类菜肴的调味佳品。",3,"元/斤"));
list.add(new FoodInfo(14, R.drawable.mango,"汆、炒、煮皆宜。","叶片嫩绿口感爽滑富含维生素C有益健康。",7,"元/斤"));
list.add(new FoodInfo(15, R.drawable.two,"炖、煮、炸、烤皆可。","口感绵软,味道浓郁,是各类美食的基础材料。",3,"元/斤"));
}else if(position==2){
list.add(new FoodInfo(16, R.drawable.one,"澳洲和牛,口感细腻,肉香四溢,尽享尊贵美味。","肉质鲜嫩多汁,口感柔滑,带有淡淡的奶香,令人回味无穷。",100,"元/斤"));
list.add(new FoodInfo(17, R.drawable.three,"黑山猪肉,肉质鲜美,口感醇厚,健康又美味。","肉质紧实,口感鲜美,带有淡淡的甜香,是烹饪佳肴的绝佳选择。",200,"元/斤"));
list.add(new FoodInfo(18, R.drawable.one,"新疆羊肉,肉质鲜嫩,口感独特,草原风情尽在其中。","羊肉鲜美无膻,口感细腻,带有一种独特的草原香气,令人陶醉。",90,"元/斤"));
list.add(new FoodInfo(19, R.drawable.three,"山林散养鸡,肉质紧实,口感鲜美,营养又健康。","鸡肉鲜美多汁,口感滑嫩,带有山林的自然清香,是健康饮食的首选。",120,"元/斤"));
list.add(new FoodInfo(20, R.drawable.one,"深海金枪鱼,肉质细腻,口感鲜美,海洋馈赠的珍品。","鱼肉鲜嫩爽滑,口感鲜美,带有淡淡的海洋气息,令人流连忘返。",300,"元/斤"));
list.add(new FoodInfo(21, R.drawable.three,"金华火腿,口感醇香,肉质鲜美,烹饪佳品不容错过。","金华火腿,口感醇香,肉质鲜美,烹饪佳品不容错过。",260,"元/斤"));
list.add(new FoodInfo(22, R.drawable.mango,"炭烤羊排,外酥里嫩,香气四溢,烧烤美味尽在其中。","羊排经过炭火慢烤,外酥里嫩,口感鲜美,香气扑鼻,是烧烤爱好者的最爱。",280,"元/斤"));
list.add(new FoodInfo(23, R.drawable.two,"香煎培根,口感香脆,肉质鲜美,美味早餐的不二之选。","培根经过香煎,口感香脆,肉质鲜美,搭配面包或鸡蛋食用更佳。",166,"元/斤"));
}else if(position==3){
list.add(new FoodInfo(24, R.drawable.one,"皮薄馅足,汤汁鲜美,品尝传统小吃之经典。","小笼包皮薄如纸,内馅鲜嫩多汁,轻咬一口,汤汁四溢,口感细腻。",15,"元/笼"));
list.add(new FoodInfo(25, R.drawable.three,"香脆可口,馅料丰富,街头小吃之首选。","煎饼果子外皮金黄酥脆,内馅饱满,口感层次丰富,是早餐或夜宵的绝佳选择。",10,"元/个"));
list.add(new FoodInfo(26, R.drawable.one,"外酥里嫩,气味独特,挑战味蕾的臭豆腐。","臭豆腐经过特殊发酵,外皮酥脆,内里嫩滑,口感独特,是喜欢尝试不同风味食客的选择。",16,"元/份"));
list.add(new FoodInfo(27, R.drawable.three,"肉质鲜嫩,香气扑鼻,烧烤小吃的代表之作。","羊肉串选用优质羊肉,经过精心烤制,肉质鲜嫩多汁,香气四溢,是烧烤爱好者的最爱。",2,"元/串"));
list.add(new FoodInfo(28, R.drawable.one,"麻辣鲜香,食材丰富,味蕾的麻辣盛宴。","麻辣烫选用多种食材,搭配麻辣底料,口感麻辣鲜香,让人回味无穷,是喜欢辣味食客的不二之选。",30,"元/份"));
list.add(new FoodInfo(29, R.drawable.three,"甜而不腻,外酥内软,传统甜点的魅力所在。","糖油粑粑外皮酥脆,内里软糯,甜度适中,口感丰富,是喜欢甜食者的心头好。",8,"元/个"));
list.add(new FoodInfo(30, R.drawable.mango,"冷面筋道,酱料浓郁,街头巷尾的美食佳品。","烤冷面选用优质冷面,搭配特制酱料,口感筋道爽滑,酱香四溢,是夜市小吃的一大特色。",10,"元/份"));
list.add(new FoodInfo(31, R.drawable.two,"酸辣可口,粉质滑嫩,开胃解馋的小吃之选。","酸辣粉选用优质红薯粉,搭配酸辣汤汁,口感滑嫩爽口,酸辣适中,是开胃解馋的绝佳小吃。",12,"元/碗"));
}else if(position==4){
list.add(new FoodInfo(32, R.drawable.one,"酸辣粉选用优质红薯粉,搭配酸辣汤汁,口感滑嫩爽口,酸辣适中,是开胃解馋的绝佳小吃。","慕斯蛋糕口感轻盈,入口即化,搭配丰富的水果和果酱,层次丰富,甜而不腻。",20,"元/块"));
list.add(new FoodInfo(33, R.drawable.three,"咖啡香浓,口感丰富,传统意式甜点的经典之作。","提拉米苏融合了咖啡的苦涩、可可的浓郁和奶油的绵密,口感层次丰富,令人回味无穷。",20,"元/份"));
list.add(new FoodInfo(34, R.drawable.one,"巧克力浓郁,口感醇厚,满足巧克力控的味蕾。","黑森林蛋糕外层覆盖着浓郁的巧克力,内里则是松软的蛋糕和酸甜的樱桃,口感丰富,甜而不腻。",35,"元/块"));
list.add(new FoodInfo(35, R.drawable.three,"色彩缤纷,口感酥脆,法式甜点的精致之选。","马卡龙外壳酥脆,内里柔软,色彩缤纷,口感轻盈,是下午茶时光的绝佳伴侣。",9,"元/个"));
list.add(new FoodInfo(36, R.drawable.one,"榴莲飘香,口感滑嫩,热带风味的甜品盛宴。","榴莲班戟外皮薄脆,内馅是浓郁的榴莲肉,口感滑嫩,香气四溢,是榴莲爱好者的最爱。",20,"元/个"));
list.add(new FoodInfo(37, R.drawable.three,"芒果香甜,口感嫩滑,夏日清凉的甜品佳品。","芒果布丁以新鲜芒果为原料,口感嫩滑,芒果的香甜与布丁的细腻完美结合,是夏日消暑的绝佳选择。",16,"元/杯"));
list.add(new FoodInfo(38, R.drawable.mango,"焦糖香浓,口感细腻,传统英式甜点的魅力所在。","焦糖炖蛋口感柔滑,焦糖的香甜与蛋液的细腻完美结合,入口即化,是甜品爱好者的不二之选。",15,"元/份"));
list.add(new FoodInfo(39, R.drawable.two,"芒果清爽,口感丰富,夏日解暑的甜品之选。","杨枝甘露以芒果、西柚等水果为主料,口感清爽,酸甜适中,是夏日消暑、解渴的绝佳甜品。",18,"元/碗"));
}else if(position==5){
list.add(new FoodInfo(40, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(41, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(42, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(43, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(44, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(45, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(46, R.drawable.mango,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(47, R.drawable.two,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
}else if(position==6){
list.add(new FoodInfo(48, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(49, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(50, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(51, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(52, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(53, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(54, R.drawable.mango,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(55, R.drawable.two,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
}else if(position==7){
list.add(new FoodInfo(56, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(57, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(58, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(59, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(60, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(61, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(62, R.drawable.mango,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(63, R.drawable.two,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
}else if(position==8){
list.add(new FoodInfo(64, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(65, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(66, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(67, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(68, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(69, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(70, R.drawable.mango,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(71, R.drawable.two,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
}else if(position==9){
list.add(new FoodInfo(72, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(73, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(74, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(75, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(76, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(77, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(78, R.drawable.mango,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(79, R.drawable.two,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",1,"元/1斤"));
}else if(position==10){
list.add(new FoodInfo(80, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(81, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(82, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(83, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(84, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(85, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(86, R.drawable.mango,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(87, R.drawable.two,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
}else if(position==11){
list.add(new FoodInfo(88, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(89, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(90, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(91, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(92, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(93, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(94, R.drawable.mango,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(95, R.drawable.two,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
}else if(position==12){
list.add(new FoodInfo(96, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(97, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(98, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(99, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(100, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(101, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(102, R.drawable.mango,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(103, R.drawable.two,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
}else if(position==13){
list.add(new FoodInfo(104, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(105, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(106, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(107, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(108, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(109, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(110, R.drawable.mango,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(111, R.drawable.two,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
}else if(position==14){
list.add(new FoodInfo(112, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(113, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(114, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(115, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(116, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(117, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(118, R.drawable.mango,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(119, R.drawable.two,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
}else{
list.add(new FoodInfo(120, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(121, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(122, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(123, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(124, R.drawable.one,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(125, R.drawable.three,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(126, R.drawable.mango,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
list.add(new FoodInfo(127, R.drawable.two,"尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。","口味:甜 场地:湖南",10,"元/1斤"));
}
return list;
}
}

@ -0,0 +1,67 @@
package com.example.deliciousfoodapp.entity;
public class FoodInfo {
private int food_id;
private int food_img;
private String food_title;
private String food_details;
private int food_price;
private String food_next;
public FoodInfo(int food_id, int food_img, String food_title, String food_details, int food_price,String food_next) {
this.food_id = food_id;
this.food_img = food_img;
this.food_title = food_title;
this.food_details = food_details;
this.food_price = food_price;
this.food_next = food_next;
}
public int getFood_id() {
return food_id;
}
public void setFood_id(int food_id) {
this.food_id = food_id;
}
public int getFood_img() {
return food_img;
}
public void setFood_img(int food_img) {
this.food_img = food_img;
}
public String getFood_title() {
return food_title;
}
public void setFood_title(String food_title) {
this.food_title = food_title;
}
public String getFood_details() {
return food_details;
}
public void setFood_details(String food_details) {
this.food_details = food_details;
}
public int getFood_price() {
return food_price;
}
public void setFood_price(int food_price) {
this.food_price = food_price;
}
public String getFood_next() {
return food_next;
}
public void setFood_next(String food_next) {
this.food_next = food_next;
}
}

@ -0,0 +1,81 @@
package com.example.deliciousfoodapp;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import com.example.deliciousfoodapp.adapter.FoodLeftAdapter;
import com.example.deliciousfoodapp.adapter.FoodRightAdapter;
import com.example.deliciousfoodapp.entity.FoodDataService;
import java.util.ArrayList;
import java.util.List;
public class foodFragment extends Fragment {
private View rootView;
private RecyclerView foodleftRecyclerView;
private RecyclerView foodrightRecyclerView;
private FoodLeftAdapter mLeftListAdapter;
private FoodRightAdapter mRightListAdapter;
private List<String> leftDataList=new ArrayList<>();
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
rootView=inflater.inflate(R.layout.fragment_food, container, false);
//初始化控件
foodleftRecyclerView=rootView.findViewById(R.id.foodleftRecyclerView);
foodrightRecyclerView=rootView.findViewById(R.id.foodrightRecyclerView);
return rootView;
}
@Override
public void onActivityCreated(@NonNull Bundle savedInstanceState){
super.onActivityCreated(savedInstanceState);
leftDataList.add("水果");
leftDataList.add("蔬菜");
leftDataList.add("肉类");
leftDataList.add("小吃");
leftDataList.add("甜点");
leftDataList.add("主食类");
leftDataList.add("面食");
leftDataList.add("海鲜");
leftDataList.add("炸鸡");
leftDataList.add("饮品");
leftDataList.add("早点");
leftDataList.add("土特产");
leftDataList.add("凉菜");
leftDataList.add("汤羹");
leftDataList.add("面包");
mLeftListAdapter=new FoodLeftAdapter(leftDataList);
foodleftRecyclerView.setAdapter(mLeftListAdapter);
mRightListAdapter=new FoodRightAdapter();
foodrightRecyclerView.setAdapter(mRightListAdapter);
//默认加载美食数据
mRightListAdapter.setListData(FoodDataService.getListData(0));
//recyclerview点击事件
mLeftListAdapter.setLeftListOnClickItemListener(new FoodLeftAdapter.LeftListOnClickItemListener() {
@Override
public void onItemClick(int position) {
//Toast.makeText(getActivity(),position+"----",Toast.LENGTH_SHORT).show();
mLeftListAdapter.setCurrentIndex(position);
//点击左侧分类就切换右侧的数据
mRightListAdapter.setListData(FoodDataService.getListData(position));
}
});
}
}

@ -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 android.widget.ListView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.example.deliciousfoodapp.R;
import com.example.deliciousfoodapp.HomeNewAdapter;
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 HomeNewAdapter myAdapter;
private List<Map<String, Object>> 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.homelistview);
myAdapter = new HomeNewAdapter(list, requireContext());
mListView.setAdapter(myAdapter);
return view;
}
// 自定义数据,也可以添加网络数据
private void initData() {
Map<String, Object> 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);
}
}

@ -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);
}
}

@ -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.
* <p>
* TODO: Replace all uses of this class before publishing your app.
*/
public class PlaceholderContent {
/**
* An array of sample (placeholder) items.
*/
public static final List<PlaceholderItem> ITEMS = new ArrayList<PlaceholderItem>();
/**
* A map of sample (placeholder) items, by ID.
*/
public static final Map<String, PlaceholderItem> ITEM_MAP = new HashMap<String, PlaceholderItem>();
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;
}
}
}

@ -0,0 +1,27 @@
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 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);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF" />
<stroke
android:width="2dp"
android:color="#000000" />
<corners
android:radius="4dp" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1007 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="@color/white"/>
</shape>
</item>
<!-- 在选中的前面加一个标识-->
<item android:top="10dp" android:bottom="10dp" android:right="76dp">
<shape>
<solid android:color="#FF9800"/>
</shape>
</item>
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".IndexActivity">
<FrameLayout
android:id="@+id/framlayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/content_nav"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,184 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".LoginActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="105dp"
android:layout_weight="1"
app:srcCompat="@drawable/title"
tools:ignore="MissingConstraints" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_marginTop="80dp"
android:gravity="center_horizontal">
<ImageButton
android:id="@+id/imageButton4"
android:layout_width="225dp"
android:layout_height="220dp"
android:layout_marginTop="15dp"
app:srcCompat="@drawable/noodles" />
</LinearLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="300dp"
android:stretchColumns="1">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageView6"
android:layout_width="50dp"
android:layout_height="48dp"
android:layout_marginStart="45dp"
android:layout_marginTop="20dp"
android:layout_column="0"
app:srcCompat="@drawable/user" />
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_marginTop="30dp"
android:layout_marginEnd="80dp"
android:hint="请输入电子邮箱/手机号"
android:textSize="18sp"
android:textStyle="bold" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageView7"
android:layout_width="50dp"
android:layout_height="48dp"
android:layout_marginStart="45dp"
android:layout_marginTop="25dp"
android:layout_column="0"
app:srcCompat="@drawable/password" />
<EditText
android:id="@+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginEnd="80dp"
android:textSize="18sp"
android:textStyle="bold"
android:layout_column="1"
android:hint="请输入密码" />
</TableRow>
</TableLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="480dp">
<Button
android:id="@+id/buttonlogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="80dp"
android:backgroundTint="#F16E01"
android:textColor="@android:color/white"
android:text="登录"
android:textSize="24sp" />
<Button
android:id="@+id/buttonregister"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/buttonlogin"
android:layout_marginLeft="80dp"
android:backgroundTint="#F16E01"
android:text="注册"
android:textColor="@android:color/white"
android:textColorLink="#3AB6C6"
android:textSize="24sp"
android:onClick="click"/>
<CheckBox
android:id="@+id/checkBox2"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:layout_below="@id/buttonlogin"
android:layout_marginRight="90dp"
android:layout_toLeftOf="@id/textView4"
android:text="记住密码"
android:textSize="18sp" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/buttonregister"
android:layout_alignParentRight="true"
android:layout_marginEnd="55dp"
android:text="忘记密码 ?"
android:textSize="18sp" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/checkBox2"
android:layout_marginEnd="32dp"
android:layout_marginTop="20dp"
android:layout_centerHorizontal="true"
android:text="—— 第三方账号登录 ——"
android:textSize="20sp"/>
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="40dp"
android:layout_height="46dp"
android:layout_below="@id/textView5"
android:layout_toLeftOf="@id/imageButton2"
android:layout_marginRight="40dp"
android:layout_marginTop="15dp"
app:srcCompat="@drawable/qq" />
<ImageButton
android:id="@+id/imageButton2"
android:layout_width="40dp"
android:layout_height="36dp"
android:layout_below="@id/textView5"
android:layout_marginTop="18dp"
android:layout_centerHorizontal="true"
app:srcCompat="@drawable/weichat" />
<ImageButton
android:id="@+id/imageButton3"
android:layout_width="40dp"
android:layout_height="36dp"
android:layout_below="@id/textView5"
android:layout_toRightOf="@id/imageButton2"
android:layout_marginLeft="40dp"
android:layout_marginTop="18dp"
app:srcCompat="@drawable/weibo" />
<CheckBox
android:id="@+id/checkBox"
android:layout_width="380dp"
android:layout_height="wrap_content"
android:layout_below="@id/imageButton3"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
android:text="同意《用户服务协议》及《基本功能隐私协议》"
android:textSize="16sp" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:background="@drawable/bg2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="560dp"
android:layout_gravity="center"
android:textSize="24sp"
android:text="开启美食之旅"
android:backgroundTint="#F16E01"
android:textColor="@android:color/white"
android:onClick="click"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,234 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".RegisterActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="150dp"
android:layout_alignParentTop="true"
app:srcCompat="@drawable/register" />
<RelativeLayout
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/imageView"
android:padding="30dp"
android:id="@+id/relativelayout2">
<TextView
android:id="@+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="用户名:"
android:textSize="20sp" />
<EditText
android:id="@+id/usernamebox"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:textSize="20sp"
android:layout_marginLeft="20dp"
android:background="@drawable/edittext_border"
android:layout_toRightOf="@id/username" />
<TextView
android:id="@+id/password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="登录密码:"
android:layout_below="@id/username"
android:layout_marginTop="30dp"
android:textSize="20sp" />
<EditText
android:id="@+id/passwordbox"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_below="@id/usernamebox"
android:layout_marginLeft="24dp"
android:layout_marginTop="35dp"
android:layout_toRightOf="@id/username"
android:background="@drawable/edittext_border"
android:textSize="20sp" />
<TextView
android:id="@+id/surepassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="确认密码:"
android:layout_below="@id/password"
android:textSize="20sp" />
<EditText
android:id="@+id/surepasswordbox"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_below="@id/passwordbox"
android:layout_marginLeft="17dp"
android:layout_marginTop="27dp"
android:layout_toRightOf="@id/phone"
android:background="@drawable/edittext_border"
android:textSize="20sp" />
<TextView
android:id="@+id/phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="手机号码:"
android:layout_below="@id/surepassword"
android:textSize="20sp" />
<EditText
android:id="@+id/phonebox"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_below="@id/surepasswordbox"
android:layout_marginLeft="21dp"
android:layout_marginTop="30dp"
android:layout_toRightOf="@id/phone"
android:background="@drawable/edittext_border"
android:textSize="20sp" />
<TextView
android:id="@+id/email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="电子邮箱:"
android:layout_below="@id/phonebox"
android:textSize="20sp" />
<EditText
android:id="@+id/emailbox"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_below="@id/phonebox"
android:layout_marginLeft="20dp"
android:layout_marginTop="38dp"
android:layout_toRightOf="@id/email"
android:background="@drawable/edittext_border"
android:textSize="20sp" />
<TextView
android:id="@+id/address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="所在地:"
android:layout_below="@id/email"
android:textSize="20sp" />
<EditText
android:id="@+id/addressbox"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_below="@id/emailbox"
android:layout_marginLeft="42dp"
android:layout_marginTop="27dp"
android:layout_toRightOf="@id/address"
android:background="@drawable/edittext_border"
android:textSize="20sp" />
<TextView
android:id="@+id/gender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="性别:"
android:layout_below="@id/address"
android:textSize="20sp" />
<RadioGroup
android:id="@+id/genderRadioGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal"
android:layout_below="@id/addressbox"
android:layout_toRightOf="@id/surepassword"
android:layout_marginLeft="18dp">
<RadioButton
android:id="@+id/maleRadioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="男"
android:textSize="20sp" />
<RadioButton
android:id="@+id/femaleRadioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="女"
android:textSize="20sp"
android:layout_marginLeft="30dp"/>
</RadioGroup>
<TextView
android:id="@+id/taste"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/gender"
android:layout_marginTop="30dp"
android:text="喜欢口味:"
android:textSize="20sp"/>
<CheckBox
android:id="@+id/checkbox_sour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/genderRadioGroup"
android:layout_marginLeft="10dp"
android:layout_marginTop="13dp"
android:layout_toRightOf="@id/taste"
android:text="酸"
android:textSize="20sp" />
<CheckBox
android:id="@+id/checkbox_sweet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/genderRadioGroup"
android:layout_marginLeft="0dp"
android:layout_marginTop="13dp"
android:layout_toRightOf="@id/checkbox_sour"
android:text="甜"
android:textSize="20sp" />
<CheckBox
android:id="@+id/checkbox_spicy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/genderRadioGroup"
android:layout_marginLeft="1dp"
android:layout_marginTop="13dp"
android:layout_toRightOf="@id/checkbox_sweet"
android:text="辣"
android:textSize="20sp" />
</RelativeLayout>
<Button
android:id="@+id/referbutton"
android:layout_width="137dp"
android:layout_height="wrap_content"
android:layout_below="@id/relativelayout2"
android:layout_centerHorizontal="true"
android:backgroundTint="#FEA37C"
android:textSize="24sp"
android:text="提交"
android:textColor="@android:color/white"
android:onClick="click"/>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".RegisterinformationActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/informationimage"
android:layout_width="wrap_content"
android:layout_height="130dp"
android:layout_alignParentTop="true"
app:srcCompat="@drawable/information" />
<LinearLayout
android:id="@+id/linearlayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="160dp"
android:orientation="vertical"
android:gravity="center_horizontal">
<TextView
android:id="@+id/show_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="TextView"
android:textSize="20sp"
android:textColor="@android:color/black"/>
</LinearLayout>
<Button
android:id="@+id/gobackbutton"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:backgroundTint="#FEA37C"
android:onClick="click"
android:text="返回登录页"
android:textColor="@android:color/white"
android:textSize="23sp"
android:layout_centerHorizontal="true"
android:layout_below="@id/linearlayout1"
android:layout_marginTop="20dp"/>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_marginBottom="50dp"
>
<LinearLayout
android:id="@+id/home"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#F7F5BC"
android:orientation="vertical"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/home"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="首页"
android:textColor="#707070"
android:textSize="18sp"/>
</LinearLayout>
<LinearLayout
android:id="@+id/food"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:background="#F7F5BC"
android:layout_gravity="bottom"
android:orientation="vertical"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/food"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="分类"
android:textColor="#707070"
android:textSize="18sp"/>
</LinearLayout>
<LinearLayout
android:id="@+id/shopping"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_gravity="bottom"
android:layout_height="wrap_content"
android:background="#F7F5BC"
android:orientation="vertical"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/shopping"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="订单"
android:textColor="#707070"
android:textSize="18sp"/>
</LinearLayout>
<LinearLayout
android:id="@+id/person"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_gravity="bottom"
android:layout_height="wrap_content"
android:background="#F7F5BC"
android:orientation="vertical"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/person"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="我的"
android:textColor="#707070"
android:textSize="18sp"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".foodFragment">
<!-- TODO: Update blank fragment layout -->
<androidx.appcompat.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FF9800"
android:textSize="30sp"
app:title="美食分类"
app:titleTextColor="@color/white"/>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="80dp"
android:layout_height="match_parent"
android:background="#F7F5BC">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/foodleftRecyclerView"
android:layout_width="match_parent"
tools:listitem="@layout/item_left_food"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:layout_height="match_parent"/>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/foodrightRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@layout/item_right_food"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>

@ -0,0 +1,271 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
tools:context=".homeFragment">
<FrameLayout
android:id="@+id/framlayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#F7F5BC">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<SearchView
android:id="@+id/searchView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:focusable="false"
android:iconifiedByDefault="false"
android:queryHint="请输入搜索内容" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/xx"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/gd1"
android:layout_marginRight="5dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="210dp"
android:layout_marginTop="50dp"
android:background="@drawable/seven">
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="250dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/jiancan" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="简餐"
android:textColor="#FFBF00"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/jiancan" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="简餐"
android:textColor="#FFBF00"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/jiancan" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="简餐"
android:textColor="#FFBF00"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/jiancan" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="简餐"
android:textColor="#FFBF00"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="330dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/jiancan" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="简餐"
android:textColor="#FFBF00"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/jiancan" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="简餐"
android:textColor="#FFBF00"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/jiancan" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="简餐"
android:textColor="#FFBF00"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/jiancan" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="简餐"
android:textColor="#FFBF00"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="400dp"
android:text="美食榜单"
android:textColor="#FB8612"
android:textStyle="bold"
android:textSize="25sp"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginRight="20dp"
android:src="@drawable/gd2" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#F1EE8D"
android:layout_marginTop="450dp">
<ListView
android:id="@+id/homelistview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#F1EE8D"
android:padding="8dp"/>
</RelativeLayout>
</FrameLayout>
</FrameLayout>
</LinearLayout>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".personFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="30sp"
android:text="个人中心"
android:layout_marginTop="50dp"/>
</FrameLayout>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".shopFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="30sp"
android:text="订单"
android:layout_marginTop="50dp"/>
</FrameLayout>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal">
<ImageView
android:id="@+id/imageview"
android:layout_width="300dp"
android:layout_height="250dp"
android:layout_margin="8dp"/>
</LinearLayout>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/name"
android:paddingLeft="10dp"
android:layout_width="100dp"
android:layout_height="50dp"
android:gravity="center_vertical"
android:text="水果"/>
</androidx.appcompat.widget.LinearLayoutCompat>

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp">
<ImageView
android:id="@+id/food_img"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/noodles"
android:scaleType="centerCrop"/>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_marginLeft="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/food_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="#333"
android:text="尝尝我们的招牌牛肉面,每一口都是对味蕾的极致诱惑!新鲜的牛肉片搭配着细腻的面条,汤汁鲜美浓郁,回味无穷。"/>
<TextView
android:id="@+id/food_details"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="12sp"
android:text="口味:酸辣。产地:湖南"/>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="80px"
android:layout_height="80px"
android:layout_marginTop="16dp"
android:src="@drawable/money2"/>
<TextView
android:id="@+id/food_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:layout_marginTop="16dp"
android:text="19"
android:textStyle="bold"
android:textColor="#D3277C"/>
<TextView
android:id="@+id/food_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:layout_marginTop="16dp"
android:text="元/1斤"
android:textStyle="bold"
android:textColor="#D3277C"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/navigation_home"
android:icon="@drawable/home"
android:title="首页" />
<item
android:id="@+id/navigation_dashboard"
android:icon="@drawable/food"
android:title="分类" />
<item
android:id="@+id/navigation_notifications"
android:icon="@drawable/shopping"
android:title="购物车" />
<item
android:id="@+id/navigation_blank"
android:icon="@drawable/person"
android:title="我的" />
</menu>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save