diff --git a/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/HomePageFragment.java b/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/HomePageFragment.java index 02ccd20..9b7b1a5 100644 --- a/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/HomePageFragment.java +++ b/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/HomePageFragment.java @@ -8,17 +8,32 @@ import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.TextView; public class HomePageFragment extends Fragment { + PopularSciencePopularizationFragment popularSciencePopularizationFragment=new PopularSciencePopularizationFragment(); + PopularScienceArticleFragment popularScienceArticleFragment=new PopularScienceArticleFragment(); + PopularScienceVideoFragment popularScienceVideoFragment=new PopularScienceVideoFragment(); + PatientReplyFragment patientReplyFragment=new PatientReplyFragment(); @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view=inflater.inflate(R.layout.fragment_home_page, container, false); + TextView textView1=view.findViewById(R.id.textView6); + TextView textView2=view.findViewById(R.id.textView11); + TextView textView3=view.findViewById(R.id.textView12); + TextView textView4=view.findViewById(R.id.textView13); SearchView searchView=view.findViewById(R.id.searchView); searchView.setQueryHint("搜索关键词"); + + getChildFragmentManager().beginTransaction(). + add(R.id.ReplaceLayout,popularSciencePopularizationFragment).commit(); + + + return view; } } \ No newline at end of file diff --git a/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/PatientReplyFragment.java b/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/PatientReplyFragment.java new file mode 100644 index 0000000..fc7f079 --- /dev/null +++ b/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/PatientReplyFragment.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 PatientReplyFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class PatientReplyFragment 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 PatientReplyFragment() { + // 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 PatientReplyFragment. + */ + // TODO: Rename and change types and number of parameters + public static PatientReplyFragment newInstance(String param1, String param2) { + PatientReplyFragment fragment = new PatientReplyFragment(); + 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_patient_reply, container, false); + } +} \ No newline at end of file diff --git a/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/PopularScienceArticleFragment.java b/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/PopularScienceArticleFragment.java new file mode 100644 index 0000000..6218b8f --- /dev/null +++ b/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/PopularScienceArticleFragment.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 PopularScienceArticleFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class PopularScienceArticleFragment 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 PopularScienceArticleFragment() { + // 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 PopularScienceArticleFragment. + */ + // TODO: Rename and change types and number of parameters + public static PopularScienceArticleFragment newInstance(String param1, String param2) { + PopularScienceArticleFragment fragment = new PopularScienceArticleFragment(); + 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_popular_science_article, container, false); + } +} \ No newline at end of file diff --git a/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/PopularSciencePopularizationFragment.java b/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/PopularSciencePopularizationFragment.java new file mode 100644 index 0000000..ce85095 --- /dev/null +++ b/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/PopularSciencePopularizationFragment.java @@ -0,0 +1,21 @@ +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; + + +public class PopularSciencePopularizationFragment extends Fragment { + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View view=inflater.inflate(R.layout.fragment_popular_science_popularization, container, false); + + return view; + } +} \ No newline at end of file diff --git a/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/PopularScienceVideoFragment.java b/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/PopularScienceVideoFragment.java new file mode 100644 index 0000000..c5f3926 --- /dev/null +++ b/Diabetes_Health_Management/app/src/main/java/com/hnucm/c202201020207/PopularScienceVideoFragment.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 PopularScienceVideoFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class PopularScienceVideoFragment 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 PopularScienceVideoFragment() { + // 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 PopularScienceVideoFragment. + */ + // TODO: Rename and change types and number of parameters + public static PopularScienceVideoFragment newInstance(String param1, String param2) { + PopularScienceVideoFragment fragment = new PopularScienceVideoFragment(); + 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_popular_science_video, container, false); + } +} \ No newline at end of file diff --git a/Diabetes_Health_Management/app/src/main/res/layout/fragment_home_page.xml b/Diabetes_Health_Management/app/src/main/res/layout/fragment_home_page.xml index 4b1b497..5107449 100644 --- a/Diabetes_Health_Management/app/src/main/res/layout/fragment_home_page.xml +++ b/Diabetes_Health_Management/app/src/main/res/layout/fragment_home_page.xml @@ -7,8 +7,10 @@ tools:context=".HomePageFragment"> @@ -25,4 +27,208 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Diabetes_Health_Management/app/src/main/res/layout/fragment_patient_reply.xml b/Diabetes_Health_Management/app/src/main/res/layout/fragment_patient_reply.xml new file mode 100644 index 0000000..4d92644 --- /dev/null +++ b/Diabetes_Health_Management/app/src/main/res/layout/fragment_patient_reply.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/Diabetes_Health_Management/app/src/main/res/layout/fragment_popular_science_article.xml b/Diabetes_Health_Management/app/src/main/res/layout/fragment_popular_science_article.xml new file mode 100644 index 0000000..54adcab --- /dev/null +++ b/Diabetes_Health_Management/app/src/main/res/layout/fragment_popular_science_article.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/Diabetes_Health_Management/app/src/main/res/layout/fragment_popular_science_popularization.xml b/Diabetes_Health_Management/app/src/main/res/layout/fragment_popular_science_popularization.xml new file mode 100644 index 0000000..c67a28f --- /dev/null +++ b/Diabetes_Health_Management/app/src/main/res/layout/fragment_popular_science_popularization.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/Diabetes_Health_Management/app/src/main/res/layout/fragment_popular_science_video.xml b/Diabetes_Health_Management/app/src/main/res/layout/fragment_popular_science_video.xml new file mode 100644 index 0000000..fad71cc --- /dev/null +++ b/Diabetes_Health_Management/app/src/main/res/layout/fragment_popular_science_video.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/Diabetes_Health_Management/app/src/main/res/values/colors.xml b/Diabetes_Health_Management/app/src/main/res/values/colors.xml index 773ddf7..e894f91 100644 --- a/Diabetes_Health_Management/app/src/main/res/values/colors.xml +++ b/Diabetes_Health_Management/app/src/main/res/values/colors.xml @@ -3,4 +3,5 @@ #FF000000 #FFFFFFFF #1AD1B3 + #EAFFFB \ No newline at end of file