Commit 180671fdd7e09a008f9ae743568394ec546a183f
1 parent
ce26434c
Exists in
yxb_dev
and in
2 other branches
no message
Showing
5 changed files
with
26 additions
and
88 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
| ... | ... | @@ -10,56 +10,7 @@ import android.view.ViewGroup; |
| 10 | 10 | |
| 11 | 11 | import com.shunzhi.parent.R; |
| 12 | 12 | |
| 13 | -/** | |
| 14 | - * A simple {@link Fragment} subclass. | |
| 15 | - * Activities that contain this fragment must implement the | |
| 16 | - * {@link CePingFragment.OnFragmentInteractionListener} interface | |
| 17 | - * to handle interaction events. | |
| 18 | - * Use the {@link CePingFragment#newInstance} factory method to | |
| 19 | - * create an instance of this fragment. | |
| 20 | - */ | |
| 21 | 13 | public class CePingFragment extends Fragment { |
| 22 | - // TODO: Rename parameter arguments, choose names that match | |
| 23 | - // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER | |
| 24 | - private static final String ARG_PARAM1 = "param1"; | |
| 25 | - private static final String ARG_PARAM2 = "param2"; | |
| 26 | - | |
| 27 | - // TODO: Rename and change types of parameters | |
| 28 | - private String mParam1; | |
| 29 | - private String mParam2; | |
| 30 | - | |
| 31 | - private OnFragmentInteractionListener mListener; | |
| 32 | - | |
| 33 | - public CePingFragment() { | |
| 34 | - // Required empty public constructor | |
| 35 | - } | |
| 36 | - | |
| 37 | - /** | |
| 38 | - * Use this factory method to create a new instance of | |
| 39 | - * this fragment using the provided parameters. | |
| 40 | - * | |
| 41 | - * @param param1 Parameter 1. | |
| 42 | - * @param param2 Parameter 2. | |
| 43 | - * @return A new instance of fragment CePingFragment. | |
| 44 | - */ | |
| 45 | - // TODO: Rename and change types and number of parameters | |
| 46 | - public static CePingFragment newInstance(String param1, String param2) { | |
| 47 | - CePingFragment fragment = new CePingFragment(); | |
| 48 | - Bundle args = new Bundle(); | |
| 49 | - args.putString(ARG_PARAM1, param1); | |
| 50 | - args.putString(ARG_PARAM2, param2); | |
| 51 | - fragment.setArguments(args); | |
| 52 | - return fragment; | |
| 53 | - } | |
| 54 | - | |
| 55 | - @Override | |
| 56 | - public void onCreate(Bundle savedInstanceState) { | |
| 57 | - super.onCreate(savedInstanceState); | |
| 58 | - if (getArguments() != null) { | |
| 59 | - mParam1 = getArguments().getString(ARG_PARAM1); | |
| 60 | - mParam2 = getArguments().getString(ARG_PARAM2); | |
| 61 | - } | |
| 62 | - } | |
| 63 | 14 | |
| 64 | 15 | @Override |
| 65 | 16 | public View onCreateView(LayoutInflater inflater, ViewGroup container, |
| ... | ... | @@ -67,43 +18,4 @@ public class CePingFragment extends Fragment { |
| 67 | 18 | // Inflate the layout for this fragment |
| 68 | 19 | return inflater.inflate(R.layout.fragment_ce_ping, container, false); |
| 69 | 20 | } |
| 70 | - | |
| 71 | - // TODO: Rename method, update argument and hook method into UI event | |
| 72 | - public void onButtonPressed(Uri uri) { | |
| 73 | - if (mListener != null) { | |
| 74 | - mListener.onFragmentInteraction(uri); | |
| 75 | - } | |
| 76 | - } | |
| 77 | - | |
| 78 | - @Override | |
| 79 | - public void onAttach(Context context) { | |
| 80 | - super.onAttach(context); | |
| 81 | - if (context instanceof OnFragmentInteractionListener) { | |
| 82 | - mListener = (OnFragmentInteractionListener) context; | |
| 83 | - } else { | |
| 84 | - throw new RuntimeException(context.toString() | |
| 85 | - + " must implement OnFragmentInteractionListener"); | |
| 86 | - } | |
| 87 | - } | |
| 88 | - | |
| 89 | - @Override | |
| 90 | - public void onDetach() { | |
| 91 | - super.onDetach(); | |
| 92 | - mListener = null; | |
| 93 | - } | |
| 94 | - | |
| 95 | - /** | |
| 96 | - * This interface must be implemented by activities that contain this | |
| 97 | - * fragment to allow an interaction in this fragment to be communicated | |
| 98 | - * to the activity and potentially other fragments contained in that | |
| 99 | - * activity. | |
| 100 | - * <p> | |
| 101 | - * See the Android Training lesson <a href= | |
| 102 | - * "http://developer.android.com/training/basics/fragments/communicating.html" | |
| 103 | - * >Communicating with Other Fragments</a> for more information. | |
| 104 | - */ | |
| 105 | - public interface OnFragmentInteractionListener { | |
| 106 | - // TODO: Update argument type and name | |
| 107 | - void onFragmentInteraction(Uri uri); | |
| 108 | - } | |
| 109 | 21 | } | ... | ... |
1 KB
1.01 KB
| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
| 3 | + | |
| 4 | + <item android:drawable="@drawable/consult_select" android:state_selected="true"/> | |
| 5 | + <item android:drawable="@drawable/consult_select" android:state_pressed="true"/> | |
| 6 | + <item android:drawable="@drawable/consult_normal"/> | |
| 7 | + | |
| 8 | +</selector> | |
| 0 | 9 | \ No newline at end of file | ... | ... |
app/src/main/res/menu/bottom_navigationview.xml
| ... | ... | @@ -6,4 +6,22 @@ |
| 6 | 6 | android:title="测评" |
| 7 | 7 | ></item> |
| 8 | 8 | |
| 9 | + | |
| 10 | + <item android:id="@+id/menu_item_consult" | |
| 11 | + android:icon="@drawable/selector_consult" | |
| 12 | + android:title="咨询频道" | |
| 13 | + ></item> | |
| 14 | + | |
| 15 | + | |
| 16 | + <item android:id="@+id/menu_item_report" | |
| 17 | + android:icon="@drawable/selector_ceping" | |
| 18 | + android:title="报告" | |
| 19 | + ></item> | |
| 20 | + | |
| 21 | + | |
| 22 | + <item android:id="@+id/menu_item_mine" | |
| 23 | + android:icon="@drawable/selector_ceping" | |
| 24 | + android:title="个人中心" | |
| 25 | + ></item> | |
| 26 | + | |
| 9 | 27 | </menu> |
| 10 | 28 | \ No newline at end of file | ... | ... |