Commit 7cd6b667a7a55f4c1f08d5bc997c765b8b1c9a0e

Authored by 陶汉栋
1 parent c45f5ac9

no message

.idea/modules.xml
... ... @@ -4,9 +4,9 @@
4 4 <modules>
5 5 <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
6 6 <module fileurl="file://$PROJECT_DIR$/mvpsdk/mvpsdk.iml" filepath="$PROJECT_DIR$/mvpsdk/mvpsdk.iml" />
7   - <module fileurl="file://$PROJECT_DIR$/parentWorkHolper.iml" filepath="$PROJECT_DIR$/parentWorkHolper.iml" />
8   - <module fileurl="file://F:\parentwork\parentWorkHolper.iml" filepath="F:\parentwork\parentWorkHolper.iml" />
9 7 <module fileurl="file://E:\parentwork\parentWorkHolper.iml" filepath="E:\parentwork\parentWorkHolper.iml" />
  8 + <module fileurl="file://F:\parentwork\parentWorkHolper.iml" filepath="F:\parentwork\parentWorkHolper.iml" />
  9 + <module fileurl="file://$PROJECT_DIR$/parentwork.iml" filepath="$PROJECT_DIR$/parentwork.iml" />
10 10 <module fileurl="file://F:\parentWorkHolper\parentwork.iml" filepath="F:\parentWorkHolper\parentwork.iml" />
11 11 <module fileurl="file://$PROJECT_DIR$/processor/processor.iml" filepath="$PROJECT_DIR$/processor/processor.iml" />
12 12 <module fileurl="file://$PROJECT_DIR$/roundedimageview-2.2.1/roundedimageview-2.2.1.iml" filepath="$PROJECT_DIR$/roundedimageview-2.2.1/roundedimageview-2.2.1.iml" />
... ...
app/build.gradle
... ... @@ -55,11 +55,12 @@ task fileCheckTask() {
55 55 doLast {
56 56 File file = new File(rootDir.getAbsolutePath() + "\\app\\src\\main\\assets\\migrations")
57 57 File[] files = file.listFiles()
58   - for (int i = 0; i < files.length; i++) {
59   - File file1 = files[i]
60   - println("delete : "+file1.getAbsolutePath())
61   - file1.delete()
62   - }
  58 + if (null != files)
  59 + for (int i = 0; i < files.length; i++) {
  60 + File file1 = files[i]
  61 + println("delete : " + file1.getAbsolutePath())
  62 + file1.delete()
  63 + }
63 64 }
64 65 }
65 66  
... ...
app/libs/processor.jar
No preview for this file type
app/src/main/java/com/shunzhi/parent/adapter/ReportAdapter.java
... ... @@ -3,6 +3,8 @@ package com.shunzhi.parent.adapter;
3 3  
4 4 import android.content.Context;
5 5 import android.content.Intent;
  6 +import android.support.v7.widget.LinearLayoutManager;
  7 +import android.support.v7.widget.RecyclerView;
6 8 import android.view.LayoutInflater;
7 9 import android.view.View;
8 10 import android.view.ViewGroup;
... ... @@ -13,6 +15,7 @@ import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder;
13 15 import com.shunzhi.parent.R;
14 16 import com.shunzhi.parent.bean.ReportBean;
15 17 import com.shunzhi.parent.ui.activity.report.ReportDetialActivity;
  18 +import com.shunzhi.parent.views.CustomLinearLayoutManager;
