Commit f96e1956fed0244e4bb78c82da0efc063506ef2a
1 parent
6edf5ac2
Exists in
yxb_dev
and in
1 other branch
no message
Showing
6 changed files
with
24 additions
and
6 deletions
Show diff stats
app/libs/processor.jar
No preview for this file type
app/src/main/java/com/shunzhi/parent/AppContext.java
... | ... | @@ -100,7 +100,6 @@ public class AppContext extends GlobalApplication { |
100 | 100 | return options; |
101 | 101 | } |
102 | 102 | |
103 | - | |
104 | 103 | private LoginInfo loginInfo() { |
105 | 104 | SharedPreferences sp = getSharedPreferences("info", Context.MODE_PRIVATE); |
106 | 105 | String account = sp.getString("account", ""); | ... | ... |
app/src/main/java/com/shunzhi/parent/bean/NIMLoginResultBean.java
... | ... | @@ -41,4 +41,13 @@ public class NIMLoginResultBean { |
41 | 41 | public void setThrowable(Throwable throwable) { |
42 | 42 | this.throwable = throwable; |
43 | 43 | } |
44 | + | |
45 | + @Override | |
46 | + public String toString() { | |
47 | + return "NIMLoginResultBean{" + | |
48 | + "isSuccess=" + isSuccess + | |
49 | + ", resultCode=" + resultCode + | |
50 | + ", throwable=" + throwable + | |
51 | + '}'; | |
52 | + } | |
44 | 53 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/manager/MessageManager.java
... | ... | @@ -61,18 +61,21 @@ public class MessageManager { |
61 | 61 | private Observer<List<IMMessage>> messageObserver = new Observer<List<IMMessage>>() { |
62 | 62 | @Override |
63 | 63 | public void onEvent(List<IMMessage> imMessages) { |
64 | + Log.d("77777","IMMessage="+imMessages.toString()); | |
64 | 65 | onMessageReceive(imMessages); |
65 | 66 | } |
66 | 67 | }; |
67 | 68 | private Observer<CustomNotification> customNotificationObserver = new Observer<CustomNotification>() { |
68 | 69 | @Override |
69 | 70 | public void onEvent(CustomNotification customNotification) { |
71 | + Log.d("77777","customNotification="+customNotification.getContent()); | |
70 | 72 | onCustomNotificationReceive(customNotification); |
71 | 73 | } |
72 | 74 | }; |
73 | 75 | |
74 | 76 | |
75 | 77 | private MessageManager() { |
78 | + Log.d("77777","messageObserver="+messageObserver); | |
76 | 79 | NIMClient.getService(MsgServiceObserve.class).observeReceiveMessage(messageObserver, true); |
77 | 80 | NIMClient.getService(MsgServiceObserve.class).observeCustomNotification(customNotificationObserver, true); |
78 | 81 | NIMClient.getService(AuthServiceObserver.class).observeOnlineStatus(new Observer<StatusCode>() { |
... | ... | @@ -184,12 +187,10 @@ public class MessageManager { |
184 | 187 | NIMLoginResultBean bean = new NIMLoginResultBean(true, 200, null); |
185 | 188 | subject.onNext(bean); |
186 | 189 | // Timber.i("----===onSuccess : %s", o); |
187 | - Log.d("66666","云信服务器登录失败:" + o.toString()); | |
188 | 190 | } |
189 | 191 | |
190 | 192 | @Override |
191 | 193 | public void onFailed(int i) { |
192 | - Log.d("66666","云信服务器登录失败:" + i); | |
193 | 194 | // Timber.i("----===nim login failed : %s", i); |
194 | 195 | NIMLoginResultBean bean = new NIMLoginResultBean(false, i, null); |
195 | 196 | subject.onNext(bean); |
... | ... | @@ -197,7 +198,6 @@ public class MessageManager { |
197 | 198 | |
198 | 199 | @Override |
199 | 200 | public void onException(Throwable throwable) { |
200 | - Log.d("66666","onException:" + throwable.toString()); | |
201 | 201 | // Timber.i("----===onException"); |
202 | 202 | if (throwable != null) throwable.printStackTrace(); |
203 | 203 | NIMLoginResultBean bean = new NIMLoginResultBean(false, 0, throwable); | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
... | ... | @@ -203,10 +203,11 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
203 | 203 | } |
204 | 204 | |
205 | 205 | @Override |
206 | - public void nimLogin(String account, String password) { | |
206 | + public void nimLogin(final String account, final String password) { | |
207 | 207 | mRxManager.register(mIModel.nimLoginResult(account, password).subscribe(new Consumer<NIMLoginResultBean>() { |
208 | 208 | @Override |
209 | 209 | public void accept(NIMLoginResultBean bean) throws Exception { |
210 | + Log.d("77777","NIMLoginResultBean="+bean); | |
210 | 211 | if (bean.isSuccess()) { |
211 | 212 | AppConfig.ISLOGIN = true; |
212 | 213 | mIView.getUserInfo(0); | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/ReportFragment.java
... | ... | @@ -195,7 +195,7 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil |
195 | 195 | } |
196 | 196 | tvName.setText(childBean.getStudentName()); |
197 | 197 | } |
198 | - if (null!=chengZhangFragment1)chengZhangFragment1.setChildJson(jsonStr); | |
198 | + if (null != chengZhangFragment1) chengZhangFragment1.setChildJson(jsonStr); | |
199 | 199 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.CURRCHILDJSONSTR, jsonStr); |
200 | 200 | createSchoolMenu(); |
201 | 201 | } |
... | ... | @@ -227,6 +227,15 @@ public class ReportFragment extends BaseMVPCompatFragment<MyChildContract.MyChil |
227 | 227 | } |
228 | 228 | |
229 | 229 | @Override |
230 | + public CharSequence getPageTitle(int position) { | |
231 | + if (position==0){ | |
232 | + return "成长"; | |
233 | + }else { | |
234 | + return "报告"; | |
235 | + } | |
236 | + } | |
237 | + | |
238 | + @Override | |
230 | 239 | public Fragment getItem(int position) { |
231 | 240 | if (position == 0) { |
232 | 241 | chengZhangFragment1 = ChengZhangFragment.newInstance(ChengZhangFragment.TYPE_CHENGZHANG, jsonStr); | ... | ... |