Commit 53e2d7b76cfbdadf3116702daa0a7ec2cad20738
Exists in
yxb_dev
and in
1 other branch
Merge branch 'yxb_dev' of http://git.shunzhi.net/taohd/parentwork into developer
Showing
4 changed files
with
59 additions
and
52 deletions
Show diff stats
.idea/modules.xml
@@ -4,7 +4,6 @@ | @@ -4,7 +4,6 @@ | ||
4 | <modules> | 4 | <modules> |
5 | <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> | 5 | <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> |
6 | <module fileurl="file://$PROJECT_DIR$/mvpsdk/mvpsdk.iml" filepath="$PROJECT_DIR$/mvpsdk/mvpsdk.iml" /> | 6 | <module fileurl="file://$PROJECT_DIR$/mvpsdk/mvpsdk.iml" filepath="$PROJECT_DIR$/mvpsdk/mvpsdk.iml" /> |
7 | - <module fileurl="file://F:/parentwork/parentWorkHolper.iml" filepath="F:/parentwork/parentWorkHolper.iml" /> | ||
8 | <module fileurl="file://$PROJECT_DIR$/parentWorkHolper.iml" filepath="$PROJECT_DIR$/parentWorkHolper.iml" /> | 7 | <module fileurl="file://$PROJECT_DIR$/parentWorkHolper.iml" filepath="$PROJECT_DIR$/parentWorkHolper.iml" /> |
9 | <module fileurl="file://$PROJECT_DIR$/parentwork.iml" filepath="$PROJECT_DIR$/parentwork.iml" /> | 8 | <module fileurl="file://$PROJECT_DIR$/parentwork.iml" filepath="$PROJECT_DIR$/parentwork.iml" /> |
10 | <module fileurl="file://F:/parentWorkHolper/parentwork.iml" filepath="F:/parentWorkHolper/parentwork.iml" /> | 9 | <module fileurl="file://F:/parentWorkHolper/parentwork.iml" filepath="F:/parentWorkHolper/parentwork.iml" /> |
app/libs/processor.jar
No preview for this file type
app/src/main/java/com/shunzhi/parent/ui/fragment/ReportFragment.java
@@ -11,16 +11,11 @@ import android.support.v4.app.Fragment; | @@ -11,16 +11,11 @@ import android.support.v4.app.Fragment; | ||
11 | import android.support.v4.app.FragmentManager; | 11 | import android.support.v4.app.FragmentManager; |
12 | import android.support.v4.app.FragmentPagerAdapter; | 12 | import android.support.v4.app.FragmentPagerAdapter; |
13 | import android.support.v4.view.ViewPager; | 13 | import android.support.v4.view.ViewPager; |
14 | -import android.text.Spannable; | ||
15 | -import android.text.SpannableString; | ||
16 | import android.text.TextUtils; | 14 | import android.text.TextUtils; |
17 | -import android.text.style.ForegroundColorSpan; | ||
18 | -import android.util.Log; | ||
19 | import android.view.Menu; | 15 | import android.view.Menu; |
20 | import android.view.MenuItem; | 16 | import android.view.MenuItem; |
21 | import android.view.View; | 17 | import android.view.View; |
22 | import android.widget.PopupMenu; | 18 | import android.widget.PopupMenu; |
23 | -import android.widget.RelativeLayout; | ||
24 | import android.widget.TextView; | 19 | import android.widget.TextView; |
25 | 20 | ||
26 | import com.google.gson.Gson; | 21 | import com.google.gson.Gson; |
@@ -77,7 +72,7 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -77,7 +72,7 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
77 | viewPager.setAdapter(myFragmentAdapter); | 72 | viewPager.setAdapter(myFragmentAdapter); |
78 | tabLayout.setupWithViewPager(viewPager); | 73 | tabLayout.setupWithViewPager(viewPager); |
79 | tabLayout.removeAllTabs(); | 74 | tabLayout.removeAllTabs(); |
80 | - tabLayout.addTab(tabLayout.newTab().setText("成长")); | 75 | + tabLayout.addTab(tabLayout.newTab().setText("应用")); |
81 | tabLayout.addTab(tabLayout.newTab().setText("报告")); | 76 | tabLayout.addTab(tabLayout.newTab().setText("报告")); |
82 | viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { | 77 | viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { |
83 | @Override | 78 | @Override |
@@ -97,13 +92,14 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -97,13 +92,14 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
97 | } | 92 | } |
98 | }); | 93 | }); |
99 | //在viewpager初始化之后加载 | 94 | //在viewpager初始化之后加载 |
100 | - mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME), 0, ""); | 95 | +// mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME), 0, ""); |
101 | } | 96 | } |
102 | 97 | ||
103 | 98 | ||
104 | @Override | 99 | @Override |
105 | public void onResume() { | 100 | public void onResume() { |
106 | super.onResume(); | 101 | super.onResume(); |
102 | + mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME), 0, ""); | ||
107 | } | 103 | } |
108 | 104 | ||
109 | @Override | 105 | @Override |
@@ -111,15 +107,16 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -111,15 +107,16 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
111 | switch (view.getId()) { | 107 | switch (view.getId()) { |
112 | case R.id.tvShaiXuan: | 108 | case R.id.tvShaiXuan: |
113 | if (null == shaiXuanPop) shaiXuanPop = new ShaiXuanPop(getActivity()); | 109 | if (null == shaiXuanPop) shaiXuanPop = new ShaiXuanPop(getActivity()); |
114 | - if (null!=chengZhangFragment2)chengZhangFragment2.showShaixuan(handler); | 110 | + if (null != chengZhangFragment2) chengZhangFragment2.showShaixuan(handler); |
115 | break; | 111 | break; |
116 | case R.id.tvName: | 112 | case R.id.tvName: |
117 | - showChildName(); | 113 | + if(childlist!=null&&childlist.size()>0) |
114 | + showChildName(); | ||
118 | break; | 115 | break; |
119 | } | 116 | } |
120 | } | 117 | } |
121 | 118 | ||
122 | - public void refreshChild(){ | 119 | + public void refreshChild() { |
123 | mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME), 0, ""); | 120 | mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME), 0, ""); |
124 | } | 121 | } |
125 | 122 | ||
@@ -179,28 +176,33 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -179,28 +176,33 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
179 | List<ChildBean> list = currentBean.getStudentClass(); | 176 | List<ChildBean> list = currentBean.getStudentClass(); |
180 | String currChildStr = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.CURRCHILDJSONSTR); | 177 | String currChildStr = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.CURRCHILDJSONSTR); |
181 | childlist.addAll(list); | 178 | childlist.addAll(list); |
182 | - | ||
183 | if (childlist == null || childlist.size() == 0) { | 179 | if (childlist == null || childlist.size() == 0) { |
184 | - if(null!=chengZhangFragment1)chengZhangFragment1.showNoData(); | ||
185 | - if(null!=chengZhangFragment2)chengZhangFragment2.showNoData(); | ||
186 | - } | ||
187 | - if (TextUtils.isEmpty(currChildStr)) { | ||
188 | - if (childlist != null && childlist.size() > 0) { | ||
189 | - tvName.setText(childlist.get(0).getStudentName()); | ||
190 | - jsonStr = g.toJson(childlist.get(0), ChildBean.class); | ||
191 | - } | 180 | + if (null != chengZhangFragment1) chengZhangFragment1.showNoData(); |
181 | + if (null != chengZhangFragment2) chengZhangFragment2.showNoData(); | ||
182 | + tvName.setText("未绑定"); | ||
183 | + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.CURRCHILDJSONSTR, ""); | ||
192 | } else { | 184 | } else { |
193 | - ChildBean childBean = g.fromJson(currChildStr, ChildBean.class); | ||
194 | - for (int i = 0; i < childlist.size(); i++) { | ||
195 | - if (childBean.getStudentId() == childlist.get(i).getStudentId()) { | ||
196 | - jsonStr = g.toJson(childlist.get(i), ChildBean.class); | ||
197 | - break; | 185 | + if (TextUtils.isEmpty(currChildStr)) { |
186 | + if (childlist != null && childlist.size() > 0) { | ||
187 | + tvName.setText(childlist.get(0).getStudentName()); | ||
188 | + jsonStr = g.toJson(childlist.get(0), ChildBean.class); | ||
189 | + } | ||
190 | + } else { | ||
191 | + ChildBean childBean = g.fromJson(currChildStr, ChildBean.class); | ||
192 | + for (int i = 0; i < childlist.size(); i++) { | ||
193 | + if (childBean.getStudentId() == childlist.get(i).getStudentId()) { | ||
194 | + jsonStr = g.toJson(childlist.get(i), ChildBean.class); | ||
195 | + break; | ||
196 | + } | ||
198 | } | 197 | } |
198 | + | ||
199 | + tvName.setText(childBean.getStudentName()); | ||
199 | } | 200 | } |
200 | - tvName.setText(childBean.getStudentName()); | 201 | + |
202 | + if (null != chengZhangFragment1) chengZhangFragment1.setChildJson(jsonStr); | ||
203 | + | ||
204 | + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.CURRCHILDJSONSTR, jsonStr); | ||
201 | } | 205 | } |
202 | - if (null != chengZhangFragment1) chengZhangFragment1.setChildJson(jsonStr); | ||
203 | - AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.CURRCHILDJSONSTR, jsonStr); | ||
204 | createSchoolMenu(); | 206 | createSchoolMenu(); |
205 | } | 207 | } |
206 | 208 | ||
@@ -219,8 +221,8 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -219,8 +221,8 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
219 | @Override | 221 | @Override |
220 | public void showError(String error) { | 222 | public void showError(String error) { |
221 | if (error.equals("访问的接口要求登录")) { | 223 | if (error.equals("访问的接口要求登录")) { |
222 | - if(null!=chengZhangFragment1)chengZhangFragment1.showNoData(); | ||
223 | - if(null!=chengZhangFragment2)chengZhangFragment2.showNoData(); | 224 | + if (null != chengZhangFragment1) chengZhangFragment1.showNoData(); |
225 | + if (null != chengZhangFragment2) chengZhangFragment2.showNoData(); | ||
224 | } | 226 | } |
225 | } | 227 | } |
226 | 228 | ||
@@ -232,9 +234,9 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -232,9 +234,9 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
232 | 234 | ||
233 | @Override | 235 | @Override |
234 | public CharSequence getPageTitle(int position) { | 236 | public CharSequence getPageTitle(int position) { |
235 | - if (position==0){ | 237 | + if (position == 0) { |
236 | return "应用"; | 238 | return "应用"; |
237 | - }else { | 239 | + } else { |
238 | return "报告"; | 240 | return "报告"; |
239 | } | 241 | } |
240 | } | 242 | } |
app/src/main/java/com/shunzhi/parent/ui/fragment/report/ChengZhangFragment.java
@@ -22,8 +22,6 @@ import android.widget.TextView; | @@ -22,8 +22,6 @@ import android.widget.TextView; | ||
22 | 22 | ||
23 | import com.amy.monthweek.materialcalendarview.MonthWeekMaterialCalendarView; | 23 | import com.amy.monthweek.materialcalendarview.MonthWeekMaterialCalendarView; |
24 | import com.google.gson.Gson; | 24 | import com.google.gson.Gson; |
25 | -import com.netease.nimlib.sdk.NIMClient; | ||
26 | -import com.netease.nimlib.sdk.mixpush.NIMPushClient; | ||
27 | import com.prolificinteractive.materialcalendarview.CalendarDay; | 25 | import com.prolificinteractive.materialcalendarview.CalendarDay; |
28 | import com.prolificinteractive.materialcalendarview.MaterialCalendarView; | 26 | import com.prolificinteractive.materialcalendarview.MaterialCalendarView; |
29 | import com.share.mvpsdk.base.BasePresenter; | 27 | import com.share.mvpsdk.base.BasePresenter; |
@@ -100,7 +98,7 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -100,7 +98,7 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
100 | layout_kaoqin = view.findViewById(R.id.layout_kaoqin); | 98 | layout_kaoqin = view.findViewById(R.id.layout_kaoqin); |
101 | layout_buka = view.findViewById(R.id.layout_buka); | 99 | layout_buka = view.findViewById(R.id.layout_buka); |
102 | layout_qingjia = view.findViewById(R.id.layout_qingjia); | 100 | layout_qingjia = view.findViewById(R.id.layout_qingjia); |
103 | - tvNoData=view.findViewById(R.id.tvNoData); | 101 | + tvNoData = view.findViewById(R.id.tvNoData); |
104 | calendarView_month_mode = view.findViewById(R.id.calendarView_month_mode); | 102 | calendarView_month_mode = view.findViewById(R.id.calendarView_month_mode); |
105 | monthWeekMaterialCalendarView = view.findViewById(R.id.slidelayout); | 103 | monthWeekMaterialCalendarView = view.findViewById(R.id.slidelayout); |
106 | layout_chengzhang = view.findViewById(R.id.layout_chengzhang); | 104 | layout_chengzhang = view.findViewById(R.id.layout_chengzhang); |
@@ -112,11 +110,12 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -112,11 +110,12 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
112 | show(); | 110 | show(); |
113 | } | 111 | } |
114 | 112 | ||
115 | - private void show() { | 113 | + public void show() { |
116 | Gson g = new Gson(); | 114 | Gson g = new Gson(); |
117 | if (type.equals(TYPE_CHENGZHANG)) { | 115 | if (type.equals(TYPE_CHENGZHANG)) { |
118 | layout_chengzhang.setVisibility(View.VISIBLE); | 116 | layout_chengzhang.setVisibility(View.VISIBLE); |
119 | layout_report.setVisibility(View.GONE); | 117 | layout_report.setVisibility(View.GONE); |
118 | + rl_noData.setVisibility(View.GONE); | ||
120 | childBean = g.fromJson(jsonStr, ChildBean.class); | 119 | childBean = g.fromJson(jsonStr, ChildBean.class); |
121 | 120 | ||
122 | } else { | 121 | } else { |
@@ -184,16 +183,16 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -184,16 +183,16 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
184 | 183 | ||
185 | @Override | 184 | @Override |
186 | public void onClick(View view) { | 185 | public void onClick(View view) { |
187 | - | 186 | + if(showOrderPopu()) |
187 | + return; | ||
188 | switch (view.getId()) { | 188 | switch (view.getId()) { |
189 | 189 | ||
190 | case R.id.layout_kaoqin: | 190 | case R.id.layout_kaoqin: |
191 | -// ApplySigninActivity.getInstance(getActivity(), jsonStr); | ||
192 | - showOrderPopu(); | 191 | + ApplySigninActivity.getInstance(getActivity(), jsonStr); |
192 | + | ||
193 | break; | 193 | break; |
194 | case R.id.layout_buka: | 194 | case R.id.layout_buka: |
195 | -// ApplyReplaceCardActivity.getInstance(getActivity(), jsonStr); | ||
196 | - showOrderPopu(); | 195 | + ApplyReplaceCardActivity.getInstance(getActivity(), jsonStr); |
197 | break; | 196 | break; |
198 | case R.id.layout_qingjia: | 197 | case R.id.layout_qingjia: |
199 | ToastUtils.showToast("正在努力开发中,敬请期待"); | 198 | ToastUtils.showToast("正在努力开发中,敬请期待"); |
@@ -201,17 +200,17 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -201,17 +200,17 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
201 | } | 200 | } |
202 | } | 201 | } |
203 | 202 | ||
204 | - private void showOrderPopu(){ | ||
205 | - if (null==childBean||childBean.getCount() == 0) { | 203 | + private boolean showOrderPopu() { |
204 | + if (null == childBean || childBean.getCount() == 0) { | ||
206 | final PopupWindow popupWindow = new PopupWindow(); | 205 | final PopupWindow popupWindow = new PopupWindow(); |
207 | popupWindow.setWidth(ViewGroup.LayoutParams.MATCH_PARENT); | 206 | popupWindow.setWidth(ViewGroup.LayoutParams.MATCH_PARENT); |
208 | popupWindow.setHeight(ViewGroup.LayoutParams.MATCH_PARENT); | 207 | popupWindow.setHeight(ViewGroup.LayoutParams.MATCH_PARENT); |
209 | backgroundAlpha(0.5f); | 208 | backgroundAlpha(0.5f); |
210 | View view1 = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_view, null); | 209 | View view1 = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_view, null); |
211 | TextView dialog_info = view1.findViewById(R.id.dialog_info); | 210 | TextView dialog_info = view1.findViewById(R.id.dialog_info); |
212 | - String text="请前往订购中心\n订购“智能校卫”\n才能够使用相关应用功能"; | 211 | + String text = "请前往订购中心\n订购“智能校卫”\n才能够使用相关应用功能"; |
213 | Spannable span = new SpannableString(text); | 212 | Spannable span = new SpannableString(text); |
214 | - span.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.xueqing_blue)),3,7,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | 213 | + span.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.xueqing_blue)), 3, 7, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); |
215 | dialog_info.setText(span); | 214 | dialog_info.setText(span); |
216 | dialog_info.setGravity(Gravity.CENTER); | 215 | dialog_info.setGravity(Gravity.CENTER); |
217 | TextView right_btn = view1.findViewById(R.id.right_btn); | 216 | TextView right_btn = view1.findViewById(R.id.right_btn); |
@@ -240,15 +239,17 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -240,15 +239,17 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
240 | 239 | ||
241 | popupWindow.setContentView(view1); | 240 | popupWindow.setContentView(view1); |
242 | popupWindow.showAtLocation(recyclerView, Gravity.CENTER, 0, 0); | 241 | popupWindow.showAtLocation(recyclerView, Gravity.CENTER, 0, 0); |
243 | - return; | 242 | + return true; |
244 | } | 243 | } |
245 | 244 | ||
246 | if (TextUtils.isEmpty(childBean.getCardNumber())) { | 245 | if (TextUtils.isEmpty(childBean.getCardNumber())) { |
247 | BankActivity.newInstance(getActivity(), "如果使用该应用,请前往激活孩子校园卡"); | 246 | BankActivity.newInstance(getActivity(), "如果使用该应用,请前往激活孩子校园卡"); |
248 | - return; | 247 | + return true; |
249 | 248 | ||
250 | } | 249 | } |
250 | + return false; | ||
251 | } | 251 | } |
252 | + | ||
252 | @NonNull | 253 | @NonNull |
253 | @Override | 254 | @Override |
254 | public BasePresenter initPresenter() { | 255 | public BasePresenter initPresenter() { |
@@ -277,18 +278,23 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -277,18 +278,23 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
277 | * 显示没有数据 | 278 | * 显示没有数据 |
278 | */ | 279 | */ |
279 | public void showNoData() { | 280 | public void showNoData() { |
280 | - if (type.equals(TYPE_REPORT)){ | 281 | + layout_chengzhang.setVisibility(View.GONE); |
282 | + layout_report.setVisibility(View.GONE); | ||
283 | + rl_noData.setVisibility(View.VISIBLE); | ||
284 | + if (type.equals(TYPE_REPORT)) { | ||
281 | tvNoData.setBackgroundDrawable(getResources().getDrawable(R.drawable.baogao_back)); | 285 | tvNoData.setBackgroundDrawable(getResources().getDrawable(R.drawable.baogao_back)); |
286 | + rl_noData.setGravity(Gravity.CENTER); | ||
287 | + tvNoData.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); | ||
282 | tvNoData.setText(""); | 288 | tvNoData.setText(""); |
283 | - }else | ||
284 | - setTextColor(); | 289 | + } else |
290 | + setTextColor(); | ||
285 | 291 | ||
286 | } | 292 | } |
287 | 293 | ||
288 | private void setTextColor() { | 294 | private void setTextColor() { |
289 | - String text="如需使用该模块,请先前往\n个人中心—我的孩子\n绑定孩子账号"; | 295 | + String text = "如需使用该模块,请先前往\n个人中心—我的孩子\n绑定孩子账号"; |
290 | Spannable span = new SpannableString(text); | 296 | Spannable span = new SpannableString(text); |
291 | - span.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.xueqing_blue)),13,22,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | 297 | + span.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.xueqing_blue)), 13, 22, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); |
292 | tvNoData.setText(span); | 298 | tvNoData.setText(span); |
293 | } | 299 | } |
294 | 300 |