16 19  
17 20 /**
18 21 * Created by Administrator on 2018/3/9 0009.
... ... @@ -28,6 +31,14 @@ public class ReportAdapter extends BaseRecyclerViewAdapter&lt;ReportBean&gt; {
28 31  
29 32  
30 33 @Override
  34 + public void onAttachedToRecyclerView(RecyclerView recyclerView) {
  35 + super.onAttachedToRecyclerView(recyclerView);
  36 + recyclerView.setLayoutManager(new CustomLinearLayoutManager(context,
  37 + LinearLayoutManager.VERTICAL, false));
  38 + recyclerView.setHasFixedSize(true);
  39 + }
  40 +
  41 + @Override
31 42 public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
32 43 View view = LayoutInflater.from(context).inflate(R.layout.item_report_deyu, parent,false);
33 44 return new MyViewHolder(view);
... ...
app/src/main/java/com/shunzhi/parent/popu/ShaiXuanPop.java
... ... @@ -57,7 +57,7 @@ public class ShaiXuanPop extends PopupWindow {
57 57 tvSubmit.setOnClickListener(new View.OnClickListener() {
58 58 @Override
59 59 public void onClick(View view) {
60   -
  60 + dismiss();
61 61 }
62 62 });
63 63  
... ...
app/src/main/java/com/shunzhi/parent/ui/MainActivity.java
... ... @@ -26,7 +26,7 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils.
26 26  
27 27 BottomNavigationView bottom_navigationView;
28 28  
29   - CePingFragment cePingFragment = null;
  29 +// CePingFragment cePingFragment = null;
30 30  
31 31 ConsultFragment consultFragment = null;
32 32  
... ... @@ -36,7 +36,7 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils.
36 36  
37 37 Fragment[] fragments = null;
38 38  
39   - private int CEPING_INDEX = 0, CONSULT_INDEX = 1, REPORT_INDEX = 2, MINE_INDEX = 3;
  39 + private int CEPING_INDEX = 0, CONSULT_INDEX = 0, REPORT_INDEX = 1, MINE_INDEX = 2;
40 40  
41 41 FragmentTransaction fragmentTransaction = null;
42 42  
... ... @@ -54,10 +54,11 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils.
54 54 @Override
55 55 public boolean onNavigationItemSelected(@NonNull MenuItem item) {
56 56 switch (item.getItemId()) {
57   - case R.id.menu_item_index://测评页面
58   - showFragment(CEPING_INDEX);
59   - break;
  57 +// case R.id.menu_item_index://测评页面
  58 +// showFragment(CEPING_INDEX);
  59 +// break;
60 60 case R.id.menu_item_consult://咨询频道
  61 +// showFragment(CONSULT_INDEX);
61 62 showFragment(CONSULT_INDEX);
62 63 break;
63 64 case R.id.menu_item_report://报告
... ... @@ -75,23 +76,24 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils.
75 76 }
76 77  
77 78 private void initFragments() {
78   - fragments = new Fragment[4];
79   - cePingFragment = new CePingFragment();
  79 + fragments = new Fragment[3];
  80 +// cePingFragment = new CePingFragment();
80 81 consultFragment = new ConsultFragment();
81 82 reportFragment = new ReportFragment();
82 83 mineFragment = new MineFragment();
83   - fragments[CEPING_INDEX] = cePingFragment;
  84 +// fragments[CEPING_INDEX] = cePingFragment;
84 85 fragments[CONSULT_INDEX] = consultFragment;
85 86 fragments[REPORT_INDEX] = reportFragment;
86 87 fragments[MINE_INDEX] = mineFragment;
87 88  
88 89 fragmentTransaction = getSupportFragmentManager().beginTransaction();
89   - fragmentTransaction.add(R.id.frame, cePingFragment)
  90 + fragmentTransaction
  91 +// .add(R.id.frame, cePingFragment)
90 92 .add(R.id.frame, consultFragment)
91 93 .add(R.id.frame, reportFragment)
92 94 .add(R.id.frame, mineFragment)
93   - .show(cePingFragment)
94   - .hide(consultFragment)
  95 +// .show(cePingFragment)
  96 + .show(consultFragment)
95 97 .hide(reportFragment)
96 98 .hide(mineFragment)
97 99 .commit();
... ... @@ -103,8 +105,8 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils.
103 105 if (index == i) fragmentTransaction.show(fragments[index]);
104 106 else fragmentTransaction.hide(fragments[i]);
105 107 }
106   - if (index==CONSULT_INDEX)consultFragment.refresh();
107   - else if (index==CEPING_INDEX)cePingFragment.refresh();
  108 + if (index == CONSULT_INDEX) consultFragment.refresh();
  109 +// else if (index == CEPING_INDEX) cePingFragment.refresh();
108 110 fragmentTransaction.commit();
109 111 }
110 112  
... ...
app/src/main/java/com/shunzhi/parent/ui/fragment/ReportFragment.java
... ... @@ -2,8 +2,15 @@ package com.shunzhi.parent.ui.fragment;
2 2  
3 3  
4 4 import android.os.Bundle;
  5 +import android.os.Handler;
  6 +import android.os.Message;
5 7 import android.support.annotation.NonNull;
6 8 import android.support.annotation.Nullable;
  9 +import android.support.design.widget.TabLayout;
  10 +import android.support.v4.app.Fragment;
  11 +import android.support.v4.app.FragmentManager;
  12 +import android.support.v4.app.FragmentPagerAdapter;
  13 +import android.support.v4.view.ViewPager;
7 14 import android.support.v7.widget.LinearLayoutManager;
8 15 import android.support.v7.widget.RecyclerView;
9 16 import android.view.View;
... ... @@ -13,39 +20,33 @@ import com.amy.monthweek.materialcalendarview.MonthWeekMaterialCalendarView;
13 20 import com.prolificinteractive.materialcalendarview.CalendarDay;
14 21 import com.prolificinteractive.materialcalendarview.MaterialCalendarView;
15 22 import com.share.mvpsdk.base.BasePresenter;
  23 +import com.share.mvpsdk.base.fragment.BaseCompatFragment;
16 24 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
  25 +import com.share.mvpsdk.utils.ToastUtils;
17 26 import com.shunzhi.parent.R;
18 27 import com.shunzhi.parent.adapter.ReportAdapter;
19 28 import com.shunzhi.parent.bean.ReportBean;
20 29 import com.shunzhi.parent.contract.report.ReportContract;
21 30 import com.shunzhi.parent.popu.ShaiXuanPop;
22 31 import com.shunzhi.parent.presenter.report.ReportPresenter;
  32 +import com.shunzhi.parent.ui.fragment.report.ChengZhangFragment;
23 33 import com.shunzhi.parent.views.CustomLinearLayoutManager;
24 34  
25 35 import java.util.List;
26 36  
27   -public class ReportFragment extends BaseMVPCompatFragment<ReportContract.ReportPresenter, ReportContract.IReportModel>
28   - implements ReportContract.IReportView ,View.OnClickListener{
  37 +public class ReportFragment extends BaseCompatFragment implements View.OnClickListener {
  38 + ViewPager viewPager;
29 39  
30   - RecyclerView recyclerView;
31   - ReportAdapter reportAdapter;
  40 + TextView tvDate, tvShaiXuan, tvNoData;
32 41  
33   - MonthWeekMaterialCalendarView monthWeekMaterialCalendarView = null;
  42 + MyFragmentAdapter myFragmentAdapter = null;
34 43  
35   - private CalendarDay selectedDate;
  44 + TabLayout tabLayout;
36 45  
37   - MaterialCalendarView calendarView_month_mode;
38   -
39   - TextView tvDate,tvShaiXuan,tvNoData;
  46 + ChengZhangFragment chengZhangFragment1 = null, chengZhangFragment2 = null;//成长、报告页面
40 47  
41 48 ShaiXuanPop shaiXuanPop=null;
42 49  
43   - @NonNull
44   - @Override
45   - public BasePresenter initPresenter() {
46   - return new ReportPresenter();
47   - }
48   -
49 50 @Override
50 51 public int getLayoutId() {
51 52 return R.layout.fragment_report;
... ... @@ -53,84 +54,88 @@ public class ReportFragment extends BaseMVPCompatFragment&lt;ReportContract.ReportP
53 54  
54 55 @Override
55 56 public void initUI(View view, @Nullable Bundle savedInstanceState) {
56   - recyclerView = view.findViewById(R.id.recycle_report);
57   - calendarView_month_mode = view.findViewById(R.id.calendarView_month_mode);
  57 + viewPager = view.findViewById(R.id.viewPager);
58 58 tvDate = view.findViewById(R.id.tvDate);
59   - tvShaiXuan=view.findViewById(R.id.tvShaiXuan);
60   - tvNoData=view.findViewById(R.id.tvNoData);
61   -
62   - LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
63   - layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
64   - recyclerView.setLayoutManager(new CustomLinearLayoutManager(getActivity(),
65   - LinearLayoutManager.VERTICAL, false));
66   - recyclerView.setHasFixedSize(true);
67   - monthWeekMaterialCalendarView = view.findViewById(R.id.slidelayout);
68   - initCalendarView();
69   - initReportList();
  59 + tvShaiXuan = view.findViewById(R.id.tvShaiXuan);
  60 + tvNoData = view.findViewById(R.id.tvNoData);
  61 + tabLayout = view.findViewById(R.id.tabLayout);
70 62  
71   - }
  63 + tvShaiXuan.setOnClickListener(this);
72 64  
73   - private void initCalendarView() {
  65 + myFragmentAdapter = new MyFragmentAdapter(getChildFragmentManager());
74 66  
75   - selectedDate = CalendarDay.today();
76   - showDate();
77   - monthWeekMaterialCalendarView.setMode(MonthWeekMaterialCalendarView.Mode.WEEK);
78   - monthWeekMaterialCalendarView.setCurrentDate(selectedDate);
79   - monthWeekMaterialCalendarView.setSelectedDate(selectedDate);
80   - monthWeekMaterialCalendarView.state().edit().setSlideModeChangeListener(new MonthWeekMaterialCalendarView.SlideModeChangeListener() {
  67 + viewPager.setAdapter(myFragmentAdapter);
  68 + tabLayout.setupWithViewPager(viewPager);
  69 + tabLayout.removeAllTabs();
  70 + tabLayout.addTab(tabLayout.newTab().setText("成长"));
  71 + tabLayout.addTab(tabLayout.newTab().setText("报告"));
  72 + viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
81 73 @Override
82   - public void modeChange(MonthWeekMaterialCalendarView.Mode mode) {
  74 + public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
83 75  
84 76 }
85   - }).setSlideDateSelectedlistener(new MonthWeekMaterialCalendarView.SlideDateSelectedlistener() {
86   - @Override
87   - public void onDateSelected(@NonNull MaterialCalendarView widget, @NonNull CalendarDay date, boolean selected) {
88   - selectedDate = date;
89   - showDate();
90 77  
91   - }
92   - }).setSlideOnMonthChangedListener(new MonthWeekMaterialCalendarView.SlideOnMonthChangedListener() {
93 78 @Override
94   - public void onMonthChanged(MaterialCalendarView widget, CalendarDay date) {
95   - selectedDate = date;
96   - showDate();
  79 + public void onPageSelected(int position) {
  80 + if (position==0)tvShaiXuan.setVisibility(View.GONE);
  81 + else tvShaiXuan.setVisibility(View.VISIBLE);
97 82 }
98   - }).commit();
99 83  
100   - }
  84 + @Override
  85 + public void onPageScrollStateChanged(int state) {
101 86  
102   - private void showDate() {
103   -// tvDate.setText(selectedDate.getYear() + "年" + (selectedDate.getMonth() + 1) + "月");
104   - }
  87 + }
  88 + });
105 89  
106   - private void initReportList() {
107   - mPresenter.reportResult();
108   - tvShaiXuan.setOnClickListener(this);
109 90 }
110 91  
111 92 @Override
112   - public void UpdateList(List<ReportBean> list) {
113   - reportAdapter = new ReportAdapter(getActivity());
114   - reportAdapter.addAll(list);
115   - recyclerView.setAdapter(reportAdapter);
  93 + public void onClick(View view) {
  94 + switch (view.getId()){
  95 + case R.id.tvShaiXuan:
  96 + if (null == shaiXuanPop) shaiXuanPop = new ShaiXuanPop(getActivity());
  97 + chengZhangFragment2.showShaixuan(handler);
  98 + break;
  99 + }
116 100 }
117 101  
118   - @Override
119   - public void showReports(List<String> stringList) {
120   - if (null!=shaiXuanPop){
121   - if (stringList.size()>0)tvNoData.setVisibility(View.GONE);
122   - shaiXuanPop.setDatas(stringList);
  102 + Handler handler=new Handler(){
  103 + @Override
  104 + public void handleMessage(Message msg) {
  105 + super.handleMessage(msg);
  106 + shaiXuanPop.setDatas((List<String>) msg.obj);
123 107 shaiXuanPop.show(tvShaiXuan);
124 108 }
125   - }
  109 + };
126 110  
127 111 @Override
128   - public void onClick(View view) {
129   - switch (view.getId()){
130   - case R.id.tvShaiXuan:
131   - if (null==shaiXuanPop)shaiXuanPop=new ShaiXuanPop(getActivity());
132   - mPresenter.getReports();
133   - break;
  112 + public void onDestroy() {
  113 + super.onDestroy();
  114 + if (handler!=null)handler=null;
  115 + }
  116 +
  117 + private class MyFragmentAdapter extends FragmentPagerAdapter {
  118 +
  119 + public MyFragmentAdapter(FragmentManager fm) {
  120 + super(fm);
  121 + }
  122 +
  123 + @Override
  124 + public Fragment getItem(int position) {
  125 + if (position == 0) {
  126 + chengZhangFragment1 = ChengZhangFragment.newInstance(ChengZhangFragment.TYPE_CHENGZHANG);
  127 + return chengZhangFragment1;
  128 + } else if (position == 1) {
  129 + chengZhangFragment2 = ChengZhangFragment.newInstance(ChengZhangFragment.TYPE_REPORT);
  130 + return chengZhangFragment2;
  131 + }
  132 + return null;
  133 + }
  134 +
  135 + @Override
  136 + public int getCount() {
  137 + return 2;
134 138 }
135 139 }
  140 +
136 141 }
... ...
app/src/main/java/com/shunzhi/parent/ui/fragment/report/ChengZhangFragment.java 0 → 100644
... ... @@ -0,0 +1,172 @@
  1 +package com.shunzhi.parent.ui.fragment.report;
  2 +
  3 +import android.os.Bundle;
  4 +import android.os.Handler;
  5 +import android.os.Message;
  6 +import android.support.annotation.NonNull;
  7 +import android.support.annotation.Nullable;
  8 +import android.support.v7.widget.RecyclerView;
  9 +import android.view.View;
  10 +import android.widget.LinearLayout;
  11 +
  12 +import com.amy.monthweek.materialcalendarview.MonthWeekMaterialCalendarView;
  13 +import com.prolificinteractive.materialcalendarview.CalendarDay;
  14 +import com.prolificinteractive.materialcalendarview.MaterialCalendarView;
  15 +import com.share.mvpsdk.base.BasePresenter;
  16 +import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
  17 +import com.shunzhi.parent.R;
  18 +import com.shunzhi.parent.adapter.ReportAdapter;
  19 +import com.shunzhi.parent.bean.ReportBean;
  20 +import com.shunzhi.parent.contract.report.ReportContract;
  21 +import com.shunzhi.parent.popu.ShaiXuanPop;
  22 +import com.shunzhi.parent.presenter.report.ReportPresenter;
  23 +
  24 +import java.util.List;
  25 +
  26 +/**
  27 + */
  28 +public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.ReportPresenter, ReportContract.IReportModel>
  29 + implements ReportContract.IReportView, View.OnClickListener {
  30 +
  31 + public static String TYPE_CHENGZHANG = "chengzhang", TYPE_REPORT = "report";
  32 +
  33 + public static ChengZhangFragment newInstance(String type) {
  34 + Bundle bundle = new Bundle();
  35 + bundle.putString("type", type);
  36 + ChengZhangFragment chengZhangFragment = new ChengZhangFragment();
  37 + chengZhangFragment.setArguments(bundle);
  38 + return chengZhangFragment;
  39 + }
  40 +
  41 + RecyclerView recyclerView;
  42 +
  43 + ReportAdapter reportAdapter;
  44 +
  45 + MonthWeekMaterialCalendarView monthWeekMaterialCalendarView = null;
  46 +
  47 + private CalendarDay selectedDate;
  48 +
  49 + MaterialCalendarView calendarView_month_mode;
  50 +
  51 + private String type = "";
  52 +
  53 + LinearLayout layout_chengzhang, layout_report, layout_kaoqin, layout_buka, layout_qingjia;
  54 +
  55 + @Override
  56 + public int getLayoutId() {
  57 + return R.layout.fragment_cheng_zhang;
  58 + }
  59 +
  60 + @Override
  61 + public void initUI(View view, @Nullable Bundle savedInstanceState) {
  62 +
  63 + layout_report = view.findViewById(R.id.layout_report);
  64 + recyclerView = view.findViewById(R.id.recycle_report);
  65 + layout_kaoqin = view.findViewById(R.id.layout_kaoqin);
  66 + layout_buka = view.findViewById(R.id.layout_buka);
  67 + layout_qingjia = view.findViewById(R.id.layout_qingjia);
  68 + calendarView_month_mode = view.findViewById(R.id.calendarView_month_mode);
  69 + monthWeekMaterialCalendarView = view.findViewById(R.id.slidelayout);
  70 + layout_chengzhang = view.findViewById(R.id.layout_chengzhang);
  71 +
  72 + layout_kaoqin.setOnClickListener(this);
  73 + layout_buka.setOnClickListener(this);
  74 + layout_qingjia.setOnClickListener(this);
  75 +
  76 + type = getArguments().getString("type");
  77 + if (type.equals(TYPE_CHENGZHANG)) {
  78 + layout_chengzhang.setVisibility(View.VISIBLE);
  79 + layout_report.setVisibility(View.GONE);
  80 +
  81 + } else {
  82 +
  83 + layout_chengzhang.setVisibility(View.GONE);
  84 + layout_report.setVisibility(View.VISIBLE);
  85 +
  86 + initCalendarView();
  87 + initReportList();
  88 +
  89 + }
  90 + }
  91 +
  92 + private void initCalendarView() {
  93 +
  94 + showDate();
  95 + selectedDate = CalendarDay.today();
  96 + monthWeekMaterialCalendarView.setMode(MonthWeekMaterialCalendarView.Mode.WEEK);
  97 + monthWeekMaterialCalendarView.setCurrentDate(selectedDate);
  98 + monthWeekMaterialCalendarView.setSelectedDate(selectedDate);
  99 + monthWeekMaterialCalendarView.state().edit().setSlideModeChangeListener(new MonthWeekMaterialCalendarView.SlideModeChangeListener() {
  100 + @Override
  101 + public void modeChange(MonthWeekMaterialCalendarView.Mode mode) {
  102 +
  103 + }
  104 + }).setSlideDateSelectedlistener(new MonthWeekMaterialCalendarView.SlideDateSelectedlistener() {
  105 + @Override
  106 + public void onDateSelected(@NonNull MaterialCalendarView widget, @NonNull CalendarDay date, boolean selected) {
  107 + selectedDate = date;
  108 + showDate();
  109 +
  110 + }
  111 + }).setSlideOnMonthChangedListener(new MonthWeekMaterialCalendarView.SlideOnMonthChangedListener() {
  112 + @Override
  113 + public void onMonthChanged(MaterialCalendarView widget, CalendarDay date) {
  114 + selectedDate = date;
  115 + showDate();
  116 + }
  117 + }).commit();
  118 +
  119 + }
  120 +
  121 + private void showDate() {
  122 +// tvDate.setText(selectedDate.getYear() + "年" + (selectedDate.getMonth() + 1) + "月");
  123 + }
  124 +
  125 + private void initReportList() {
  126 + mPresenter.reportResult();
  127 + }
  128 +
  129 + @Override
  130 + public void UpdateList(List<ReportBean> list) {
  131 + reportAdapter = new ReportAdapter(getActivity());
  132 + reportAdapter.addAll(list);
  133 + recyclerView.setAdapter(reportAdapter);
  134 + }
  135 +
  136 + @Override
  137 + public void showReports(List<String> stringList) {
  138 + if (null != handler) {
  139 + Message message = handler.obtainMessage();
  140 + message.obj = stringList;
  141 + handler.sendMessage(message);
  142 + }
  143 + }
  144 +
  145 + @Override
  146 + public void onClick(View view) {
  147 + switch (view.getId()) {
  148 + case R.id.layout_kaoqin:
  149 +
  150 + break;
  151 + case R.id.layout_buka:
  152 +
  153 + break;
  154 + case R.id.layout_qingjia:
  155 +
  156 + break;
  157 + }
  158 + }
  159 +
  160 + @NonNull
  161 + @Override
  162 + public BasePresenter initPresenter() {
  163 + return new ReportPresenter();
  164 + }
  165 +
  166 + Handler handler = null;
  167 +
  168 + public void showShaixuan(Handler handler) {
  169 + mPresenter.getReports();
  170 + this.handler = handler;
  171 + }
  172 +}
