From 02cd93fa87ba131f77bf59d1a178ef63ac932965 Mon Sep 17 00:00:00 2001 From: manxyr <2122053938@qq.com> Date: Sun, 26 May 2024 21:30:46 +0800 Subject: [PATCH] =?UTF-8?q?app=E6=95=B4=E4=BD=93=E5=B8=83=E5=B1=80?= =?UTF-8?q?=EF=BC=8C=E9=A6=96=E9=A1=B5=E5=8F=8A=E5=85=B6=E4=BB=96Fragmnet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../c202201020207/CommunityFragment.java | 64 +++++++++++++++++++ .../c202201020207/ConsultationFragment.java | 64 +++++++++++++++++++ .../hnucm/c202201020207/HomePageActivity.java | 14 ++++ .../hnucm/c202201020207/HomePageFragment.java | 64 +++++++++++++++++++ .../com/hnucm/c202201020207/MallFragment.java | 64 +++++++++++++++++++ .../com/hnucm/c202201020207/MyFragment.java | 64 +++++++++++++++++++ .../src/main/res/drawable/bg_searchview.xml | 4 ++ .../main/res/layout/activity_home_page.xml | 9 +++ .../main/res/layout/fragment_community.xml | 14 ++++ .../main/res/layout/fragment_consultation.xml | 14 ++++ .../main/res/layout/fragment_home_page.xml | 14 ++++ .../app/src/main/res/layout/fragment_mall.xml | 14 ++++ .../app/src/main/res/layout/fragment_my.xml | 14 ++++ 13 files changed, 417 insertions(+) create mode 100644 Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/CommunityFragment.java create mode 100644 Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/ConsultationFragment.java create mode 100644 Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/HomePageActivity.java create mode 100644 Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/HomePageFragment.java create mode 100644 Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/MallFragment.java create mode 100644 Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/MyFragment.java create mode 100644 Coffee_MIni_Program/app/src/main/res/drawable/bg_searchview.xml create mode 100644 Coffee_MIni_Program/app/src/main/res/layout/activity_home_page.xml create mode 100644 Coffee_MIni_Program/app/src/main/res/layout/fragment_community.xml create mode 100644 Coffee_MIni_Program/app/src/main/res/layout/fragment_consultation.xml create mode 100644 Coffee_MIni_Program/app/src/main/res/layout/fragment_home_page.xml create mode 100644 Coffee_MIni_Program/app/src/main/res/layout/fragment_mall.xml create mode 100644 Coffee_MIni_Program/app/src/main/res/layout/fragment_my.xml diff --git a/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/CommunityFragment.java b/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/CommunityFragment.java new file mode 100644 index 0000000..771fa70 --- /dev/null +++ b/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/CommunityFragment.java @@ -0,0 +1,64 @@ +package com.hnucm.c202201020207; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +/** + * A simple {@link Fragment} subclass. + * Use the {@link CommunityFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class CommunityFragment extends Fragment { + + // TODO: Rename parameter arguments, choose names that match + // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER + private static final String ARG_PARAM1 = "param1"; + private static final String ARG_PARAM2 = "param2"; + + // TODO: Rename and change types of parameters + private String mParam1; + private String mParam2; + + public CommunityFragment() { + // Required empty public constructor + } + + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment CommunityFragment. + */ + // TODO: Rename and change types and number of parameters + public static CommunityFragment newInstance(String param1, String param2) { + CommunityFragment fragment = new CommunityFragment(); + Bundle args = new Bundle(); + args.putString(ARG_PARAM1, param1); + args.putString(ARG_PARAM2, param2); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_community, container, false); + } +} \ No newline at end of file diff --git a/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/ConsultationFragment.java b/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/ConsultationFragment.java new file mode 100644 index 0000000..ba753ec --- /dev/null +++ b/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/ConsultationFragment.java @@ -0,0 +1,64 @@ +package com.hnucm.c202201020207; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +/** + * A simple {@link Fragment} subclass. + * Use the {@link ConsultationFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class ConsultationFragment extends Fragment { + + // TODO: Rename parameter arguments, choose names that match + // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER + private static final String ARG_PARAM1 = "param1"; + private static final String ARG_PARAM2 = "param2"; + + // TODO: Rename and change types of parameters + private String mParam1; + private String mParam2; + + public ConsultationFragment() { + // Required empty public constructor + } + + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment ConsultationFragment. + */ + // TODO: Rename and change types and number of parameters + public static ConsultationFragment newInstance(String param1, String param2) { + ConsultationFragment fragment = new ConsultationFragment(); + Bundle args = new Bundle(); + args.putString(ARG_PARAM1, param1); + args.putString(ARG_PARAM2, param2); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_consultation, container, false); + } +} \ No newline at end of file diff --git a/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/HomePageActivity.java b/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/HomePageActivity.java new file mode 100644 index 0000000..1ee5e2c --- /dev/null +++ b/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/HomePageActivity.java @@ -0,0 +1,14 @@ +package com.hnucm.c202201020207; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; + +public class HomePageActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_home_page); + } +} \ No newline at end of file diff --git a/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/HomePageFragment.java b/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/HomePageFragment.java new file mode 100644 index 0000000..98c063c --- /dev/null +++ b/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/HomePageFragment.java @@ -0,0 +1,64 @@ +package com.hnucm.c202201020207; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +/** + * A simple {@link Fragment} subclass. + * Use the {@link HomePageFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class HomePageFragment extends Fragment { + + // TODO: Rename parameter arguments, choose names that match + // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER + private static final String ARG_PARAM1 = "param1"; + private static final String ARG_PARAM2 = "param2"; + + // TODO: Rename and change types of parameters + private String mParam1; + private String mParam2; + + public HomePageFragment() { + // Required empty public constructor + } + + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment HomePageFragment. + */ + // TODO: Rename and change types and number of parameters + public static HomePageFragment newInstance(String param1, String param2) { + HomePageFragment fragment = new HomePageFragment(); + Bundle args = new Bundle(); + args.putString(ARG_PARAM1, param1); + args.putString(ARG_PARAM2, param2); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_home_page, container, false); + } +} \ No newline at end of file diff --git a/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/MallFragment.java b/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/MallFragment.java new file mode 100644 index 0000000..def510e --- /dev/null +++ b/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/MallFragment.java @@ -0,0 +1,64 @@ +package com.hnucm.c202201020207; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +/** + * A simple {@link Fragment} subclass. + * Use the {@link MallFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class MallFragment extends Fragment { + + // TODO: Rename parameter arguments, choose names that match + // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER + private static final String ARG_PARAM1 = "param1"; + private static final String ARG_PARAM2 = "param2"; + + // TODO: Rename and change types of parameters + private String mParam1; + private String mParam2; + + public MallFragment() { + // Required empty public constructor + } + + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment MallFragment. + */ + // TODO: Rename and change types and number of parameters + public static MallFragment newInstance(String param1, String param2) { + MallFragment fragment = new MallFragment(); + Bundle args = new Bundle(); + args.putString(ARG_PARAM1, param1); + args.putString(ARG_PARAM2, param2); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_mall, container, false); + } +} \ No newline at end of file diff --git a/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/MyFragment.java b/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/MyFragment.java new file mode 100644 index 0000000..974b0aa --- /dev/null +++ b/Coffee_MIni_Program/app/src/main/java/com/hnucm/c202201020207/MyFragment.java @@ -0,0 +1,64 @@ +package com.hnucm.c202201020207; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +/** + * A simple {@link Fragment} subclass. + * Use the {@link MyFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class MyFragment extends Fragment { + + // TODO: Rename parameter arguments, choose names that match + // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER + private static final String ARG_PARAM1 = "param1"; + private static final String ARG_PARAM2 = "param2"; + + // TODO: Rename and change types of parameters + private String mParam1; + private String mParam2; + + public MyFragment() { + // Required empty public constructor + } + + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment MyFragment. + */ + // TODO: Rename and change types and number of parameters + public static MyFragment newInstance(String param1, String param2) { + MyFragment fragment = new MyFragment(); + Bundle args = new Bundle(); + args.putString(ARG_PARAM1, param1); + args.putString(ARG_PARAM2, param2); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_my, container, false); + } +} \ No newline at end of file diff --git a/Coffee_MIni_Program/app/src/main/res/drawable/bg_searchview.xml b/Coffee_MIni_Program/app/src/main/res/drawable/bg_searchview.xml new file mode 100644 index 0000000..e5d6be9 --- /dev/null +++ b/Coffee_MIni_Program/app/src/main/res/drawable/bg_searchview.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Coffee_MIni_Program/app/src/main/res/layout/activity_home_page.xml b/Coffee_MIni_Program/app/src/main/res/layout/activity_home_page.xml new file mode 100644 index 0000000..c24e6b8 --- /dev/null +++ b/Coffee_MIni_Program/app/src/main/res/layout/activity_home_page.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/Coffee_MIni_Program/app/src/main/res/layout/fragment_community.xml b/Coffee_MIni_Program/app/src/main/res/layout/fragment_community.xml new file mode 100644 index 0000000..fa00226 --- /dev/null +++ b/Coffee_MIni_Program/app/src/main/res/layout/fragment_community.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/Coffee_MIni_Program/app/src/main/res/layout/fragment_consultation.xml b/Coffee_MIni_Program/app/src/main/res/layout/fragment_consultation.xml new file mode 100644 index 0000000..afac697 --- /dev/null +++ b/Coffee_MIni_Program/app/src/main/res/layout/fragment_consultation.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/Coffee_MIni_Program/app/src/main/res/layout/fragment_home_page.xml b/Coffee_MIni_Program/app/src/main/res/layout/fragment_home_page.xml new file mode 100644 index 0000000..9d46699 --- /dev/null +++ b/Coffee_MIni_Program/app/src/main/res/layout/fragment_home_page.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/Coffee_MIni_Program/app/src/main/res/layout/fragment_mall.xml b/Coffee_MIni_Program/app/src/main/res/layout/fragment_mall.xml new file mode 100644 index 0000000..6561239 --- /dev/null +++ b/Coffee_MIni_Program/app/src/main/res/layout/fragment_mall.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/Coffee_MIni_Program/app/src/main/res/layout/fragment_my.xml b/Coffee_MIni_Program/app/src/main/res/layout/fragment_my.xml new file mode 100644 index 0000000..63a2b71 --- /dev/null +++ b/Coffee_MIni_Program/app/src/main/res/layout/fragment_my.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file