Commit e04ba2c490ac3c3b24d1d1707d2fd907109cb078
1 parent
386e4785
Exists in
yxb_dev
and in
1 other branch
no message
Showing
8 changed files
with
71 additions
and
14 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/presenter/consult/ConsultPresenter.java
1 | package com.shunzhi.parent.presenter.consult; | 1 | package com.shunzhi.parent.presenter.consult; |
2 | 2 | ||
3 | -import android.util.Log; | ||
4 | import android.view.View; | 3 | import android.view.View; |
5 | import android.widget.LinearLayout; | 4 | import android.widget.LinearLayout; |
6 | 5 | ||
@@ -101,7 +100,13 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { | @@ -101,7 +100,13 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { | ||
101 | }, new Consumer<Throwable>() { | 100 | }, new Consumer<Throwable>() { |
102 | @Override | 101 | @Override |
103 | public void accept(Throwable throwable) throws Exception { | 102 | public void accept(Throwable throwable) throws Exception { |
104 | - OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | 103 | + try { |
104 | + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | ||
105 | + }catch (Exception e){ | ||
106 | + | ||
107 | + e.printStackTrace(); | ||
108 | + } | ||
109 | + | ||
105 | } | 110 | } |
106 | })); | 111 | })); |
107 | 112 |
app/src/main/java/com/shunzhi/parent/ui/activity/BankActivity.java
@@ -3,7 +3,10 @@ package com.shunzhi.parent.ui.activity; | @@ -3,7 +3,10 @@ package com.shunzhi.parent.ui.activity; | ||
3 | import android.content.Context; | 3 | import android.content.Context; |
4 | import android.content.Intent; | 4 | import android.content.Intent; |
5 | import android.os.Bundle; | 5 | import android.os.Bundle; |
6 | +import android.text.Spannable; | ||
7 | +import android.text.SpannableString; | ||
6 | import android.text.TextUtils; | 8 | import android.text.TextUtils; |
9 | +import android.text.style.ForegroundColorSpan; | ||
7 | import android.view.View; | 10 | import android.view.View; |
8 | import android.widget.ImageView; | 11 | import android.widget.ImageView; |
9 | import android.widget.TextView; | 12 | import android.widget.TextView; |
@@ -41,8 +44,15 @@ public class BankActivity extends BaseCompatActivity { | @@ -41,8 +44,15 @@ public class BankActivity extends BaseCompatActivity { | ||
41 | } | 44 | } |
42 | }); | 45 | }); |
43 | String info = getIntent().getStringExtra("info"); | 46 | String info = getIntent().getStringExtra("info"); |
44 | - if (!TextUtils.isEmpty(info)) | ||
45 | - tv_info.setText(info); | 47 | + if (!TextUtils.isEmpty(info)) { |
48 | + if (info.equals("如果使用该应用,请前往激活孩子校园卡")) { | ||
49 | + Spannable span = new SpannableString(info); | ||
50 | + span.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.xueqing_blue)), 11, 23, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | ||
51 | + tv_info.setText(span); | ||
52 | + } else { | ||
53 | + tv_info.setText(info); | ||
54 | + } | ||
55 | + } | ||
46 | 56 | ||
47 | } | 57 | } |
48 | 58 |
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
@@ -5,6 +5,7 @@ import android.content.Intent; | @@ -5,6 +5,7 @@ import android.content.Intent; | ||
5 | import android.graphics.Bitmap; | 5 | import android.graphics.Bitmap; |
6 | import android.os.Bundle; | 6 | import android.os.Bundle; |
7 | import android.text.TextUtils; | 7 | import android.text.TextUtils; |
8 | +import android.util.Log; | ||
8 | import android.view.View; | 9 | import android.view.View; |
9 | import android.webkit.JavascriptInterface; | 10 | import android.webkit.JavascriptInterface; |
10 | import android.webkit.WebChromeClient; | 11 | import android.webkit.WebChromeClient; |
@@ -134,6 +135,7 @@ public class WebViewActivity extends BaseCompatActivity { | @@ -134,6 +135,7 @@ public class WebViewActivity extends BaseCompatActivity { | ||
134 | 135 | ||
135 | initWebView(); | 136 | initWebView(); |
136 | initWebSetting(nesteScrollWebView.getSettings()); | 137 | initWebSetting(nesteScrollWebView.getSettings()); |
138 | + Log.e("aaaa",url); | ||
137 | nesteScrollWebView.loadUrl(url); | 139 | nesteScrollWebView.loadUrl(url); |
138 | } | 140 | } |
139 | 141 |
app/src/main/java/com/shunzhi/parent/ui/fragment/ReportFragment.java
@@ -11,7 +11,10 @@ import android.support.v4.app.Fragment; | @@ -11,7 +11,10 @@ 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; | ||
14 | import android.text.TextUtils; | 16 | import android.text.TextUtils; |
17 | +import android.text.style.ForegroundColorSpan; | ||
15 | import android.view.Menu; | 18 | import android.view.Menu; |
16 | import android.view.MenuItem; | 19 | import android.view.MenuItem; |
17 | import android.view.View; | 20 | import android.view.View; |
@@ -68,6 +71,7 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -68,6 +71,7 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
68 | tvName = view.findViewById(R.id.tvName); | 71 | tvName = view.findViewById(R.id.tvName); |
69 | tvShaiXuan = view.findViewById(R.id.tvShaiXuan); | 72 | tvShaiXuan = view.findViewById(R.id.tvShaiXuan); |
70 | tvNoData = view.findViewById(R.id.tvNoData); | 73 | tvNoData = view.findViewById(R.id.tvNoData); |
74 | + setTextColor(); | ||
71 | tabLayout = view.findViewById(R.id.tabLayout); | 75 | tabLayout = view.findViewById(R.id.tabLayout); |
72 | rl_noData = view.findViewById(R.id.rl_noData); | 76 | rl_noData = view.findViewById(R.id.rl_noData); |
73 | tvName.setOnClickListener(this); | 77 | tvName.setOnClickListener(this); |
@@ -99,6 +103,13 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -99,6 +103,13 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
99 | 103 | ||
100 | } | 104 | } |
101 | 105 | ||
106 | + private void setTextColor() { | ||
107 | + String text="如需使用该模块,请先前往\n个人中心—我的孩子\n绑定孩子账号"; | ||
108 | + Spannable span = new SpannableString(text); | ||
109 | + span.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.xueqing_blue)),13,22,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | ||
110 | + tvNoData.setText(span); | ||
111 | + } | ||
112 | + | ||
102 | 113 | ||
103 | @Override | 114 | @Override |
104 | public void onResume() { | 115 | public void onResume() { |
@@ -179,6 +190,9 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -179,6 +190,9 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
179 | if (childlist == null || childlist.size() == 0) { | 190 | if (childlist == null || childlist.size() == 0) { |
180 | rl_noData.setVisibility(View.VISIBLE); | 191 | rl_noData.setVisibility(View.VISIBLE); |
181 | viewPager.setVisibility(View.GONE); | 192 | viewPager.setVisibility(View.GONE); |
193 | + }else{ | ||
194 | + rl_noData.setVisibility(View.GONE); | ||
195 | + viewPager.setVisibility(View.VISIBLE); | ||
182 | } | 196 | } |
183 | if (TextUtils.isEmpty(currChildStr)) { | 197 | if (TextUtils.isEmpty(currChildStr)) { |
184 | if (childlist != null && childlist.size() > 0) { | 198 | if (childlist != null && childlist.size() > 0) { |
app/src/main/java/com/shunzhi/parent/ui/fragment/apply/ApplyReplaceCardFragment.java
@@ -10,7 +10,6 @@ import android.view.View; | @@ -10,7 +10,6 @@ import android.view.View; | ||
10 | import android.widget.Button; | 10 | import android.widget.Button; |
11 | import android.widget.EditText; | 11 | import android.widget.EditText; |
12 | import android.widget.TextView; | 12 | import android.widget.TextView; |
13 | -import android.widget.Toast; | ||
14 | 13 | ||
15 | import com.google.gson.Gson; | 14 | import com.google.gson.Gson; |
16 | import com.share.mvpsdk.base.BasePresenter; | 15 | import com.share.mvpsdk.base.BasePresenter; |
@@ -81,6 +80,8 @@ public class ApplyReplaceCardFragment extends BaseMVPCompatFragment<ApplyReplace | @@ -81,6 +80,8 @@ public class ApplyReplaceCardFragment extends BaseMVPCompatFragment<ApplyReplace | ||
81 | mPresenter.ReplaceCardDetail(currChildBean.getStudentId(), cardnum); | 80 | mPresenter.ReplaceCardDetail(currChildBean.getStudentId(), cardnum); |
82 | } | 81 | } |
83 | break; | 82 | break; |
83 | + case R.id.bt_cancle: | ||
84 | + getActivity().finish(); | ||
84 | default: | 85 | default: |
85 | break; | 86 | break; |
86 | } | 87 | } |
app/src/main/java/com/shunzhi/parent/ui/fragment/report/ChengZhangFragment.java
@@ -6,7 +6,10 @@ import android.os.Message; | @@ -6,7 +6,10 @@ import android.os.Message; | ||
6 | import android.support.annotation.NonNull; | 6 | import android.support.annotation.NonNull; |
7 | import android.support.annotation.Nullable; | 7 | import android.support.annotation.Nullable; |
8 | import android.support.v7.widget.RecyclerView; | 8 | import android.support.v7.widget.RecyclerView; |
9 | +import android.text.Spannable; | ||
10 | +import android.text.SpannableString; | ||
9 | import android.text.TextUtils; | 11 | import android.text.TextUtils; |
12 | +import android.text.style.ForegroundColorSpan; | ||
10 | import android.view.Gravity; | 13 | import android.view.Gravity; |
11 | import android.view.LayoutInflater; | 14 | import android.view.LayoutInflater; |
12 | import android.view.View; | 15 | import android.view.View; |
@@ -14,6 +17,7 @@ import android.view.ViewGroup; | @@ -14,6 +17,7 @@ import android.view.ViewGroup; | ||
14 | import android.view.WindowManager; | 17 | import android.view.WindowManager; |
15 | import android.widget.LinearLayout; | 18 | import android.widget.LinearLayout; |
16 | import android.widget.PopupWindow; | 19 | import android.widget.PopupWindow; |
20 | +import android.widget.RelativeLayout; | ||
17 | import android.widget.TextView; | 21 | import android.widget.TextView; |
18 | 22 | ||
19 | import com.amy.monthweek.materialcalendarview.MonthWeekMaterialCalendarView; | 23 | import com.amy.monthweek.materialcalendarview.MonthWeekMaterialCalendarView; |
@@ -77,6 +81,8 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -77,6 +81,8 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
77 | 81 | ||
78 | LinearLayout layout_chengzhang, layout_report, layout_kaoqin, layout_buka, layout_qingjia; | 82 | LinearLayout layout_chengzhang, layout_report, layout_kaoqin, layout_buka, layout_qingjia; |
79 | 83 | ||
84 | + RelativeLayout rl_noData; | ||
85 | + | ||
80 | @Override | 86 | @Override |
81 | public int getLayoutId() { | 87 | public int getLayoutId() { |
82 | return R.layout.fragment_cheng_zhang; | 88 | return R.layout.fragment_cheng_zhang; |
@@ -84,7 +90,7 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -84,7 +90,7 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
84 | 90 | ||
85 | @Override | 91 | @Override |
86 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 92 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
87 | - | 93 | + rl_noData = view.findViewById(R.id.rl_noData); |
88 | layout_report = view.findViewById(R.id.layout_report); | 94 | layout_report = view.findViewById(R.id.layout_report); |
89 | recyclerView = view.findViewById(R.id.recycle_report); | 95 | recyclerView = view.findViewById(R.id.recycle_report); |
90 | layout_kaoqin = view.findViewById(R.id.layout_kaoqin); | 96 | layout_kaoqin = view.findViewById(R.id.layout_kaoqin); |
@@ -111,8 +117,8 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -111,8 +117,8 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
111 | 117 | ||
112 | } else { | 118 | } else { |
113 | layout_chengzhang.setVisibility(View.GONE); | 119 | layout_chengzhang.setVisibility(View.GONE); |
114 | - layout_report.setVisibility(View.VISIBLE); | ||
115 | - | 120 | + layout_report.setVisibility(View.GONE); |
121 | + rl_noData.setVisibility(View.VISIBLE); | ||
116 | initCalendarView(); | 122 | initCalendarView(); |
117 | initReportList(); | 123 | initReportList(); |
118 | 124 | ||
@@ -181,7 +187,10 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -181,7 +187,10 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
181 | backgroundAlpha(0.5f); | 187 | backgroundAlpha(0.5f); |
182 | View view1 = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_view, null); | 188 | View view1 = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_view, null); |
183 | TextView dialog_info = view1.findViewById(R.id.dialog_info); | 189 | TextView dialog_info = view1.findViewById(R.id.dialog_info); |
184 | - dialog_info.setText("请前往订购中心\n订购“智能校卫”\n才能够使用相关应用功能"); | 190 | + String text="请前往订购中心\n订购“智能校卫”\n才能够使用相关应用功能"; |
191 | + Spannable span = new SpannableString(text); | ||
192 | + span.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.xueqing_blue)),3,7,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | ||
193 | + dialog_info.setText(span); | ||
185 | dialog_info.setGravity(Gravity.CENTER); | 194 | dialog_info.setGravity(Gravity.CENTER); |
186 | TextView right_btn = view1.findViewById(R.id.right_btn); | 195 | TextView right_btn = view1.findViewById(R.id.right_btn); |
187 | right_btn.setText("前往订购"); | 196 | right_btn.setText("前往订购"); |
@@ -213,7 +222,6 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -213,7 +222,6 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
213 | } | 222 | } |
214 | 223 | ||
215 | if (TextUtils.isEmpty(childBean.getCardNumber())) { | 224 | if (TextUtils.isEmpty(childBean.getCardNumber())) { |
216 | - | ||
217 | BankActivity.newInstance(getActivity(), "如果使用该应用,请前往激活孩子校园卡"); | 225 | BankActivity.newInstance(getActivity(), "如果使用该应用,请前往激活孩子校园卡"); |
218 | return; | 226 | return; |
219 | 227 |
app/src/main/res/layout/fragment_cheng_zhang.xml
@@ -120,5 +120,22 @@ | @@ -120,5 +120,22 @@ | ||
120 | </com.amy.monthweek.materialcalendarview.MonthWeekMaterialCalendarView> | 120 | </com.amy.monthweek.materialcalendarview.MonthWeekMaterialCalendarView> |
121 | 121 | ||
122 | </LinearLayout> | 122 | </LinearLayout> |
123 | + <RelativeLayout | ||
124 | + android:id="@+id/rl_noData" | ||
125 | + android:layout_width="match_parent" | ||
126 | + android:layout_height="match_parent" | ||
127 | + android:background="@color/white" | ||
128 | + android:visibility="gone"> | ||
129 | + | ||
130 | + <TextView | ||
131 | + android:id="@+id/tvNoData" | ||
132 | + android:layout_width="wrap_content" | ||
133 | + android:layout_height="wrap_content" | ||
134 | + android:layout_centerInParent="true" | ||
135 | + android:lineSpacingExtra="@dimen/size_dp_5" | ||
136 | + android:background="@drawable/baogao_back" | ||
137 | + android:textColor="@color/xueqing_blue" | ||
138 | + android:textSize="@dimen/size_dp_16" /> | ||
139 | + </RelativeLayout> | ||
123 | 140 | ||
124 | </FrameLayout> | 141 | </FrameLayout> |
app/src/main/res/layout/fragment_report.xml
@@ -74,12 +74,12 @@ | @@ -74,12 +74,12 @@ | ||
74 | 74 | ||
75 | <TextView | 75 | <TextView |
76 | android:id="@+id/tvNoData" | 76 | android:id="@+id/tvNoData" |
77 | - android:layout_width="wrap_content" | 77 | + android:layout_width="match_parent" |
78 | android:layout_height="wrap_content" | 78 | android:layout_height="wrap_content" |
79 | - android:layout_centerInParent="true" | ||
80 | - android:background="@drawable/baogao_back" | 79 | + android:layout_marginTop="30px" |
80 | + android:gravity="center" | ||
81 | android:lineSpacingExtra="@dimen/size_dp_5" | 81 | android:lineSpacingExtra="@dimen/size_dp_5" |
82 | - android:textColor="@color/xueqing_blue" | 82 | + android:text="如需使用该模块,请先前往\n个人中心—我的孩子\n绑定孩子账号" |
83 | android:textSize="@dimen/size_dp_16" /> | 83 | android:textSize="@dimen/size_dp_16" /> |
84 | </RelativeLayout> | 84 | </RelativeLayout> |
85 | 85 |