... ...
app/src/main/res/drawable-hdpi/kaoqin.png 0 → 100644

878 Bytes

app/src/main/res/drawable-xhdpi/kaoqin.png 0 → 100644

1.04 KB

app/src/main/res/drwable-xxhdpi/kaoqin.png 0 → 100644

4.16 KB

app/src/main/res/layout/fragment_cheng_zhang.xml 0 → 100644
... ... @@ -0,0 +1,125 @@
  1 +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2 + xmlns:tools="http://schemas.android.com/tools"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:background="@color/white"
  6 + android:padding="@dimen/size_dp_10"
  7 + tools:context="com.shunzhi.parent.ui.fragment.report.ChengZhangFragment">
  8 +
  9 + <include layout="@layout/layout_chengzhang"/>
  10 +
  11 + <LinearLayout
  12 + android:id="@+id/layout_report"
  13 + android:layout_width="match_parent"
  14 + android:layout_height="match_parent"
  15 + android:orientation="vertical">
  16 +
  17 + <!--<include layout="@layout/layout_week" /> android:layout_below="@+id/linearlayout"-->
  18 +
  19 + <com.amy.monthweek.materialcalendarview.MonthWeekMaterialCalendarView xmlns:app="http://schemas.android.com/apk/res-auto"
  20 + android:id="@+id/slidelayout"
  21 + android:layout_width="match_parent"
  22 + android:layout_height="match_parent">
  23 +
  24 + <com.prolificinteractive.materialcalendarview.MaterialCalendarView
  25 + android:id="@+id/calendarView_month_mode"
  26 + android:layout_width="match_parent"
  27 + android:layout_height="wrap_content"
  28 + android:background="@color/white"
  29 + app:mcv_calendarMode="month"
  30 + app:mcv_dateTextAppearance="@style/TextAppearance.MaterialCalendarWidget.Date"
  31 + app:mcv_selectionColor="@color/huodong_blue"
  32 + app:mcv_showOtherDates="defaults|other_months"
  33 + app:mcv_showWeekView="false" />
  34 +
  35 + <com.prolificinteractive.materialcalendarview.MaterialCalendarView
  36 + android:id="@+id/calendarView_week_mode"
  37 + android:layout_width="match_parent"
  38 + android:layout_height="wrap_content"
  39 + android:background="@android:color/white"
  40 + android:visibility="invisible"
  41 + app:mcv_calendarMode="week"
  42 + app:mcv_dateTextAppearance="@style/TextAppearance.MaterialCalendarWidget.Date"
  43 + app:mcv_selectionColor="@color/huodong_blue"
  44 + app:mcv_showTopBar="false"
  45 + app:mcv_showWeekView="false" />
  46 +
  47 + <android.support.v7.widget.RecyclerView
  48 + android:id="@+id/recycle_report"
  49 + android:layout_width="match_parent"
  50 + android:layout_height="match_parent"
  51 + android:background="@color/bgColor"
  52 + android:padding="@dimen/size_dp_10">
  53 +
  54 + </android.support.v7.widget.RecyclerView>
  55 +
  56 + <LinearLayout
  57 + android:id="@+id/weekview_top"
  58 + android:layout_width="match_parent"
  59 + android:layout_height="44dp"
  60 + android:background="@color/white"
  61 + android:orientation="horizontal">
  62 +
  63 + <TextView
  64 + android:layout_width="0dp"
  65 + android:layout_height="match_parent"
  66 + android:layout_weight="1"
  67 + android:gravity="center"
  68 + android:text="周日"
  69 + android:textSize="@dimen/textSize16" />
  70 +
  71 + <TextView
  72 + android:layout_width="0dp"
  73 + android:layout_height="match_parent"
  74 + android:layout_weight="1"
  75 + android:gravity="center"
  76 + android:text="周一"
  77 + android:textSize="@dimen/textSize16" />
  78 +
  79 + <TextView
  80 + android:layout_width="0dp"
  81 + android:layout_height="match_parent"
  82 + android:layout_weight="1"
  83 + android:gravity="center"
  84 + android:text="周二"
  85 + android:textSize="@dimen/textSize16" />
  86 +
  87 + <TextView
  88 + android:layout_width="0dp"
  89 + android:layout_height="match_parent"
  90 + android:layout_weight="1"
  91 + android:gravity="center"
  92 + android:text="周三"
  93 + android:textSize="@dimen/textSize16" />
  94 +
  95 + <TextView
  96 + android:layout_width="0dp"
  97 + android:layout_height="match_parent"
  98 + android:layout_weight="1"
  99 + android:gravity="center"
  100 + android:text="周四"
  101 + android:textSize="@dimen/textSize16" />
  102 +
  103 + <TextView
  104 + android:layout_width="0dp"
  105 + android:layout_height="match_parent"
  106 + android:layout_weight="1"
  107 + android:gravity="center"
  108 + android:text="周五"
  109 + android:textSize="@dimen/textSize16" />
  110 +
  111 + <TextView
  112 + android:layout_width="0dp"
  113 + android:layout_height="match_parent"
  114 + android:layout_weight="1"
  115 + android:gravity="center"
  116 + android:text="周六"
  117 + android:textSize="@dimen/textSize16" />
  118 +
  119 + </LinearLayout>
  120 +
  121 + </com.amy.monthweek.materialcalendarview.MonthWeekMaterialCalendarView>
  122 +
  123 + </LinearLayout>
  124 +
  125 +</FrameLayout>
