Commit 31508559 by 霍志良

fix:m-im 修复私聊列表--通知--预约提醒列表--已读红点并未消失功能

parent 12b79209
...@@ -20,8 +20,8 @@ import java.util.List; ...@@ -20,8 +20,8 @@ import java.util.List;
public final class DemoGlobalConfig implements IConfigModule { public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/"; String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_AUTO_TEST; // public static String appEnv = YDLConstants.ENV_AUTO_TEST;
public static String appEnv = YDLConstants.ENV_TEST; // public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_PROD; public static String appEnv = YDLConstants.ENV_PROD;
@Override @Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) { public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
......
...@@ -13,6 +13,7 @@ import com.ydl.ydlcommon.base.BaseActivity; ...@@ -13,6 +13,7 @@ import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.lifecycle.ILifecycleable; import com.ydl.ydlcommon.base.lifecycle.ILifecycleable;
import com.ydl.ydlcommon.data.http.RxUtils; import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer; import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.StringUtils; import com.ydl.ydlcommon.utils.StringUtils;
import com.ydl.ydlcommon.utils.remind.ToastHelper; import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.yidianling.im.bean.MsgData; import com.yidianling.im.bean.MsgData;
...@@ -29,7 +30,9 @@ import org.jetbrains.annotations.NotNull; ...@@ -29,7 +30,9 @@ import org.jetbrains.annotations.NotNull;
import java.util.Map; import java.util.Map;
import de.greenrobot.event.EventBus; import de.greenrobot.event.EventBus;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
/** /**
* 消息adapter * 消息adapter
...@@ -60,9 +63,7 @@ public class MsgListAdapter extends CommonAdapter<MsgData> { ...@@ -60,9 +63,7 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
convertView = new MsgListItemView(context, type); convertView = new MsgListItemView(context, type);
} }
((MsgListItemView) convertView).setData(mDataList.get(position)); ((MsgListItemView) convertView).setData(mDataList.get(position));
convertView.setOnClickListener(new View.OnClickListener() { convertView.setOnClickListener(v -> {
@Override
public void onClick(View v) {
//动态消息暂时不需要访问以下接口 //动态消息暂时不需要访问以下接口
boolean fla = false; boolean fla = false;
//判断是否是跳转专家主页 //判断是否是跳转专家主页
...@@ -113,8 +114,10 @@ public class MsgListAdapter extends CommonAdapter<MsgData> { ...@@ -113,8 +114,10 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
if (fla || boo) { if (fla || boo) {
//跟新未读 //跟新未读
Disposable dis = httpHelper.getMsgDetail(new MsgDetailParam(mDataList.get(position).id)) Disposable dis = httpHelper.getMsgDetail(new MsgDetailParam(mDataList.get(position).id))
.compose(RxUtils.applySchedulers(lifecycleable)) // .compose(RxUtils.applySchedulers(lifecycleable))
.subscribeOn(Schedulers.io())
.compose(RxUtils.resultData()) .compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(msgDetail -> { .subscribe(msgDetail -> {
mDataList.get(position).is_read = 2; mDataList.get(position).is_read = 2;
notifyDataSetChanged(); notifyDataSetChanged();
...@@ -128,10 +131,13 @@ public class MsgListAdapter extends CommonAdapter<MsgData> { ...@@ -128,10 +131,13 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
//如果是动态消息则到此结束,其它消息类型走下面流程 //如果是动态消息则到此结束,其它消息类型走下面流程
}else { }else {
Disposable di = httpHelper.getMsgDetail(new MsgDetailParam(mDataList.get(position).id)) Disposable di = httpHelper.getMsgDetail(new MsgDetailParam(mDataList.get(position).id))
.compose(RxUtils.applySchedulers(lifecycleable)) // .compose(RxUtils.applySchedulers(lifecycleable))
.subscribeOn(Schedulers.io())
.compose(RxUtils.resultData()) .compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(msgDetail -> { .subscribe(msgDetail -> {
mDataList.get(position).is_read = 2; mDataList.get(position).is_read = 2;
notifyDataSetChanged();
EventBus.getDefault().post(new UpdateTabUnreadNumEvent()); EventBus.getDefault().post(new UpdateTabUnreadNumEvent());
switch (msgDetail.type) { switch (msgDetail.type) {
case 1: case 1:
...@@ -183,7 +189,6 @@ public class MsgListAdapter extends CommonAdapter<MsgData> { ...@@ -183,7 +189,6 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
} }
}
}); });
return convertView; return convertView;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment