设置基本资料
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.shayu.onetoone.activity;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
@@ -19,6 +18,7 @@ import com.shayu.onetoone.activity.fragments.DynamicFragment;
|
||||
import com.shayu.onetoone.activity.fragments.FriendsFragment;
|
||||
import com.shayu.onetoone.activity.fragments.MessageFragment;
|
||||
import com.shayu.onetoone.activity.fragments.MyFragment;
|
||||
import com.shayu.onetoone.bean.JoinAnchorBean;
|
||||
import com.shayu.onetoone.bean.OfficialNoticeBean;
|
||||
import com.shayu.onetoone.event.MessageMsgBusEvent;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
@@ -27,8 +27,10 @@ import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -114,39 +116,63 @@ public class MainActivity extends AbsOTOActivity {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
checkUserInfoIsSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测用户是否设置个人信息
|
||||
*/
|
||||
private void checkUserInfoIsSet() {
|
||||
OTONetManager.getInstance(mContext).getBaseInfos(true, new com.yunbao.common.http.base.HttpCallback<com.shayu.onetoone.bean.UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(com.shayu.onetoone.bean.UserBean data) {
|
||||
if (data.getStatus() == 0) {
|
||||
RouteManager.forwardCompleteActivity();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showRedPoint(int count) {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getMessageSystemLists(new HttpCallback<List<OfficialNoticeBean>>() {
|
||||
int point = 0;
|
||||
OTONetManager.getInstance(mContext).getMessageSystemLists(new HttpCallback<List<OfficialNoticeBean>>() {
|
||||
int point = 0;
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<OfficialNoticeBean> data) {
|
||||
for (OfficialNoticeBean datum : data) {
|
||||
point += datum.getNum();
|
||||
}
|
||||
//大于0则是通过会话未读监听器获取到的数,则不用再调用获取未读数接口了
|
||||
if (count >= 0) {
|
||||
updateUnreadCount(point + count);
|
||||
return;
|
||||
}
|
||||
RongIMClient.getInstance().getTotalUnreadCount(new RongIMClient.ResultCallback<Integer>() {
|
||||
@Override
|
||||
public void onSuccess(List<OfficialNoticeBean> data) {
|
||||
for (OfficialNoticeBean datum : data) {
|
||||
point += datum.getNum();
|
||||
}
|
||||
//大于0则是通过会话未读监听器获取到的数,则不用再调用获取未读数接口了
|
||||
if (count >= 0) {
|
||||
updateUnreadCount(point + count);
|
||||
return;
|
||||
}
|
||||
RongIMClient.getInstance().getTotalUnreadCount(new RongIMClient.ResultCallback<Integer>() {
|
||||
@Override
|
||||
public void onSuccess(Integer integer) {
|
||||
updateUnreadCount(point + integer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
|
||||
}
|
||||
});
|
||||
public void onSuccess(Integer integer) {
|
||||
updateUnreadCount(point + integer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateUnreadCount(int count) {
|
||||
|
||||
Reference in New Issue
Block a user