... ...
app/src/main/res/layout/fragment_report.xml
... ... @@ -2,11 +2,12 @@
2 2 xmlns:tools="http://schemas.android.com/tools"
3 3 android:layout_width="match_parent"
4 4 android:layout_height="match_parent"
  5 + xmlns:app="http://schemas.android.com/apk/res-auto"
5 6 android:background="@color/bgColor"
6 7 android:orientation="vertical"
7 8 tools:context="com.shunzhi.parent.ui.fragment.ReportFragment">
8 9  
9   - <LinearLayout
  10 + <FrameLayout
10 11 android:id="@+id/top_layout"
11 12 android:layout_width="match_parent"
12 13 android:layout_height="?android:actionBarSize"
... ... @@ -26,6 +27,7 @@
26 27 android:textSize="@dimen/textSize16" />
27 28  
28 29 <TextView
  30 + android:visibility="gone"
29 31 android:id="@+id/tvDate"
30 32 android:layout_width="wrap_content"
31 33 android:layout_height="wrap_content"
... ... @@ -36,16 +38,32 @@
36 38 android:textColor="@color/white"
37 39 android:textSize="@dimen/textSize18" />
38 40  
  41 + <android.support.design.widget.TabLayout
  42 + android:layout_width="wrap_content"
  43 + android:layout_gravity="center"
  44 + app:tabIndicatorColor="@color/white"
  45 + app:tabSelectedTextColor="@color/white"
  46 + app:tabTextColor="@color/textColor"
  47 + app:tabMaxWidth="@dimen/size_dp_60"
  48 + android:layout_height="wrap_content"
  49 + android:id="@+id/tabLayout"
  50 + app:tabIndicatorHeight="@dimen/size_dp_3"
  51 + app:tabMode="scrollable"
  52 + app:tabGravity="fill"
  53 + app:tabTextAppearance="@style/TextView_Wrap_16"
  54 + ></android.support.design.widget.TabLayout>
  55 +
