diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/.gitignore b/DeliciousFoodApp——蒋迎晨第四次实验代码/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/.gitignore b/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/compiler.xml b/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/deploymentTargetDropDown.xml b/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..8d77edc --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/gradle.xml b/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/gradle.xml new file mode 100644 index 0000000..0897082 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/migrations.xml b/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/misc.xml b/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/misc.xml new file mode 100644 index 0000000..533ff6a --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/.idea/misc.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/.gitignore b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/build.gradle.kts b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/build.gradle.kts new file mode 100644 index 0000000..e131386 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/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/DeliciousFoodApp——蒋迎晨第四次实验代码/app/proguard-rules.pro b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/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/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/androidTest/java/com/example/deliciousfoodapp/ExampleInstrumentedTest.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/androidTest/java/com/example/deliciousfoodapp/ExampleInstrumentedTest.java new file mode 100644 index 0000000..bbb5b6a --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/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/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/AndroidManifest.xml b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..e8f5dc2 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/AndroidManifest.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/IndexActivity.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/IndexActivity.java new file mode 100644 index 0000000..7c6b6d9 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/IndexActivity.java @@ -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(); + } +} \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/LoginActivity.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/LoginActivity.java new file mode 100644 index 0000000..dc910a9 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/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.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); + } + }); + } +} \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/MainActivity.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/MainActivity.java new file mode 100644 index 0000000..22e6daf --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/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/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/MyAdapter.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/MyAdapter.java new file mode 100644 index 0000000..19d46d2 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/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/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/NewAdapter.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/NewAdapter.java new file mode 100644 index 0000000..0534db7 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/NewAdapter.java @@ -0,0 +1,62 @@ +package com.example.deliciousfoodapp; + +import android.content.Context; +import android.text.Layout; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import com.example.deliciousfoodapp.R; + +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/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/RegisterActivity.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/RegisterActivity.java new file mode 100644 index 0000000..6ee2d42 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/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/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/RegisterinformationActivity.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/RegisterinformationActivity.java new file mode 100644 index 0000000..a822a7a --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/RegisterinformationActivity.java @@ -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(); + } + }); + } +} \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/adapter/LeftListAdapter.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/adapter/LeftListAdapter.java new file mode 100644 index 0000000..d668c58 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/adapter/LeftListAdapter.java @@ -0,0 +1,84 @@ +package com.example.deliciousfoodapp.adapter; + +import android.annotation.SuppressLint; +import android.view.LayoutInflater; +import android.os.Bundle; +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; + + public LeftListAdapter(List dataList) { + this.dataList = dataList; + } + + @NonNull + @Override + public MyHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.left_list_item,null); + return new MyHolder(view); + } + + @Override + @SuppressLint("RecyclerView") + public void onBindViewHolder(@NonNull MyHolder holder, int position) { + //绑定数据 + String name = dataList.get(position); + holder.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_select_bg); + }else { + holder.itemView.setBackgroundResource(R.drawable.type_no_select_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 setLeftListOnClickItemListener(LeftListOnClickItemListener leftListOnClickItemListener){ + mLeftListOnClickItemListener = leftListOnClickItemListener; + } + public interface LeftListOnClickItemListener{ + void onItemClick(int position); + } + + public void setCurrentIndex(int position){ + this.currentIndex = position; + notifyDataSetChanged(); + } +} diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/adapter/RightListAdapter.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/adapter/RightListAdapter.java new file mode 100644 index 0000000..0fe6468 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/adapter/RightListAdapter.java @@ -0,0 +1,65 @@ +package com.example.deliciousfoodapp.adapter; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.example.deliciousfoodapp.R; +import com.example.deliciousfoodapp.entity.Product; + +import java.util.ArrayList; +import java.util.List; + +public class RightListAdapter extends RecyclerView.Adapter { + + private List mProducts = new ArrayList<>(); + public void setListData(List list){ + this.mProducts = list; + notifyDataSetChanged(); + } + @NonNull + @Override + public MyHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + + //加载布局 + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.right_list_item,null); + return new MyHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull MyHolder holder, int position) { + //绑定数据 + Product product = mProducts.get(position); + holder.product_img.setImageResource(product.getProduct_img()); + holder.product_title.setText(product.getProduct_title()); + holder.product_price.setText(product.getProduct_price()); + holder.product_shop.setText(product.getProduct_shop()); + holder.product_produce.setText(product.getProduct_produce()); + } + + @Override + public int getItemCount() { + return mProducts.size(); + } + + static class MyHolder extends RecyclerView.ViewHolder{ + ImageView product_img; + TextView product_title; + TextView product_price; + TextView product_shop; + TextView product_produce; + public MyHolder(@NonNull View itemView) { + super(itemView); + product_img = itemView.findViewById(R.id.product_img); + product_title = itemView.findViewById(R.id.product_title); + product_price = itemView.findViewById(R.id.product_price); + product_shop = itemView.findViewById(R.id.product_shop); + product_produce = itemView.findViewById(R.id.product_produce); + } + } +} diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/entity/DataService.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/entity/DataService.java new file mode 100644 index 0000000..1703746 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/entity/DataService.java @@ -0,0 +1,167 @@ +package com.example.deliciousfoodapp.entity; + +import com.example.deliciousfoodapp.R; + +import java.util.ArrayList; +import java.util.List; + +public class DataService { + /** + * 模拟提供数据 + */ + public static List getListData(int position) { + List list = new ArrayList<>(); + if (position == 0) { + list.add(new Product(0, R.drawable.food1, "土豆炖牛肉", + "月4000+ 人均 ¥45", "店铺:小碗菜", + "食品介绍:土豆炖牛肉的汤汁经过长时间的炖煮,充分融合了牛肉和土豆的鲜美,口感浓郁,喝上一口满满的幸福感。")); + list.add(new Product(1, R.drawable.food2, "糖醋里脊", + "月售6000+ 人均 ¥26", "店铺:饭满鲜", + "食品介绍:选用新西兰猪肋条肉为原料,辅以绍兴香醋、东海盐等佐料,采用传统与现代相结合的制作方法,成品色泽红润明亮,外表柔软滑润,酱汁酸甜可口,夹心香脆可口。")); + list.add(new Product(2, R.drawable.food3, "酸菜鱼", + "月售1000+ 人均 ¥35", "店铺:花园食府", + "食品介绍:酸菜鱼,酸爽可口,鱼肉紧而嫩;水煮鱼,汤白如玉,辣中有香,香里带甜,真乃人间美味。")); + list.add(new Product(3, R.drawable.food4, "宫保鸡丁", + "月售1000+ 人均 ¥46", "店铺:百味餐厅", + "食品介绍:口感丰富多样,层次分明。鸡肉的嫩滑与花生米的脆香交织在一起,给人带来丰富的口感体验。在咀嚼过程中,辣椒的辣味逐渐释放出来,让人感受到满口的麻辣与香醇。")); + list.add(new Product(4, R.drawable.food5, "擂椒拌饭", + "月售1000+ 人均 ¥64", "店铺:西苑餐厅", + "食品介绍:它鲜嫩多汁,酸辣开胃,方便快捷,让人闻着味道就会忍不住流下口水,尝上一口就会忍不住吃完一整碗。")); + list.add(new Product(5, R.drawable.food6, "蜜汁鸡腿肉轻食健康餐", + "月售1000+ 人均 ¥37", "店铺:和味餐厅", + "食品介绍:蜜汁鸡腿肉,肉质鲜嫩,口感十分的好。非常健康、低脂,很适合减肥的人。")); + list.add(new Product(6, R.drawable.food7, "招牌牛肉鸡胸双拼沙拉", + "月售1000+ 人均 ¥29", "店铺:福华餐厅", + "食品介绍:味道很好,食材新鲜,玉米南瓜花菜都很甜,肉也不错,糙米很香,有八宝粥那味,真不错。非常健康、低脂,很适合减肥的人。")); + list.add(new Product(7, R.drawable.food8, "肉沫茄子盖饭", + "月售1000+ 人均 ¥36", "店铺:聚仙楼饭庄", + "食品介绍:软糯入味的茄子拌上米饭,酱汁浓郁,一次一大碗都不够,真是好吃到舔碗底!")); + } else if (position == 1) { + list.add(new Product(8, R.drawable.food9, "烤串", + "月售1000+ 人均 ¥57", "店铺:嗨撸", + "食品介绍:肉质鲜嫩,口感极佳。 食用后满口余香,令人回味无穷。")); + list.add(new Product(9, R.drawable.food10, "烤羊肉", + "月售1000+ 人均 ¥54", "店铺:碳夫", + "食品介绍:烤制技巧精湛,烤出的肉色香味俱佳,每一口都充满了丰富的口感和幸福感。")); + list.add(new Product(10, R.drawable.food9, "烤串", + "月售1000+ 人均 ¥46", "店铺:火遍天", + "食品介绍:肉质鲜嫩,口感极佳。 食用后满口余香,令人回味无穷。")); + list.add(new Product(11, R.drawable.food10, "烤羊肉", + "月售1000+ 人均 ¥53", "店铺:炉宗师", + "食品介绍:烤制技巧精湛,烤出的肉色香味俱,每一口都充满了丰富的口感和幸福感。")); + list.add(new Product(12, R.drawable.food9, "烤串", + "月售1000+ 人均 ¥35", "店铺:海味轩", + "食品介绍:肉质鲜嫩,口感极佳。 食用后满口余香,令人回味无穷。")); + list.add(new Product(13, R.drawable.food10, "烤羊肉", + "月售1000+ 人均 ¥48", "店铺:虾滋味", + "食品介绍:烤制技巧精湛,烤出的肉色香味俱,每一口都充满了丰富的口感和幸福感。")); + list.add(new Product(14, R.drawable.food9, "烤串", + "月售1000+ 人均 ¥37", "店铺:极之宴", + "食品介绍:肉质鲜嫩,口感极佳。 食用后满口余香,令人回味无穷。")); + list.add(new Product(15, R.drawable.food10, "烤羊肉", + "月售1000+ 人均 ¥56", "店铺:整两串", + "食品介绍:烤制技巧精湛,烤出的肉色香味俱,每一口都充满了丰富的口感和幸福感。")); + } else if (position == 2) { + list.add(new Product(16, R.drawable.food11, "卤鸭脖", + "月售1000+ 人均 ¥48", "店铺:卤满满", + "食品介绍:卤鸭脖口感恰到好处,辣味十足,让人回味无穷。")); + list.add(new Product(17, R.drawable.food12, "卤鸡爪", + "月售1000+ 人均 ¥54", "店铺:御满香", + "食品介绍:卤鸡爪口感软糯,香味通透,入口即化,带有蒜的香味和微甜的口感,让人回味无穷。")); + list.add(new Product(18, R.drawable.food11, "卤鸭脖", + "月售1000+ 人均 ¥36", "店铺:卤满满", + "食品介绍:卤鸭脖口感恰到好处,辣味十足,让人回味无穷。")); + list.add(new Product(19, R.drawable.food12, "卤鸡爪", + "月售1000+ 人均 ¥78", "店铺:御满香", + "食品介绍:卤鸡爪口感软糯,香味通透,入口即化,带有蒜的香味和微甜的口感,让人回味无穷。")); + list.add(new Product(20, R.drawable.food11, "卤鸭脖", + "月售1000+ 人均 ¥39", "店铺:卤满满", + "食品介绍:卤鸭脖口感恰到好处,辣味十足,让人回味无穷。")); + list.add(new Product(21, R.drawable.food12, "卤鸡爪", + "月售1000+ 人均 ¥36", "店铺:御满香", + "食品介绍:卤鸡爪口感软糯,香味通透,入口即化,带有蒜的香味和微甜的口感,让人回味无穷。")); + list.add(new Product(22, R.drawable.food11, "卤鸭脖", + "月售1000+ 人均 ¥65", "店铺:卤满满", + "食品介绍:卤鸭脖口感恰到好处,辣味十足,让人回味无穷。")); + list.add(new Product(23, R.drawable.food12, "卤鸡爪", + "月售1000+ 人均 ¥63", "店铺:御满香", + "食品介绍:卤鸡爪口感软糯,香味通透,入口即化,带有蒜的香味和微甜的口感,让人回味无穷。")); + } else if (position == 3) { + list.add(new Product(24, R.drawable.food13, "西红柿鸡蛋面", + "月售1000+ 人均 ¥47", "店铺:一面之缘", + "食品介绍:西红柿鸡蛋面不仅口感美味,而且营养丰富。西红柿含有丰富的胡萝卜素、维生素C和B族维生素,以及番茄红素,有助于抗衰老和预防心血管疾病。")); + list.add(new Product(25, R.drawable.food14, "西安臊子面", + "月售1000+ 人均 ¥38", "店铺:尚面膳食", + "食品介绍:是陕西地区的特色风味小吃,以其独特的口感和丰富的文化内涵而闻名。它是一种细长匀称的面条,通常薄筋光且透亮,味道以酸辣为主。")); + list.add(new Product(26, R.drawable.food13, "西红柿鸡蛋面", + "月售1000+ 人均 ¥29", "店铺:一面之缘", + "食品介绍:西红柿鸡蛋面不仅口感美味,而且营养丰富。西红柿含有丰富的胡萝卜素、维生素C和B族维生素,以及番茄红素,有助于抗衰老和预防心血管疾病。")); + list.add(new Product(27, R.drawable.food14, "西安臊子面", + "月售1000+ 人均 ¥26", "店铺:尚面膳食", + "食品介绍:是陕西地区的特色风味小吃,以其独特的口感和丰富的文化内涵而闻名。它是一种细长匀称的面条,通常薄筋光且透亮,味道以酸辣为主。")); + list.add(new Product(28, R.drawable.food13, "西红柿鸡蛋面", + "月售1000+ 人均 ¥54", "店铺:一面之缘", + "食品介绍:西红柿鸡蛋面不仅口感美味,而且营养丰富。西红柿含有丰富的胡萝卜素、维生素C和B族维生素,以及番茄红素,有助于抗衰老和预防心血管疾病。")); + list.add(new Product(29, R.drawable.food14, "西安臊子面", + "月售1000+ 人均 ¥43", "店铺:尚面膳食", + "食品介绍:是陕西地区的特色风味小吃,以其独特的口感和丰富的文化内涵而闻名。它是一种细长匀称的面条,通常薄筋光且透亮,味道以酸辣为主。")); + list.add(new Product(30, R.drawable.food13, "西红柿鸡蛋面", + "月售1000+ 人均 ¥42", "店铺:一面之缘", + "食品介绍:西红柿鸡蛋面不仅口感美味,而且营养丰富。西红柿含有丰富的胡萝卜素、维生素C和B族维生素,以及番茄红素,有助于抗衰老和预防心血管疾病。")); + list.add(new Product(31, R.drawable.food14, "西安臊子面", + "月售1000+ 人均 ¥31", "店铺:尚面膳食", + "食品介绍:是陕西地区的特色风味小吃,以其独特的口感和丰富的文化内涵而闻名。它是一种细长匀称的面条,通常薄筋光且透亮,味道以酸辣为主。")); + } else if (position == 4) { + list.add(new Product(32, R.drawable.food15, "蛋挞", + "月售1000+ 人均 ¥41", "店铺:壹甜半品", + "食品介绍:蛋挞皮口感细腻,入口有淡淡的蛋香味,外面包裹一圈白色芝士,中间夹着奶黄馅料,轻轻一咬,酥脆的底层便露出来。")); + list.add(new Product(33, R.drawable.food16, "草莓千层蛋糕", + "月售1000+ 人均 ¥24", "店铺:甜小白", + "食品介绍:草莓千层口感太棒了,奶香和草莓的酸甜融合的太完美啦‼而且不是那种很甜腻的甜品。")); + list.add(new Product(34, R.drawable.food15, "蛋挞", + "月售1000+ 人均 ¥48", "店铺:壹甜半品", + "食品介绍:蛋挞皮口感细腻,入口有淡淡的蛋香味,外面包裹一圈白色芝士,中间夹着奶黄馅料,轻轻一咬,酥脆的底层便露出来。")); + list.add(new Product(35, R.drawable.food16, "草莓千层蛋糕", + "月售1000+ 人均 ¥39", "店铺:甜小白", + "食品介绍:草莓千层口感太棒了,奶香和草莓的酸甜融合的太完美啦‼而且不是那种很甜腻的甜品。便")); + list.add(new Product(36, R.drawable.food15, "蛋挞", + "月售1000+ 人均 ¥39", "店铺:壹甜半品", + "食品介绍:蛋挞皮口感细腻,入口有淡淡的蛋香味,外面包裹一圈白色芝士,中间夹着奶黄馅料,轻轻一咬,酥脆的底层便露出来。")); + list.add(new Product(37, R.drawable.food16, "草莓千层蛋糕", + "月售1000+ 人均 ¥84", "店铺:甜小白", + "食品介绍:草莓千层口感太棒了,奶香和草莓的酸甜融合的太完美啦‼而且不是那种很甜腻的甜品。便")); + list.add(new Product(38, R.drawable.food15, "蛋挞", + "月售1000+ 人均 ¥28", "店铺:壹甜半品", + "食品介绍:蛋挞皮口感细腻,入口有淡淡的蛋香味,外面包裹一圈白色芝士,中间夹着奶黄馅料,轻轻一咬,酥脆的底层便露出来。")); + list.add(new Product(39, R.drawable.food16, "草莓千层蛋糕", + "月售1000+ 人均 ¥38", "店铺:甜小白", + "食品介绍:草莓千层口感太棒了,奶香和草莓的酸甜融合的太完美啦‼而且不是那种很甜腻的甜品。")); + } else { + list.add(new Product(40, R.drawable.food17, "珍珠奶茶", + "月售1000+ 人均 ¥9", "店铺:果然奶茶店", + "食品介绍:珍珠奶茶的口感层次分明,既有珍珠的嚼劲,又有茶香的悠扬,还有牛奶的香甜,使得这款饮料如此令人沉醉。")); + list.add(new Product(41, R.drawable.food18, "柠檬水", + "月售1000+ 人均 ¥5", "店铺:奶香当铺", + "食品介绍:柠檬水的味道酸甜可口,给人一种清新的感觉。柠檬中所含的柠檬酸能够增加食欲,让人口水直流。无论是夏天炎热的时候,还是寒冷的冬天,一杯柠檬水都能够让人心旷神怡。")); + list.add(new Product(42, R.drawable.food17, "珍珠奶茶", + "月售1000+ 人均 ¥9", "店铺:果然奶茶店", + "食品介绍:珍珠奶茶的口感层次分明,既有珍珠的嚼劲,又有茶香的悠扬,还有牛奶的香甜,使得这款饮料如此令人沉醉。")); + list.add(new Product(43, R.drawable.food18, "柠檬水", + "月售1000+ 人均 ¥5", "店铺:奶香当铺", + "食品介绍:柠檬水的味道酸甜可口,给人一种清新的感觉。柠檬中所含的柠檬酸能够增加食欲,让人口水直流。无论是夏天炎热的时候,还是寒冷的冬天,一杯柠檬水都能够让人心旷神怡。")); + list.add(new Product(44, R.drawable.food17, "珍珠奶茶", + "月售1000+ 人均 ¥9", "店铺:果然奶茶店", + "食品介绍:珍珠奶茶的口感层次分明,既有珍珠的嚼劲,又有茶香的悠扬,还有牛奶的香甜,使得这款饮料如此令人沉醉。便")); + list.add(new Product(45, R.drawable.food18, "柠檬水", + "月售1000+ 人均 ¥5", "店铺:奶香当铺", + "食品介绍:柠檬水的味道酸甜可口,给人一种清新的感觉。柠檬中所含的柠檬酸能够增加食欲,让人口水直流。无论是夏天炎热的时候,还是寒冷的冬天,一杯柠檬水都能够让人心旷神怡。")); + list.add(new Product(46, R.drawable.food17, "珍珠奶茶", + "月售1000+ 人均 ¥9", "店铺:果然奶茶店店", + "食品介绍:珍珠奶茶的口感层次分明,既有珍珠的嚼劲,又有茶香的悠扬,还有牛奶的香甜,使得这款饮料如此令人沉醉。")); + list.add(new Product(47, R.drawable.food18, "柠檬水", + "月售1000+ 人均 ¥5", "店铺:奶香当铺", + "食品介绍:柠檬水的味道酸甜可口,给人一种清新的感觉。柠檬中所含的柠檬酸能够增加食欲,让人口水直流。无论是夏天炎热的时候,还是寒冷的冬天,一杯柠檬水都能够让人心旷神怡。")); + } + return list; + } + } diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/entity/Product.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/entity/Product.java new file mode 100644 index 0000000..9021524 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/entity/Product.java @@ -0,0 +1,67 @@ +package com.example.deliciousfoodapp.entity; + +public class Product { + private int product_id; + private int product_img; + private String product_title; + private String product_price; + private String product_shop; + private String product_produce; + + + public Product(int productID, int productImg, String productTitle, String productPrice, String productShop, String productProduce) { + product_id = productID; + product_img = productImg; + product_title = productTitle; + product_price = productPrice; + product_shop = productShop; + product_produce = productProduce; + } + + public int getProduct_id(){ + return product_id; + } + + public void setProduct_id(int product_id) { + this.product_id = product_id; + } + + public int getProduct_img() { + return product_img; + } + + public void setProduct_img(int product_img) { + this.product_img = product_img; + } + public String getProduct_title() { + return product_title; + } + + public void setProduct_title(String product_title) { + this.product_title = product_title; + } + + public String getProduct_price() { + return product_price; + } + + public void setProduct_price(String product_price) { + this.product_price = product_price; + } + + public String getProduct_shop() { + return product_shop; + } + + public void setProduct_shop(String product_shop) { + this.product_shop = product_shop; + } + + public String getProduct_produce() { + return product_produce; + } + + public void setProduct_produce(String product_produce) { + this.product_produce = product_produce; + } +} diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/foodFragment.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/foodFragment.java new file mode 100644 index 0000000..8eb334e --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/foodFragment.java @@ -0,0 +1,77 @@ +package com.example.deliciousfoodapp; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; + +import com.example.deliciousfoodapp.adapter.LeftListAdapter; +import com.example.deliciousfoodapp.adapter.RightListAdapter; +import com.example.deliciousfoodapp.entity.DataService; + +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 RightListAdapter mRightListAdapter; + private List leftDataList = new ArrayList<>(); + + public foodFragment() { + + } + + @Override + public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle saveInstanceState){ + rootView = inflater.inflate(R.layout.fragment_food,container,false); + //初始化控件 + LeftRecyclerView=rootView.findViewById(R.id.leftlist); + RightRecyclerView=rootView.findViewById(R.id.rightlist); + + return rootView; + } + + @Override + public void onActivityCreated(@NonNull Bundle saveInstanceState) { + super.onActivityCreated(saveInstanceState); + + leftDataList.add("简餐"); + leftDataList.add("烧烤"); + leftDataList.add("卤味"); + leftDataList.add("面条"); + leftDataList.add("甜品"); + leftDataList.add("奶茶饮料"); + + mLeftListAdapter = new LeftListAdapter(leftDataList); + LeftRecyclerView.setAdapter(mLeftListAdapter); + + mRightListAdapter = new RightListAdapter(); + RightRecyclerView.setAdapter(mRightListAdapter); + + //默认加载食品数据 + mRightListAdapter.setListData(DataService.getListData(0)); + + //recyclerView点击事件 + mLeftListAdapter.setLeftListOnClickItemListener(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/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/homeFragment.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/homeFragment.java new file mode 100644 index 0000000..39f3adb --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/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/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/personFragment.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/personFragment.java new file mode 100644 index 0000000..bf28900 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/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/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/shopFragment.java b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/shopFragment.java new file mode 100644 index 0000000..daefdd0 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/java/com/example/deliciousfoodapp/shopFragment.java @@ -0,0 +1,25 @@ +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/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/bg.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/bg.jpg new file mode 100644 index 0000000..41df2a3 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/bg.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/bg2.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/bg2.jpg new file mode 100644 index 0000000..1c744ff Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/bg2.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/edittext_border.xml b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/edittext_border.xml new file mode 100644 index 0000000..1631c3d --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/edittext_border.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/five.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/five.jpg new file mode 100644 index 0000000..0524eb3 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/five.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food.png new file mode 100644 index 0000000..07026cd Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food1.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food1.png new file mode 100644 index 0000000..54323bf Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food1.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food10.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food10.png new file mode 100644 index 0000000..d30e6fd Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food10.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food11.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food11.png new file mode 100644 index 0000000..1ad9b1f Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food11.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food12.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food12.png new file mode 100644 index 0000000..6a4b487 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food12.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food13.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food13.png new file mode 100644 index 0000000..3b96efb Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food13.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food14.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food14.png new file mode 100644 index 0000000..3091dcb Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food14.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food15.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food15.png new file mode 100644 index 0000000..04e2cfd Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food15.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food16.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food16.png new file mode 100644 index 0000000..28f2588 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food16.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food17.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food17.png new file mode 100644 index 0000000..7d57eb1 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food17.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food18.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food18.png new file mode 100644 index 0000000..6e43b7a Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food18.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food2.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food2.png new file mode 100644 index 0000000..103f781 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food2.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food3.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food3.png new file mode 100644 index 0000000..662c2b8 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food3.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food4.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food4.png new file mode 100644 index 0000000..f754a35 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food4.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food5.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food5.png new file mode 100644 index 0000000..40d4cc3 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food5.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food6.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food6.png new file mode 100644 index 0000000..662dc22 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food6.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food7.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food7.png new file mode 100644 index 0000000..e813e2f Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food7.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food8.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food8.png new file mode 100644 index 0000000..3638d4b Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food8.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food9.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food9.png new file mode 100644 index 0000000..cdbd98a Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/food9.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/four.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/four.jpg new file mode 100644 index 0000000..00f77f4 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/four.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/gd1.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/gd1.png new file mode 100644 index 0000000..8086548 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/gd1.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/gd2.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/gd2.png new file mode 100644 index 0000000..3db29d7 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/gd2.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/home.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/home.png new file mode 100644 index 0000000..afd6af2 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/home.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/ic_launcher_background.xml b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/ic_launcher_foreground.xml b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/icecream.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/icecream.jpg new file mode 100644 index 0000000..480213f Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/icecream.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/information.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/information.jpg new file mode 100644 index 0000000..a4c2d58 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/information.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/jiancan.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/jiancan.png new file mode 100644 index 0000000..509bd68 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/jiancan.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/mango.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/mango.jpg new file mode 100644 index 0000000..23fe438 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/mango.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/mb.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/mb.png new file mode 100644 index 0000000..aa8a425 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/mb.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/meishi.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/meishi.jpg new file mode 100644 index 0000000..72ce8c5 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/meishi.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/mlt.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/mlt.png new file mode 100644 index 0000000..150b57b Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/mlt.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/more.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/more.png new file mode 100644 index 0000000..c68b765 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/more.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/ms.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/ms.png new file mode 100644 index 0000000..7125d11 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/ms.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/noodles.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/noodles.jpg new file mode 100644 index 0000000..bc28d95 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/noodles.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/one.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/one.jpg new file mode 100644 index 0000000..4e2ab58 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/one.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/password.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/password.png new file mode 100644 index 0000000..ab143ef Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/password.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/person.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/person.png new file mode 100644 index 0000000..782c6b9 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/person.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/pj.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/pj.png new file mode 100644 index 0000000..0457862 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/pj.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/qq.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/qq.jpg new file mode 100644 index 0000000..7d43729 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/qq.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/register.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/register.jpg new file mode 100644 index 0000000..9c1808e Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/register.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/rl.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/rl.png new file mode 100644 index 0000000..5c6da04 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/rl.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/seven.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/seven.jpg new file mode 100644 index 0000000..1f55564 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/seven.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/shopping.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/shopping.png new file mode 100644 index 0000000..ad037aa Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/shopping.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/six.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/six.jpg new file mode 100644 index 0000000..c922835 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/six.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/sk.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/sk.png new file mode 100644 index 0000000..8dc68dd Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/sk.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/td.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/td.png new file mode 100644 index 0000000..b66f984 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/td.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/three.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/three.jpg new file mode 100644 index 0000000..66783b0 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/three.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/title.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/title.jpg new file mode 100644 index 0000000..d2a9fb5 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/title.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/two.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/two.jpg new file mode 100644 index 0000000..5bcc909 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/two.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/type_no_select_bg.xml b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/type_no_select_bg.xml new file mode 100644 index 0000000..4ac827c --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/type_no_select_bg.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/type_select_bg.xml b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/type_select_bg.xml new file mode 100644 index 0000000..3e085a4 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/type_select_bg.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/user.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/user.png new file mode 100644 index 0000000..b1b6038 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/user.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/weibo.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/weibo.jpg new file mode 100644 index 0000000..48ed66b Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/weibo.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/weichat.jpg b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/weichat.jpg new file mode 100644 index 0000000..9e7948d Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/weichat.jpg differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/xx.png b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/xx.png new file mode 100644 index 0000000..5f4d7d0 Binary files /dev/null and b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/drawable/xx.png differ diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/layout/activity_index.xml b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/layout/activity_index.xml new file mode 100644 index 0000000..5509091 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/layout/activity_index.xml @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/layout/activity_login.xml b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/layout/activity_login.xml new file mode 100644 index 0000000..3bccdf1 --- /dev/null +++ b/DeliciousFoodApp——蒋迎晨第四次实验代码/app/src/main/res/layout/activity_login.xml @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +