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 | 1 | package com.shunzhi.parent.presenter.consult; |
2 | 2 | |
3 | -import android.util.Log; | |
4 | 3 | import android.view.View; |
5 | 4 | import android.widget.LinearLayout; |
6 | 5 | |
... | ... | @@ -101,7 +100,13 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
101 | 100 | }, new Consumer<Throwable>() { |
102 | 101 | @Override |
103 | 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 | 3 | import android.content.Context; |
4 | 4 | import android.content.Intent; |
5 | 5 | import android.os.Bundle; |
6 | +import android.text.Spannable; | |
7 | +import android.text.SpannableString; | |
6 | 8 | import android.text.TextUtils; |
9 | +import android.text.style.ForegroundColorSpan; | |
7 | 10 | import android.view.View; |
8 | 11 | import android.widget.ImageView; |
9 | 12 | import android.widget.TextView; |
... | ... | @@ -41,8 +44,15 @@ public class BankActivity extends BaseCompatActivity { |
41 | 44 | } |
42 | 45 | }); |
43 | 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 | 5 | import android.graphics.Bitmap; |
6 | 6 | import android.os.Bundle; |
7 | 7 | import android.text.TextUtils; |
8 | +import android.util.Log; | |
8 | 9 | import android.view.View; |
9 | 10 | import android.webkit.JavascriptInterface; |
10 | 11 | import android.webkit.WebChromeClient; |
... | ... | @@ -134,6 +135,7 @@ public class WebViewActivity extends BaseCompatActivity { |
134 | 135 | |
135 | 136 | initWebView(); |
136 | 137 | initWebSetting(nesteScrollWebView.getSettings()); |
138 | + Log.e("aaaa",url); | |
137 | 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 | 11 | import android.support.v4.app.FragmentManager; |
12 | 12 | import android.support.v4.app.FragmentPagerAdapter; |
13 | 13 | import android.support.v4.view.ViewPager; |
14 | +import android.text.Spannable; | |
15 | +import android.text.SpannableString; | |
14 | 16 | import android.text.TextUtils; |
17 | +import android.text.style.ForegroundColorSpan; | |
15 | 18 | import android.view.Menu; |
16 | 19 | import android.view.MenuItem; |
17 | 20 | import android.view.View; |
... | ... | @@ -68,6 +71,7 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil |
68 | 71 | tvName = view.findViewById(R.id.tvName); |
69 | 72 | tvShaiXuan = view.findViewById(R.id.tvShaiXuan); |
70 | 73 | tvNoData = view.findViewById(R.id.tvNoData); |
74 | + setTextColor(); | |
71 | 75 | tabLayout = view.findViewById(R.id.tabLayout); |
72 | 76 | rl_noData = view.findViewById(R.id.rl_noData); |
73 | 77 | tvName.setOnClickListener(this); |
... | ... | @@ -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 | 114 | @Override |
104 | 115 | public void onResume() { |
... | ... | @@ -179,6 +190,9 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil |
179 | 190 | if (childlist == null || childlist.size() == 0) { |
180 | 191 | rl_noData.setVisibility(View.VISIBLE); |
181 | 192 | viewPager.setVisibility(View.GONE); |
193 | + }else{ | |
194 | + rl_noData.setVisibility(View.GONE); | |
195 | + viewPager.setVisibility(View.VISIBLE); | |
182 | 196 | } |
183 | 197 | if (TextUtils.isEmpty(currChildStr)) { |
184 | 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 | 10 | import android.widget.Button; |
11 | 11 | import android.widget.EditText; |
12 | 12 | import android.widget.TextView; |
13 | -import android.widget.Toast; | |
14 | 13 | |
15 | 14 | import com.google.gson.Gson; |
16 | 15 | import com.share.mvpsdk.base.BasePresenter; |
... | ... | @@ -81,6 +80,8 @@ public class ApplyReplaceCardFragment extends BaseMVPCompatFragment<ApplyReplace |
81 | 80 | mPresenter.ReplaceCardDetail(currChildBean.getStudentId(), cardnum); |
82 | 81 | } |
83 | 82 | break; |
83 | + case R.id.bt_cancle: | |
84 | + getActivity().finish(); | |
84 | 85 | default: |
85 | 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 | 6 | import android.support.annotation.NonNull; |
7 | 7 | import android.support.annotation.Nullable; |
8 | 8 | import android.support.v7.widget.RecyclerView; |
9 | +import android.text.Spannable; | |
10 | +import android.text.SpannableString; | |
9 | 11 | import android.text.TextUtils; |
12 | +import android.text.style.ForegroundColorSpan; | |
10 | 13 | import android.view.Gravity; |
11 | 14 | import android.view.LayoutInflater; |
12 | 15 | import android.view.View; |
... | ... | @@ -14,6 +17,7 @@ import android.view.ViewGroup; |
14 | 17 | import android.view.WindowManager; |
15 | 18 | import android.widget.LinearLayout; |
16 | 19 | import android.widget.PopupWindow; |
20 | +import android.widget.RelativeLayout; | |
17 | 21 | import android.widget.TextView; |
18 | 22 | |
19 | 23 | import com.amy.monthweek.materialcalendarview.MonthWeekMaterialCalendarView; |
... | ... | @@ -77,6 +81,8 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep |
77 | 81 | |
78 | 82 | LinearLayout layout_chengzhang, layout_report, layout_kaoqin, layout_buka, layout_qingjia; |
79 | 83 | |
84 | + RelativeLayout rl_noData; | |
85 | + | |
80 | 86 | @Override |
81 | 87 | public int getLayoutId() { |
82 | 88 | return R.layout.fragment_cheng_zhang; |
... | ... | @@ -84,7 +90,7 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep |
84 | 90 | |
85 | 91 | @Override |
86 | 92 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
87 | - | |
93 | + rl_noData = view.findViewById(R.id.rl_noData); | |
88 | 94 | layout_report = view.findViewById(R.id.layout_report); |
89 | 95 | recyclerView = view.findViewById(R.id.recycle_report); |
90 | 96 | layout_kaoqin = view.findViewById(R.id.layout_kaoqin); |
... | ... | @@ -111,8 +117,8 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep |
111 | 117 | |
112 | 118 | } else { |
113 | 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 | 122 | initCalendarView(); |
117 | 123 | initReportList(); |
118 | 124 | |
... | ... | @@ -181,7 +187,10 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep |
181 | 187 | backgroundAlpha(0.5f); |
182 | 188 | View view1 = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_view, null); |
183 | 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 | 194 | dialog_info.setGravity(Gravity.CENTER); |
186 | 195 | TextView right_btn = view1.findViewById(R.id.right_btn); |
187 | 196 | right_btn.setText("前往订购"); |
... | ... | @@ -213,7 +222,6 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep |
213 | 222 | } |
214 | 223 | |
215 | 224 | if (TextUtils.isEmpty(childBean.getCardNumber())) { |
216 | - | |
217 | 225 | BankActivity.newInstance(getActivity(), "如果使用该应用,请前往激活孩子校园卡"); |
218 | 226 | return; |
219 | 227 | ... | ... |
app/src/main/res/layout/fragment_cheng_zhang.xml
... | ... | @@ -120,5 +120,22 @@ |
120 | 120 | </com.amy.monthweek.materialcalendarview.MonthWeekMaterialCalendarView> |
121 | 121 | |
122 | 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 | 141 | </FrameLayout> | ... | ... |
app/src/main/res/layout/fragment_report.xml
... | ... | @@ -74,12 +74,12 @@ |
74 | 74 | |
75 | 75 | <TextView |
76 | 76 | android:id="@+id/tvNoData" |
77 | - android:layout_width="wrap_content" | |
77 | + android:layout_width="match_parent" | |
78 | 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 | 81 | android:lineSpacingExtra="@dimen/size_dp_5" |
82 | - android:textColor="@color/xueqing_blue" | |
82 | + android:text="如需使用该模块,请先前往\n个人中心—我的孩子\n绑定孩子账号" | |
83 | 83 | android:textSize="@dimen/size_dp_16" /> |
84 | 84 | </RelativeLayout> |
85 | 85 | ... | ... |