39 56 <TextView
40 57 android:id="@+id/tvShaiXuan"
  58 + android:visibility="gone"
41 59 android:layout_width="wrap_content"
42 60 android:layout_height="wrap_content"
43   - android:layout_gravity="center_vertical"
  61 + android:layout_gravity="center_vertical|right"
44 62 android:drawableRight="@drawable/screen"
45 63 android:text="筛选"
46 64 android:textColor="@color/white"
47 65 android:textSize="@dimen/textSize16" />
48   - </LinearLayout>
  66 + </FrameLayout>
49 67  
50 68 <RelativeLayout
51 69 android:layout_width="match_parent"
... ... @@ -66,118 +84,12 @@
66 84 android:textSize="@dimen/size_dp_16" />
67 85 </RelativeLayout>
68 86  
69   - <LinearLayout
  87 + <android.support.v4.view.ViewPager
  88 + android:visibility="visible"
70 89 android:layout_width="match_parent"
71 90 android:layout_height="match_parent"
72   - android:orientation="vertical">
73   -
74   - <!--<include layout="@layout/layout_week" /> android:layout_below="@+id/linearlayout"-->
75   -
76   - <com.amy.monthweek.materialcalendarview.MonthWeekMaterialCalendarView xmlns:app="http://schemas.android.com/apk/res-auto"
77   - android:id="@+id/slidelayout"
78   - android:layout_width="match_parent"
79   - android:layout_height="match_parent">
80   -
81   - <com.prolificinteractive.materialcalendarview.MaterialCalendarView
82   - android:id="@+id/calendarView_month_mode"
83   - android:layout_width="match_parent"
84   - android:layout_height="wrap_content"
85   - android:background="@color/white"
86   - app:mcv_calendarMode="month"
87   - app:mcv_dateTextAppearance="@style/TextAppearance.MaterialCalendarWidget.Date"
88   - app:mcv_selectionColor="@color/huodong_blue"
89   - app:mcv_showOtherDates="defaults|other_months"
90   - app:mcv_showWeekView="false" />
91   -
92   - <com.prolificinteractive.materialcalendarview.MaterialCalendarView
93   - android:id="@+id/calendarView_week_mode"
94   - android:layout_width="match_parent"
95   - android:layout_height="wrap_content"
96   - android:background="@android:color/white"
97   - android:visibility="invisible"
98   - app:mcv_calendarMode="week"
99   - app:mcv_dateTextAppearance="@style/TextAppearance.MaterialCalendarWidget.Date"
100   - app:mcv_selectionColor="@color/huodong_blue"
101   - app:mcv_showTopBar="false"
102   - app:mcv_showWeekView="false" />
103   -
104   -
105   - <android.support.v7.widget.RecyclerView
106   - android:id="@+id/recycle_report"
107   - android:layout_width="match_parent"
108   - android:layout_height="match_parent"
109   - android:background="@color/bgColor"
110   - android:padding="@dimen/size_dp_10">
111   -
112   - </android.support.v7.widget.RecyclerView>
113   -
114   - <LinearLayout
115   - android:id="@+id/weekview_top"
116   - android:layout_width="match_parent"
117   - android:layout_height="44dp"
118   - android:background="@color/white"
119   - android:orientation="horizontal">
120   -
121   - <TextView
122   - android:layout_width="0dp"
123   - android:layout_height="match_parent"
124   - android:layout_weight="1"
125   - android:gravity="center"
126   - android:text="周日"
127   - android:textSize="@dimen/textSize16" />
128   -
129   - <TextView
130   - android:layout_width="0dp"
131   - android:layout_height="match_parent"
132   - android:layout_weight="1"
133   - android:gravity="center"
134   - android:text="周一"
135   - android:textSize="@dimen/textSize16" />
136   -
137   - <TextView
138   - android:layout_width="0dp"
139   - android:layout_height="match_parent"
140   - android:layout_weight="1"
141   - android:gravity="center"
142   - android:text="周二"
143   - android:textSize="@dimen/textSize16" />
144   -
145   - <TextView
146   - android:layout_width="0dp"
147   - android:layout_height="match_parent"
148   - android:layout_weight="1"
149   - android:gravity="center"
150   - android:text="周三"
151   - android:textSize="@dimen/textSize16" />
152   -
153   - <TextView
154   - android:layout_width="0dp"
155   - android:layout_height="match_parent"
156   - android:layout_weight="1"
157   - android:gravity="center"
158   - android:text="周四"
159   - android:textSize="@dimen/textSize16" />
160   -
161   - <TextView
162   - android:layout_width="0dp"
163   - android:layout_height="match_parent"
164   - android:layout_weight="1"
165   - android:gravity="center"
166   - android:text="周五"
167   - android:textSize="@dimen/textSize16" />
168   -
169   - <TextView
170   - android:layout_width="0dp"
171   - android:layout_height="match_parent"
172   - android:layout_weight="1"
173   - android:gravity="center"
174   - android:text="周六"
175   - android:textSize="@dimen/textSize16" />
176   -
177   - </LinearLayout>
178   -
179   - </com.amy.monthweek.materialcalendarview.MonthWeekMaterialCalendarView>
  91 + android:id="@+id/viewPager"
  92 + ></android.support.v4.view.ViewPager>
