Commit f62d7dcc7b3e383cd1faebcbac48aca2709b65da
1 parent
d25fb468
Exists in
yxb_dev
and in
1 other branch
no message
Showing
15 changed files
with
110 additions
and
99 deletions
Show diff stats
.idea/misc.xml
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | </value> | 24 | </value> |
25 | </option> | 25 | </option> |
26 | </component> | 26 | </component> |
27 | - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | 27 | + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> |
28 | <output url="file://$PROJECT_DIR$/build/classes" /> | 28 | <output url="file://$PROJECT_DIR$/build/classes" /> |
29 | </component> | 29 | </component> |
30 | <component name="ProjectType"> | 30 | <component name="ProjectType"> |
app/build.gradle
@@ -16,8 +16,8 @@ android { | @@ -16,8 +16,8 @@ android { | ||
16 | applicationId "com.shunzhi.parent" | 16 | applicationId "com.shunzhi.parent" |
17 | minSdkVersion 16 | 17 | minSdkVersion 16 |
18 | targetSdkVersion 26 | 18 | targetSdkVersion 26 |
19 | - versionCode 102 | ||
20 | - versionName "1.0.2" | 19 | + versionCode 104 |
20 | + versionName "1.0.4" | ||
21 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | 21 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
22 | javaCompileOptions { | 22 | javaCompileOptions { |
23 | annotationProcessorOptions { | 23 | annotationProcessorOptions { |
app/src/main/java/com/shunzhi/parent/contract/loginandregister/LoginAndRegisterContract.java
@@ -44,7 +44,7 @@ public interface LoginAndRegisterContract { | @@ -44,7 +44,7 @@ public interface LoginAndRegisterContract { | ||
44 | interface ILoginView extends IBaseFragment { | 44 | interface ILoginView extends IBaseFragment { |
45 | 45 | ||
46 | //更新用户信息 | 46 | //更新用户信息 |
47 | - void getUserInfo(int type); | 47 | + void getUserInfo(int type,String message); |
48 | void showerror(String error); | 48 | void showerror(String error); |
49 | 49 | ||
50 | } | 50 | } |
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
@@ -50,7 +50,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -50,7 +50,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
50 | @Override | 50 | @Override |
51 | public void accept(JsonObject jsonObject) throws Exception { | 51 | public void accept(JsonObject jsonObject) throws Exception { |
52 | try { | 52 | try { |
53 | -// Log.d("66666","jsonObject="+jsonObject); | 53 | +// Log.d("66666","getLoginResult="+jsonObject); |
54 | if (jsonObject != null && !TextUtils.isEmpty(jsonObject.get("access_token").getAsString())) { | 54 | if (jsonObject != null && !TextUtils.isEmpty(jsonObject.get("access_token").getAsString())) { |
55 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ACCESS_TOKEN, jsonObject.get("access_token").getAsString()); | 55 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ACCESS_TOKEN, jsonObject.get("access_token").getAsString()); |
56 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, loginName); | 56 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, loginName); |
@@ -62,6 +62,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -62,6 +62,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
62 | } | 62 | } |
63 | } catch (Exception e) { | 63 | } catch (Exception e) { |
64 | e.printStackTrace(); | 64 | e.printStackTrace(); |
65 | + getUserInfo(loginName, -1, "登录失败"); | ||
65 | ToastUtils.showToast("登录失败:" + e.toString()); | 66 | ToastUtils.showToast("登录失败:" + e.toString()); |
66 | } | 67 | } |
67 | } | 68 | } |
@@ -106,7 +107,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -106,7 +107,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
106 | //TODO 注册成功返回 | 107 | //TODO 注册成功返回 |
107 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, adminName); | 108 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, adminName); |
108 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, password); | 109 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, password); |
109 | - mIView.getUserInfo(1); | 110 | + mIView.getUserInfo(1,""); |
110 | } | 111 | } |
111 | }, new Consumer<Throwable>() { | 112 | }, new Consumer<Throwable>() { |
112 | @Override | 113 | @Override |
@@ -157,7 +158,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -157,7 +158,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
157 | mRxManager.register(mIModel.getUserInfo(mobile, school_id, captcha).subscribe(new Consumer<UserInfo>() { | 158 | mRxManager.register(mIModel.getUserInfo(mobile, school_id, captcha).subscribe(new Consumer<UserInfo>() { |
158 | @Override | 159 | @Override |
159 | public void accept(UserInfo userInfo) throws Exception { | 160 | public void accept(UserInfo userInfo) throws Exception { |
160 | - Log.d("77777","userInfo="+userInfo); | 161 | +// Log.d("77777","userInfo="+userInfo); |
161 | if (userInfo != null) { | 162 | if (userInfo != null) { |
162 | CurrentBean currentBean = userInfo.getData(); | 163 | CurrentBean currentBean = userInfo.getData(); |
163 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, currentBean.getMobile()); | 164 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, currentBean.getMobile()); |
@@ -180,7 +181,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -180,7 +181,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
180 | 181 | ||
181 | } else { | 182 | } else { |
182 | LoginAndRegistFragment.progressDialog.dismiss(); | 183 | LoginAndRegistFragment.progressDialog.dismiss(); |
183 | - ToastUtils.showToast("错误"); | 184 | + ToastUtils.showToast(userInfo.getMessage()); |
184 | } | 185 | } |
185 | } | 186 | } |
186 | }, new Consumer<Throwable>() { | 187 | }, new Consumer<Throwable>() { |
@@ -208,10 +209,12 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -208,10 +209,12 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
208 | mRxManager.register(mIModel.nimLoginResult(account, password).subscribe(new Consumer<NIMLoginResultBean>() { | 209 | mRxManager.register(mIModel.nimLoginResult(account, password).subscribe(new Consumer<NIMLoginResultBean>() { |
209 | @Override | 210 | @Override |
210 | public void accept(NIMLoginResultBean bean) throws Exception { | 211 | public void accept(NIMLoginResultBean bean) throws Exception { |
211 | - Log.d("77777","NIMLoginResultBean="+bean); | 212 | +// Log.d("77777","NIMLoginResultBean="+bean); |
212 | if (bean.isSuccess()) { | 213 | if (bean.isSuccess()) { |
213 | AppConfig.ISLOGIN = true; | 214 | AppConfig.ISLOGIN = true; |
214 | - mIView.getUserInfo(0); | 215 | + mIView.getUserInfo(0,""); |
216 | + }else { | ||
217 | + mIView.getUserInfo(-1,"通讯登录失败:"+bean.getResultCode()); | ||
215 | } | 218 | } |
216 | } | 219 | } |
217 | })); | 220 | })); |
@@ -222,12 +225,13 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -222,12 +225,13 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
222 | @Override | 225 | @Override |
223 | public void accept(JsonObject jsonObject) throws Exception { | 226 | public void accept(JsonObject jsonObject) throws Exception { |
224 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, adminName); | 227 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, adminName); |
225 | - mIView.getUserInfo(2); | 228 | + mIView.getUserInfo(2,""); |
226 | } | 229 | } |
227 | }, new Consumer<Throwable>() { | 230 | }, new Consumer<Throwable>() { |
228 | @Override | 231 | @Override |
229 | public void accept(Throwable throwable) throws Exception { | 232 | public void accept(Throwable throwable) throws Exception { |
230 | - OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | 233 | + mIView.getUserInfo(-1,throwable.getMessage()); |
234 | +// OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | ||
231 | } | 235 | } |
232 | })); | 236 | })); |
233 | 237 |
app/src/main/java/com/shunzhi/parent/ui/MainActivity.java
@@ -16,6 +16,7 @@ import com.shunzhi.parent.R; | @@ -16,6 +16,7 @@ import com.shunzhi.parent.R; | ||
16 | import com.shunzhi.parent.bean.message.PHMessage; | 16 | import com.shunzhi.parent.bean.message.PHMessage; |
17 | import com.shunzhi.parent.bean.message.PHMessageDao; | 17 | import com.shunzhi.parent.bean.message.PHMessageDao; |
18 | import com.shunzhi.parent.manager.MessageManager; | 18 | import com.shunzhi.parent.manager.MessageManager; |
19 | +import com.shunzhi.parent.manager.UpdateManager; | ||
19 | import com.shunzhi.parent.ui.fragment.ConsultFragment; | 20 | import com.shunzhi.parent.ui.fragment.ConsultFragment; |
20 | import com.shunzhi.parent.ui.fragment.MineFragment; | 21 | import com.shunzhi.parent.ui.fragment.MineFragment; |
21 | import com.shunzhi.parent.ui.fragment.ReportFragment; | 22 | import com.shunzhi.parent.ui.fragment.ReportFragment; |
@@ -45,7 +46,7 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils. | @@ -45,7 +46,7 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils. | ||
45 | PermissionUtils.requestMultiPermissions(this, this); | 46 | PermissionUtils.requestMultiPermissions(this, this); |
46 | bottom_navigationView = findViewById(R.id.bottom_navigationView); | 47 | bottom_navigationView = findViewById(R.id.bottom_navigationView); |
47 | BottomNavigationViewHelper.disableShiftMode(bottom_navigationView); | 48 | BottomNavigationViewHelper.disableShiftMode(bottom_navigationView); |
48 | - | 49 | + UpdateManager.getInstance().setContext(this).isUpdate(false); |
49 | bottom_navigationView.setSelectedItemId(R.id.bottom_navigationView); | 50 | bottom_navigationView.setSelectedItemId(R.id.bottom_navigationView); |
50 | bottom_navigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() { | 51 | bottom_navigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() { |
51 | @Override | 52 | @Override |
@@ -105,6 +106,7 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils. | @@ -105,6 +106,7 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils. | ||
105 | else fragmentTransaction.hide(fragments[i]); | 106 | else fragmentTransaction.hide(fragments[i]); |
106 | } | 107 | } |
107 | if (index == CONSULT_INDEX) consultFragment.refresh(); | 108 | if (index == CONSULT_INDEX) consultFragment.refresh(); |
109 | + if (index==REPORT_INDEX)reportFragment.refreshChild(); | ||
108 | // else if (index == CEPING_INDEX) cePingFragment.refresh(); | 110 | // else if (index == CEPING_INDEX) cePingFragment.refresh(); |
109 | fragmentTransaction.commit(); | 111 | fragmentTransaction.commit(); |
110 | } | 112 | } |
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
@@ -101,7 +101,7 @@ public class WebViewActivity extends BaseCompatActivity { | @@ -101,7 +101,7 @@ public class WebViewActivity extends BaseCompatActivity { | ||
101 | if (token != null && !"".equals(token) && !TextUtils.isEmpty(token)) { | 101 | if (token != null && !"".equals(token) && !TextUtils.isEmpty(token)) { |
102 | url = url + "&Token=" + token; | 102 | url = url + "&Token=" + token; |
103 | } | 103 | } |
104 | - Log.d("66666","url="+url); | 104 | +// Log.d("66666","url="+url); |
105 | if (type == AppConfig.BINDING_SUCCESS_HEZUO) { | 105 | if (type == AppConfig.BINDING_SUCCESS_HEZUO) { |
106 | binding_success.setVisibility(View.VISIBLE); | 106 | binding_success.setVisibility(View.VISIBLE); |
107 | binding_success2.setVisibility(View.GONE); | 107 | binding_success2.setVisibility(View.GONE); |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
@@ -101,8 +101,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -101,8 +101,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
101 | videoplayer.replayTextView.setVisibility(View.GONE); | 101 | videoplayer.replayTextView.setVisibility(View.GONE); |
102 | videoplayer.backButton.setVisibility(View.GONE); | 102 | videoplayer.backButton.setVisibility(View.GONE); |
103 | 103 | ||
104 | - mPresenter.getBanners("2", AppContext.getInstance().district); | ||
105 | - | ||
106 | initBroadCast(); | 104 | initBroadCast(); |
107 | 105 | ||
108 | initListeners(); | 106 | initListeners(); |
@@ -114,6 +112,9 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -114,6 +112,9 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
114 | // ToastUtils.showToast("scrollX="+nesteScrollView.getMeasuredHeight()+"scrollY="+scrollY+"oldScrollX="+oldScrollX+"oldScrollY="+oldScrollY+"layout_consult="+layout_consult.getMeasuredHeight()); | 112 | // ToastUtils.showToast("scrollX="+nesteScrollView.getMeasuredHeight()+"scrollY="+scrollY+"oldScrollX="+oldScrollX+"oldScrollY="+oldScrollY+"layout_consult="+layout_consult.getMeasuredHeight()); |
115 | } | 113 | } |
116 | }); | 114 | }); |
115 | + | ||
116 | + mPresenter.getBanners("2", AppContext.getInstance().district); | ||
117 | + | ||
117 | } | 118 | } |
118 | 119 | ||
119 | private void initRecycler() { | 120 | private void initRecycler() { |
@@ -213,7 +214,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | @@ -213,7 +214,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu | ||
213 | 214 | ||
214 | } | 215 | } |
215 | 216 | ||
216 | - | ||
217 | private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { | 217 | private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { |
218 | @Override | 218 | @Override |
219 | public void onReceive(Context context, Intent intent) { | 219 | public void onReceive(Context context, Intent intent) { |
app/src/main/java/com/shunzhi/parent/ui/fragment/ReportFragment.java
@@ -15,6 +15,7 @@ import android.text.Spannable; | @@ -15,6 +15,7 @@ import android.text.Spannable; | ||
15 | import android.text.SpannableString; | 15 | import android.text.SpannableString; |
16 | import android.text.TextUtils; | 16 | import android.text.TextUtils; |
17 | import android.text.style.ForegroundColorSpan; | 17 | import android.text.style.ForegroundColorSpan; |
18 | +import android.util.Log; | ||
18 | import android.view.Menu; | 19 | import android.view.Menu; |
19 | import android.view.MenuItem; | 20 | import android.view.MenuItem; |
20 | import android.view.View; | 21 | import android.view.View; |
@@ -43,14 +44,12 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -43,14 +44,12 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
43 | implements MyChildContract.IMyChildView, View.OnClickListener { | 44 | implements MyChildContract.IMyChildView, View.OnClickListener { |
44 | ViewPager viewPager; | 45 | ViewPager viewPager; |
45 | 46 | ||
46 | - TextView tvDate, tvShaiXuan, tvNoData, tvName; | 47 | + TextView tvDate, tvShaiXuan, tvName; |
47 | 48 | ||
48 | MyFragmentAdapter myFragmentAdapter = null; | 49 | MyFragmentAdapter myFragmentAdapter = null; |
49 | 50 | ||
50 | TabLayout tabLayout; | 51 | TabLayout tabLayout; |
51 | 52 | ||
52 | - RelativeLayout rl_noData; | ||
53 | - | ||
54 | ChengZhangFragment chengZhangFragment1 = null, chengZhangFragment2 = null;//成长、报告页面 | 53 | ChengZhangFragment chengZhangFragment1 = null, chengZhangFragment2 = null;//成长、报告页面 |
55 | 54 | ||
56 | ShaiXuanPop shaiXuanPop = null; | 55 | ShaiXuanPop shaiXuanPop = null; |
@@ -70,10 +69,7 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -70,10 +69,7 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
70 | tvDate = view.findViewById(R.id.tvDate); | 69 | tvDate = view.findViewById(R.id.tvDate); |
71 | tvName = view.findViewById(R.id.tvName); | 70 | tvName = view.findViewById(R.id.tvName); |
72 | tvShaiXuan = view.findViewById(R.id.tvShaiXuan); | 71 | tvShaiXuan = view.findViewById(R.id.tvShaiXuan); |
73 | - tvNoData = view.findViewById(R.id.tvNoData); | ||
74 | - setTextColor(); | ||
75 | tabLayout = view.findViewById(R.id.tabLayout); | 72 | tabLayout = view.findViewById(R.id.tabLayout); |
76 | - rl_noData = view.findViewById(R.id.rl_noData); | ||
77 | tvName.setOnClickListener(this); | 73 | tvName.setOnClickListener(this); |
78 | tvName.setEllipsize(TextUtils.TruncateAt.END); | 74 | tvName.setEllipsize(TextUtils.TruncateAt.END); |
79 | tvShaiXuan.setOnClickListener(this); | 75 | tvShaiXuan.setOnClickListener(this); |
@@ -100,21 +96,14 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -100,21 +96,14 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
100 | 96 | ||
101 | } | 97 | } |
102 | }); | 98 | }); |
103 | - | ||
104 | - } | ||
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); | 99 | + //在viewpager初始化之后加载 |
100 | + mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME), 0, ""); | ||
111 | } | 101 | } |
112 | 102 | ||
113 | 103 | ||
114 | @Override | 104 | @Override |
115 | public void onResume() { | 105 | public void onResume() { |
116 | super.onResume(); | 106 | super.onResume(); |
117 | - mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME), 0, ""); | ||
118 | } | 107 | } |
119 | 108 | ||
120 | @Override | 109 | @Override |
@@ -122,7 +111,7 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -122,7 +111,7 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
122 | switch (view.getId()) { | 111 | switch (view.getId()) { |
123 | case R.id.tvShaiXuan: | 112 | case R.id.tvShaiXuan: |
124 | if (null == shaiXuanPop) shaiXuanPop = new ShaiXuanPop(getActivity()); | 113 | if (null == shaiXuanPop) shaiXuanPop = new ShaiXuanPop(getActivity()); |
125 | - chengZhangFragment2.showShaixuan(handler); | 114 | + if (null!=chengZhangFragment2)chengZhangFragment2.showShaixuan(handler); |
126 | break; | 115 | break; |
127 | case R.id.tvName: | 116 | case R.id.tvName: |
128 | showChildName(); | 117 | showChildName(); |
@@ -130,6 +119,10 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -130,6 +119,10 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
130 | } | 119 | } |
131 | } | 120 | } |
132 | 121 | ||
122 | + public void refreshChild(){ | ||
123 | + mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME), 0, ""); | ||
124 | + } | ||
125 | + | ||
133 | private void showChildName() { | 126 | private void showChildName() { |
134 | childMenu.show(); | 127 | childMenu.show(); |
135 | } | 128 | } |
@@ -188,11 +181,8 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -188,11 +181,8 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
188 | childlist.addAll(list); | 181 | childlist.addAll(list); |
189 | 182 | ||
190 | if (childlist == null || childlist.size() == 0) { | 183 | if (childlist == null || childlist.size() == 0) { |
191 | - rl_noData.setVisibility(View.VISIBLE); | ||
192 | - viewPager.setVisibility(View.GONE); | ||
193 | - }else{ | ||
194 | - rl_noData.setVisibility(View.GONE); | ||
195 | - viewPager.setVisibility(View.VISIBLE); | 184 | + if(null!=chengZhangFragment1)chengZhangFragment1.showNoData(); |
185 | + if(null!=chengZhangFragment2)chengZhangFragment2.showNoData(); | ||
196 | } | 186 | } |
197 | if (TextUtils.isEmpty(currChildStr)) { | 187 | if (TextUtils.isEmpty(currChildStr)) { |
198 | if (childlist != null && childlist.size() > 0) { | 188 | if (childlist != null && childlist.size() > 0) { |
@@ -229,8 +219,8 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | @@ -229,8 +219,8 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil | ||
229 | @Override | 219 | @Override |
230 | public void showError(String error) { | 220 | public void showError(String error) { |
231 | if (error.equals("访问的接口要求登录")) { | 221 | if (error.equals("访问的接口要求登录")) { |
232 | - rl_noData.setVisibility(View.VISIBLE); | ||
233 | - viewPager.setVisibility(View.GONE); | 222 | + if(null!=chengZhangFragment1)chengZhangFragment1.showNoData(); |
223 | + if(null!=chengZhangFragment2)chengZhangFragment2.showNoData(); | ||
234 | } | 224 | } |
235 | } | 225 | } |
236 | 226 |
app/src/main/java/com/shunzhi/parent/ui/fragment/loginandregistfragment/LoginAndRegistFragment.java
@@ -139,7 +139,7 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -139,7 +139,7 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
139 | 139 | ||
140 | 140 | ||
141 | @Override | 141 | @Override |
142 | - public void getUserInfo(int type) { | 142 | + public void getUserInfo(int type,String message) { |
143 | progressDialog.dismiss(); | 143 | progressDialog.dismiss(); |
144 | if (type == 0) { | 144 | if (type == 0) { |
145 | startActivity(new Intent().setClass(getActivity(), MainActivity.class)); | 145 | startActivity(new Intent().setClass(getActivity(), MainActivity.class)); |
@@ -177,7 +177,7 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -177,7 +177,7 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
177 | startActivity(new Intent().putExtra("type", "登录").setClass(getActivity(), LoginAndRegistActivity.class)); | 177 | startActivity(new Intent().putExtra("type", "登录").setClass(getActivity(), LoginAndRegistActivity.class)); |
178 | phoneNumber.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); | 178 | phoneNumber.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); |
179 | password.setFocusable(true); | 179 | password.setFocusable(true); |
180 | - } | 180 | + }else ToastUtils.showToast(message); |
181 | 181 | ||
182 | 182 | ||
183 | } | 183 | } |
app/src/main/java/com/shunzhi/parent/ui/fragment/report/ChengZhangFragment.java
@@ -22,6 +22,8 @@ import android.widget.TextView; | @@ -22,6 +22,8 @@ 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; | ||
25 | import com.prolificinteractive.materialcalendarview.CalendarDay; | 27 | import com.prolificinteractive.materialcalendarview.CalendarDay; |
26 | import com.prolificinteractive.materialcalendarview.MaterialCalendarView; | 28 | import com.prolificinteractive.materialcalendarview.MaterialCalendarView; |
27 | import com.share.mvpsdk.base.BasePresenter; | 29 | import com.share.mvpsdk.base.BasePresenter; |
@@ -83,6 +85,8 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -83,6 +85,8 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
83 | 85 | ||
84 | RelativeLayout rl_noData; | 86 | RelativeLayout rl_noData; |
85 | 87 | ||
88 | + TextView tvNoData; | ||
89 | + | ||
86 | @Override | 90 | @Override |
87 | public int getLayoutId() { | 91 | public int getLayoutId() { |
88 | return R.layout.fragment_cheng_zhang; | 92 | return R.layout.fragment_cheng_zhang; |
@@ -96,10 +100,10 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -96,10 +100,10 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
96 | layout_kaoqin = view.findViewById(R.id.layout_kaoqin); | 100 | layout_kaoqin = view.findViewById(R.id.layout_kaoqin); |
97 | layout_buka = view.findViewById(R.id.layout_buka); | 101 | layout_buka = view.findViewById(R.id.layout_buka); |
98 | layout_qingjia = view.findViewById(R.id.layout_qingjia); | 102 | layout_qingjia = view.findViewById(R.id.layout_qingjia); |
103 | + tvNoData=view.findViewById(R.id.tvNoData); | ||
99 | calendarView_month_mode = view.findViewById(R.id.calendarView_month_mode); | 104 | calendarView_month_mode = view.findViewById(R.id.calendarView_month_mode); |
100 | monthWeekMaterialCalendarView = view.findViewById(R.id.slidelayout); | 105 | monthWeekMaterialCalendarView = view.findViewById(R.id.slidelayout); |
101 | layout_chengzhang = view.findViewById(R.id.layout_chengzhang); | 106 | layout_chengzhang = view.findViewById(R.id.layout_chengzhang); |
102 | - | ||
103 | layout_kaoqin.setOnClickListener(this); | 107 | layout_kaoqin.setOnClickListener(this); |
104 | layout_buka.setOnClickListener(this); | 108 | layout_buka.setOnClickListener(this); |
105 | layout_qingjia.setOnClickListener(this); | 109 | layout_qingjia.setOnClickListener(this); |
@@ -180,10 +184,28 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -180,10 +184,28 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
180 | 184 | ||
181 | @Override | 185 | @Override |
182 | public void onClick(View view) { | 186 | public void onClick(View view) { |
187 | + | ||
188 | + switch (view.getId()) { | ||
189 | + | ||
190 | + case R.id.layout_kaoqin: | ||
191 | +// ApplySigninActivity.getInstance(getActivity(), jsonStr); | ||
192 | + showOrderPopu(); | ||
193 | + break; | ||
194 | + case R.id.layout_buka: | ||
195 | +// ApplyReplaceCardActivity.getInstance(getActivity(), jsonStr); | ||
196 | + showOrderPopu(); | ||
197 | + break; | ||
198 | + case R.id.layout_qingjia: | ||
199 | + ToastUtils.showToast("正在努力开发中,敬请期待"); | ||
200 | + break; | ||
201 | + } | ||
202 | + } | ||
203 | + | ||
204 | + private void showOrderPopu(){ | ||
183 | if (childBean.getCount() == 0) { | 205 | if (childBean.getCount() == 0) { |
184 | final PopupWindow popupWindow = new PopupWindow(); | 206 | final PopupWindow popupWindow = new PopupWindow(); |
185 | - popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); | ||
186 | - popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); | 207 | + popupWindow.setWidth(ViewGroup.LayoutParams.MATCH_PARENT); |
208 | + popupWindow.setHeight(ViewGroup.LayoutParams.MATCH_PARENT); | ||
187 | backgroundAlpha(0.5f); | 209 | backgroundAlpha(0.5f); |
188 | View view1 = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_view, null); | 210 | View view1 = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_view, null); |
189 | TextView dialog_info = view1.findViewById(R.id.dialog_info); | 211 | TextView dialog_info = view1.findViewById(R.id.dialog_info); |
@@ -226,21 +248,7 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -226,21 +248,7 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
226 | return; | 248 | return; |
227 | 249 | ||
228 | } | 250 | } |
229 | - | ||
230 | - switch (view.getId()) { | ||
231 | - | ||
232 | - case R.id.layout_kaoqin: | ||
233 | - ApplySigninActivity.getInstance(getActivity(), jsonStr); | ||
234 | - break; | ||
235 | - case R.id.layout_buka: | ||
236 | - ApplyReplaceCardActivity.getInstance(getActivity(), jsonStr); | ||
237 | - break; | ||
238 | - case R.id.layout_qingjia: | ||
239 | - ToastUtils.showToast("正在努力开发中,敬请期待"); | ||
240 | - break; | ||
241 | - } | ||
242 | } | 251 | } |
243 | - | ||
244 | @NonNull | 252 | @NonNull |
245 | @Override | 253 | @Override |
246 | public BasePresenter initPresenter() { | 254 | public BasePresenter initPresenter() { |
@@ -264,4 +272,24 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -264,4 +272,24 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
264 | this.jsonStr = jsonStr; | 272 | this.jsonStr = jsonStr; |
265 | show(); | 273 | show(); |
266 | } | 274 | } |
275 | + | ||
276 | + /** | ||
277 | + * 显示没有数据 | ||
278 | + */ | ||
279 | + public void showNoData() { | ||
280 | + if (type.equals(TYPE_REPORT)){ | ||
281 | + tvNoData.setBackgroundDrawable(getResources().getDrawable(R.drawable.baogao_back)); | ||
282 | + tvNoData.setText(""); | ||
283 | + }else | ||
284 | + setTextColor(); | ||
285 | + | ||
286 | + } | ||
287 | + | ||
288 | + private void setTextColor() { | ||
289 | + String text="如需使用该模块,请先前往\n个人中心—我的孩子\n绑定孩子账号"; | ||
290 | + Spannable span = new SpannableString(text); | ||
291 | + span.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.xueqing_blue)),13,22,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | ||
292 | + tvNoData.setText(span); | ||
293 | + } | ||
294 | + | ||
267 | } | 295 | } |
app/src/main/res/layout/activity_apply_signin.xml
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | android:orientation="vertical" | 7 | android:orientation="vertical" |
8 | + android:background="@color/bg_gray" | ||
8 | tools:context="com.shunzhi.parent.ui.activity.apply.ApplySigninActivity"> | 9 | tools:context="com.shunzhi.parent.ui.activity.apply.ApplySigninActivity"> |
9 | 10 | ||
10 | <include layout="@layout/top"/> | 11 | <include layout="@layout/top"/> |
app/src/main/res/layout/dialog_view.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | - android:layout_width="260dp" | 2 | +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | + android:layout_width="match_parent" | ||
4 | + android:layout_gravity="center" | ||
5 | + android:layout_height="match_parent" | ||
6 | + android:background="#55555555" | ||
7 | + android:orientation="vertical"> | ||
8 | +<LinearLayout | ||
4 | android:layout_gravity="center" | 9 | android:layout_gravity="center" |
10 | + android:layout_width="260dp" | ||
5 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content" |
6 | - android:background="#00000000" | ||
7 | android:orientation="vertical"> | 12 | android:orientation="vertical"> |
8 | - | ||
9 | <TextView | 13 | <TextView |
10 | android:id="@+id/dialog_info" | 14 | android:id="@+id/dialog_info" |
11 | android:layout_width="260dp" | 15 | android:layout_width="260dp" |
@@ -42,6 +46,6 @@ | @@ -42,6 +46,6 @@ | ||
42 | android:background="@drawable/rudiobtn" | 46 | android:background="@drawable/rudiobtn" |
43 | android:text="确定" /> | 47 | android:text="确定" /> |
44 | </LinearLayout> | 48 | </LinearLayout> |
45 | - | ||
46 | - | ||
47 | </LinearLayout> | 49 | </LinearLayout> |
50 | + | ||
51 | +</FrameLayout> |
app/src/main/res/layout/fragment_cheng_zhang.xml
@@ -129,12 +129,12 @@ | @@ -129,12 +129,12 @@ | ||
129 | 129 | ||
130 | <TextView | 130 | <TextView |
131 | android:id="@+id/tvNoData" | 131 | android:id="@+id/tvNoData" |
132 | - android:layout_width="wrap_content" | 132 | + android:layout_width="match_parent" |
133 | android:layout_height="wrap_content" | 133 | android:layout_height="wrap_content" |
134 | - android:layout_centerInParent="true" | 134 | + android:layout_marginTop="30px" |
135 | + android:gravity="center" | ||
135 | android:lineSpacingExtra="@dimen/size_dp_5" | 136 | android:lineSpacingExtra="@dimen/size_dp_5" |
136 | - android:background="@drawable/baogao_back" | ||
137 | - android:textColor="@color/xueqing_blue" | 137 | + android:text="如需使用该模块,请先前往\n个人中心—我的孩子\n绑定孩子账号" |
138 | android:textSize="@dimen/size_dp_16" /> | 138 | android:textSize="@dimen/size_dp_16" /> |
139 | </RelativeLayout> | 139 | </RelativeLayout> |
140 | 140 |
app/src/main/res/layout/fragment_mine.xml
@@ -57,7 +57,7 @@ | @@ -57,7 +57,7 @@ | ||
57 | android:layout_height="wrap_content" | 57 | android:layout_height="wrap_content" |
58 | android:text="登录/注册" | 58 | android:text="登录/注册" |
59 | android:textColor="@color/white" | 59 | android:textColor="@color/white" |
60 | - android:textSize="@dimen/txtsize_headline" /> | 60 | + android:textSize="@dimen/txtsize_title" /> |
61 | 61 | ||
62 | <TextView | 62 | <TextView |
63 | android:id="@+id/user_mobile" | 63 | android:id="@+id/user_mobile" |
@@ -81,13 +81,13 @@ | @@ -81,13 +81,13 @@ | ||
81 | </LinearLayout> | 81 | </LinearLayout> |
82 | </LinearLayout> | 82 | </LinearLayout> |
83 | <ScrollView | 83 | <ScrollView |
84 | + android:layout_margin="@dimen/dp_10" | ||
84 | android:layout_width="match_parent" | 85 | android:layout_width="match_parent" |
85 | android:layout_height="match_parent"> | 86 | android:layout_height="match_parent"> |
86 | <LinearLayout | 87 | <LinearLayout |
87 | android:id="@+id/center_layout" | 88 | android:id="@+id/center_layout" |
88 | android:layout_width="match_parent" | 89 | android:layout_width="match_parent" |
89 | android:layout_height="match_parent" | 90 | android:layout_height="match_parent" |
90 | - android:layout_margin="20dp" | ||
91 | android:orientation="vertical"> | 91 | android:orientation="vertical"> |
92 | 92 | ||
93 | <LinearLayout | 93 | <LinearLayout |
@@ -116,7 +116,7 @@ | @@ -116,7 +116,7 @@ | ||
116 | android:layout_gravity="center_vertical" | 116 | android:layout_gravity="center_vertical" |
117 | android:layout_weight="1" | 117 | android:layout_weight="1" |
118 | android:text="消息" | 118 | android:text="消息" |
119 | - android:textSize="@dimen/txtsize_title" /> | 119 | + android:textSize="@dimen/textSize14" /> |
120 | 120 | ||
121 | <TextView | 121 | <TextView |
122 | android:id="@+id/tvMessageCount" | 122 | android:id="@+id/tvMessageCount" |
@@ -157,7 +157,7 @@ | @@ -157,7 +157,7 @@ | ||
157 | android:layout_gravity="center_vertical" | 157 | android:layout_gravity="center_vertical" |
158 | android:layout_weight="1" | 158 | android:layout_weight="1" |
159 | android:text="订购详情" | 159 | android:text="订购详情" |
160 | - android:textSize="@dimen/txtsize_title" /> | 160 | + android:textSize="@dimen/textSize14" /> |
161 | 161 | ||
162 | </LinearLayout> | 162 | </LinearLayout> |
163 | 163 | ||
@@ -187,7 +187,7 @@ | @@ -187,7 +187,7 @@ | ||
187 | android:layout_gravity="center_vertical" | 187 | android:layout_gravity="center_vertical" |
188 | android:layout_weight="1" | 188 | android:layout_weight="1" |
189 | android:text="订购中心" | 189 | android:text="订购中心" |
190 | - android:textSize="@dimen/txtsize_title" /> | 190 | + android:textSize="@dimen/textSize14" /> |
191 | 191 | ||
192 | </LinearLayout> | 192 | </LinearLayout> |
193 | 193 | ||
@@ -217,7 +217,7 @@ | @@ -217,7 +217,7 @@ | ||
217 | android:layout_gravity="center_vertical" | 217 | android:layout_gravity="center_vertical" |
218 | android:layout_weight="1" | 218 | android:layout_weight="1" |
219 | android:text="我的孩子" | 219 | android:text="我的孩子" |
220 | - android:textSize="@dimen/txtsize_title" /> | 220 | + android:textSize="@dimen/textSize14" /> |
221 | 221 | ||
222 | <TextView | 222 | <TextView |
223 | android:id="@+id/binding_state" | 223 | android:id="@+id/binding_state" |
@@ -225,7 +225,7 @@ | @@ -225,7 +225,7 @@ | ||
225 | android:layout_height="wrap_content" | 225 | android:layout_height="wrap_content" |
226 | android:layout_gravity="center_vertical" | 226 | android:layout_gravity="center_vertical" |
227 | android:text="未绑定" | 227 | android:text="未绑定" |
228 | - android:textSize="@dimen/sp_18" | 228 | + android:textSize="@dimen/textSize14" |
229 | android:textColor="@color/textRed" | 229 | android:textColor="@color/textRed" |
230 | /> | 230 | /> |
231 | </LinearLayout> | 231 | </LinearLayout> |
@@ -260,7 +260,7 @@ | @@ -260,7 +260,7 @@ | ||
260 | android:layout_gravity="center_vertical" | 260 | android:layout_gravity="center_vertical" |
261 | android:layout_weight="1" | 261 | android:layout_weight="1" |
262 | android:text="意见与反馈" | 262 | android:text="意见与反馈" |
263 | - android:textSize="@dimen/txtsize_title" /> | 263 | + android:textSize="@dimen/textSize14" /> |
264 | 264 | ||
265 | </LinearLayout> | 265 | </LinearLayout> |
266 | 266 | ||
@@ -292,7 +292,7 @@ | @@ -292,7 +292,7 @@ | ||
292 | android:layout_gravity="center_vertical" | 292 | android:layout_gravity="center_vertical" |
293 | android:layout_weight="1" | 293 | android:layout_weight="1" |
294 | android:text="版本更新" | 294 | android:text="版本更新" |
295 | - android:textSize="@dimen/txtsize_title" /> | 295 | + android:textSize="@dimen/textSize14" /> |
296 | 296 | ||
297 | </LinearLayout> | 297 | </LinearLayout> |
298 | 298 | ||
@@ -324,7 +324,7 @@ | @@ -324,7 +324,7 @@ | ||
324 | android:layout_gravity="center_vertical" | 324 | android:layout_gravity="center_vertical" |
325 | android:layout_weight="1" | 325 | android:layout_weight="1" |
326 | android:text="清除缓存" | 326 | android:text="清除缓存" |
327 | - android:textSize="@dimen/txtsize_title" /> | 327 | + android:textSize="@dimen/textSize14" /> |
328 | 328 | ||
329 | </LinearLayout> | 329 | </LinearLayout> |
330 | 330 | ||
@@ -354,7 +354,7 @@ | @@ -354,7 +354,7 @@ | ||
354 | android:layout_gravity="center_vertical" | 354 | android:layout_gravity="center_vertical" |
355 | android:layout_weight="1" | 355 | android:layout_weight="1" |
356 | android:text="关于" | 356 | android:text="关于" |
357 | - android:textSize="@dimen/txtsize_title" /> | 357 | + android:textSize="@dimen/textSize14" /> |
358 | 358 | ||
359 | </LinearLayout> | 359 | </LinearLayout> |
360 | </LinearLayout> | 360 | </LinearLayout> |
@@ -367,11 +367,10 @@ | @@ -367,11 +367,10 @@ | ||
367 | android:gravity="center" | 367 | android:gravity="center" |
368 | android:layout_weight="1" | 368 | android:layout_weight="1" |
369 | android:layout_marginTop="@dimen/size_dp_15" | 369 | android:layout_marginTop="@dimen/size_dp_15" |
370 | - android:layout_marginBottom="@dimen/size_dp_15" | ||
371 | android:background="@drawable/shape_xueqing_radius8" | 370 | android:background="@drawable/shape_xueqing_radius8" |
372 | android:text="退出登录" | 371 | android:text="退出登录" |
373 | android:textColor="@color/white" | 372 | android:textColor="@color/white" |
374 | - android:textSize="@dimen/size_dp_16" /> | 373 | + android:textSize="@dimen/textSize14" /> |
375 | 374 | ||
376 | <TextView | 375 | <TextView |
377 | android:id="@+id/testEnter" | 376 | android:id="@+id/testEnter" |
app/src/main/res/layout/fragment_report.xml
@@ -65,23 +65,6 @@ | @@ -65,23 +65,6 @@ | ||
65 | android:visibility="gone" /> | 65 | android:visibility="gone" /> |
66 | </FrameLayout> | 66 | </FrameLayout> |
67 | 67 | ||
68 | - <RelativeLayout | ||
69 | - android:id="@+id/rl_noData" | ||
70 | - android:layout_width="match_parent" | ||
71 | - android:layout_height="match_parent" | ||
72 | - android:background="@color/white" | ||
73 | - android:visibility="gone"> | ||
74 | - | ||
75 | - <TextView | ||
76 | - android:id="@+id/tvNoData" | ||
77 | - android:layout_width="match_parent" | ||
78 | - android:layout_height="wrap_content" | ||
79 | - android:layout_marginTop="30px" | ||
80 | - android:gravity="center" | ||
81 | - android:lineSpacingExtra="@dimen/size_dp_5" | ||
82 | - android:text="如需使用该模块,请先前往\n个人中心—我的孩子\n绑定孩子账号" | ||
83 | - android:textSize="@dimen/size_dp_16" /> | ||
84 | - </RelativeLayout> | ||
85 | 68 | ||
86 | <android.support.v4.view.ViewPager | 69 | <android.support.v4.view.ViewPager |
87 | android:id="@+id/viewPager" | 70 | android:id="@+id/viewPager" |