180 93  
181   - </LinearLayout>
182 94  
183 95 </LinearLayout>
... ...
app/src/main/res/layout/layout_chengzhang.xml 0 → 100644
... ... @@ -0,0 +1,107 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:id="@+id/layout_chengzhang"
  4 + android:layout_width="match_parent"
  5 + android:layout_height="match_parent"
  6 + android:background="@color/white"
  7 + android:orientation="vertical">
  8 +
  9 + <TextView
  10 + android:layout_width="wrap_content"
  11 + android:layout_height="wrap_content"
  12 + android:layout_gravity="center_horizontal"
  13 + android:layout_marginTop="@dimen/size_dp_10"
  14 + android:text="智能校卫"
  15 + android:textColor="@color/textColor"
  16 + android:textSize="@dimen/size_dp_16" />
  17 +
  18 +
  19 + <LinearLayout
  20 + android:id="@+id/layout_kaoqin"
  21 + android:layout_width="match_parent"
  22 + android:layout_height="?android:actionBarSize"
  23 + android:layout_marginLeft="@dimen/size_dp_15"
  24 + android:layout_marginRight="@dimen/size_dp_15"
  25 + android:layout_marginTop="@dimen/size_dp_10"
  26 + android:background="@drawable/shape_corner_bg"
  27 + android:orientation="horizontal">
  28 +
  29 + <ImageView
  30 + android:layout_width="wrap_content"
  31 + android:layout_height="match_parent"
  32 + android:layout_gravity="center_vertical"
  33 + android:layout_margin="@dimen/size_dp_5"
  34 + android:scaleType="fitCenter"
  35 + android:src="@drawable/kaoqin" />
  36 +
  37 + <TextView
  38 + android:layout_width="wrap_content"
  39 + android:layout_height="wrap_content"
  40 + android:layout_gravity="center_vertical"
  41 + android:layout_marginLeft="@dimen/size_dp_15"
  42 + android:text="考勤"
  43 + android:textColor="@color/textColor"
  44 + android:textSize="@dimen/size_dp_16" />
  45 +
  46 + </LinearLayout>
  47 +
  48 +
  49 + <LinearLayout
  50 + android:id="@+id/layout_buka"
  51 + android:layout_width="match_parent"
  52 + android:layout_height="?android:actionBarSize"
  53 + android:layout_marginLeft="@dimen/size_dp_15"
  54 + android:layout_marginRight="@dimen/size_dp_15"
  55 + android:layout_marginTop="@dimen/size_dp_10"
  56 + android:background="@drawable/shape_corner_bg"
  57 + android:orientation="horizontal">
  58 +
  59 + <ImageView
  60 + android:layout_width="wrap_content"
  61 + android:layout_height="wrap_content"
  62 + android:layout_gravity="center_vertical"
  63 + android:layout_margin="@dimen/size_dp_5"
  64 + android:scaleType="fitXY"
  65 + android:src="@drawable/kaoqin" />
  66 +
  67 + <TextView
  68 + android:layout_width="wrap_content"
  69 + android:layout_height="wrap_content"
  70 + android:layout_gravity="center_vertical"
  71 + android:layout_marginLeft="@dimen/size_dp_15"
  72 + android:text="补卡"
  73 + android:textColor="@color/textColor"
  74 + android:textSize="@dimen/size_dp_16" />
  75 +
  76 + </LinearLayout>
  77 +
  78 + <LinearLayout
  79 + android:id="@+id/layout_qingjia"
  80 + android:layout_width="match_parent"
  81 + android:layout_height="?android:actionBarSize"
  82 + android:layout_marginLeft="@dimen/size_dp_15"
  83 + android:layout_marginRight="@dimen/size_dp_15"
  84 + android:layout_marginTop="@dimen/size_dp_10"
  85 + android:background="@drawable/shape_corner_bg"
  86 + android:orientation="horizontal">
  87 +
  88 + <ImageView
  89 + android:layout_width="wrap_content"
  90 + android:layout_height="wrap_content"
  91 + android:layout_gravity="center_vertical"
  92 + android:layout_margin="@dimen/size_dp_5"
  93 + android:scaleType="fitXY"
  94 + android:src="@drawable/kaoqin" />
  95 +
  96 + <TextView
  97 + android:layout_width="wrap_content"
  98 + android:layout_height="wrap_content"
  99 + android:layout_gravity="center_vertical"
  100 + android:layout_marginLeft="@dimen/size_dp_15"
  101 + android:text="请假"
  102 + android:textColor="@color/textColor"
  103 + android:textSize="@dimen/size_dp_16" />
  104 +
  105 + </LinearLayout>
  106 +
  107 +</LinearLayout>
0 108 \ No newline at end of file
... ...
app/src/main/res/menu/bottom_navigationview.xml
1 1 <?xml version="1.0" encoding="utf-8"?>
2 2 <menu xmlns:android="http://schemas.android.com/apk/res/android">
3 3  
4   - <item android:id="@+id/menu_item_index"
5   - android:icon="@drawable/selector_ceping"
6   - android:title="慧测慧练"
7   - ></item>
  4 + <!--<item android:id="@+id/menu_item_index"-->
  5 + <!--android:icon="@drawable/selector_ceping"-->
  6 + <!--android:title="慧测慧练"-->
  7 + <!--&gt;</item>-->
8 8  
9 9  
10 10 <item android:id="@+id/menu_item_consult"
11 11 android:icon="@drawable/selector_consult"
12   - android:title="资讯频道"
  12 + android:title="资讯"
13 13 ></item>
14 14  
15 15  
16 16 <item android:id="@+id/menu_item_report"
17 17 android:icon="@drawable/selector_report"
18   - android:title="报告"
  18 + android:title="成长"
19 19 ></item>
20 20  
21 21  
22 22 <item android:id="@+id/menu_item_mine"
23 23 android:icon="@drawable/selector_ceping"
24   - android:title="个人中心"
  24 + android:title="我的"
25 25 ></item>
26 26  
27 27 </menu>
28 28 \ No newline at end of file
... ...