11111
This commit is contained in:
parent
1fc6a3adfe
commit
0cb1ed9b71
@ -17,7 +17,11 @@ import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.MessageItemLongClickAction;
|
||||
import io.rong.imkit.MessageItemLongClickActionManager;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.message.RecallNotificationMessage;
|
||||
@ -106,6 +110,8 @@ public class MessageLongClickPopuwindow implements View.OnClickListener {
|
||||
withdrawMethod();
|
||||
popupWindow.dismiss();
|
||||
} else if (id == R.id.quote_linear) {//引用
|
||||
List<MessageItemLongClickAction> messageItemLongClickActionList = MessageItemLongClickActionManager.getInstance().getMessageItemLongClickActions();
|
||||
Log.e("", messageItemLongClickActionList.size() + "");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,7 +16,6 @@ import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@ -82,6 +81,13 @@ public class MessageIMManager {
|
||||
|
||||
}
|
||||
|
||||
public MessageIMManager setSystemNumber(int systemNumber) {
|
||||
this.systemNumber = systemNumber;
|
||||
//发送通知
|
||||
unreadMessagesHandler.post(essagesRunnable);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统消息(有未读数展示红点)
|
||||
*/
|
||||
@ -159,28 +165,6 @@ public class MessageIMManager {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(code, msg, info);
|
||||
}
|
||||
if (code == 0) {
|
||||
List<IMLoginModel> listUserBean = JSON.parseArray(Arrays.toString(info), IMLoginModel.class);
|
||||
if (listUserBean != null && listUserBean.size() >= 2) {
|
||||
//目前就三条消息,需求判断前两条消息是否有未读消息
|
||||
for (int i = 0; i < listUserBean.size(); i++) {
|
||||
//消息对象
|
||||
IMLoginModel userBean = listUserBean.get(i);
|
||||
//未读消息数
|
||||
String number = userBean.getNum();
|
||||
//未读消息不为空并且大于0
|
||||
try {
|
||||
if (!TextUtils.isEmpty(number) && Integer.parseInt(number) > 0) {
|
||||
systemNumber = Integer.parseInt(number) + systemNumber;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
systemNumber = systemNumber + 0;
|
||||
}
|
||||
}
|
||||
//发送通知
|
||||
unreadMessagesHandler.post(essagesRunnable);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -239,9 +223,9 @@ public class MessageIMManager {
|
||||
*/
|
||||
@Override
|
||||
public boolean onMessageLongClick(Context context, View view, Message message) {
|
||||
// new MessageLongClickPopuwindow((Activity) context)
|
||||
// .setMessage(message)
|
||||
// .show(view);
|
||||
new MessageLongClickPopuwindow((Activity) context)
|
||||
.setMessage(message)
|
||||
.show(view);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -9,9 +9,9 @@ ext {
|
||||
]
|
||||
manifestPlaceholders = [
|
||||
//正式
|
||||
serverHost : "https://napi.yaoulive.com",
|
||||
// serverHost : "https://napi.yaoulive.com",
|
||||
//測試
|
||||
// serverHost : "https://ceshi.yaoulive.com",
|
||||
serverHost : "https://ceshi.yaoulive.com",
|
||||
|
||||
//腾讯地图
|
||||
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",
|
||||
|
@ -146,5 +146,20 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter {
|
||||
listUserBean.addAll(mlistUserBean);
|
||||
notifyDataSetChanged();
|
||||
|
||||
int systemNumber = 0;
|
||||
for (ImUserBean bean : listUserBean) {
|
||||
//未读消息数
|
||||
String number = bean.getNum();
|
||||
//未读消息不为空并且大于0
|
||||
try {
|
||||
if (!TextUtils.isEmpty(number) && Integer.parseInt(number) > 0) {
|
||||
systemNumber = Integer.parseInt(number) + systemNumber;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
systemNumber = systemNumber + 0;
|
||||
}
|
||||
}
|
||||
MessageIMManager.get(mContext).setSystemNumber(systemNumber);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.yunbao.live.dialog;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@ -30,6 +31,10 @@ public class PDLiveMessageListAdapter extends MessageListAdapter {
|
||||
super.onBindViewHolder(holder, position);
|
||||
Message.MessageDirection messageDirection = mDataList.get(position).getMessage().getMessageDirection();
|
||||
ImageView readReceipt = holder.getConvertView().findViewById(R.id.rc_read_receipt);
|
||||
TextView rcEdit = holder.getConvertView().findViewById(R.id.rc_edit);
|
||||
if (rcEdit!=null){
|
||||
rcEdit.setVisibility(View.GONE);
|
||||
}
|
||||
ImageView readReceiptNew = holder.getConvertView().findViewById(R.id.rc_read_receipt_new);
|
||||
if (readReceiptNew!=null){
|
||||
if (messageDirection==Message.MessageDirection.SEND){
|
||||
|
@ -3,6 +3,7 @@ package com.yunbao.main.adapter;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@ -37,6 +38,8 @@ public class SystemMessageAdapter extends RecyclerView.Adapter {
|
||||
private List<ImUserBean> listUserBean = new ArrayList<>();
|
||||
protected Activity mContext;
|
||||
protected LayoutInflater mInflater;
|
||||
private Handler netHandler = new Handler();
|
||||
private int mPosition = -1;
|
||||
|
||||
public SystemMessageAdapter(Activity mContext) {
|
||||
this.mContext = mContext;
|
||||
@ -83,16 +86,8 @@ public class SystemMessageAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
//系统消息的跳转
|
||||
messageViewHolder.setViewHolderOnClickListener((view, model1) -> {
|
||||
//获取一下系统通知
|
||||
MessageIMManager.get(mContext).getSystemMessages(new MessageIMManager.SystemMessagesHttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
List<ImUserBean> listUserBean = JSON.parseArray(Arrays.toString(info), ImUserBean.class);
|
||||
addSystemMessagesView(listUserBean);
|
||||
}
|
||||
}
|
||||
});
|
||||
mPosition = position;
|
||||
netHandler.post(updataRunable);
|
||||
if (model1.getContent().equals("在線客服")) {
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_customer_service", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service");
|
||||
@ -151,8 +146,26 @@ public class SystemMessageAdapter extends RecyclerView.Adapter {
|
||||
//倒序展示
|
||||
Collections.reverse(mlistUserBean);
|
||||
listUserBean.clear();
|
||||
if (mPosition > 0) {
|
||||
mlistUserBean.get(mPosition).setNum("");
|
||||
}
|
||||
listUserBean.addAll(mlistUserBean);
|
||||
notifyDataSetChanged();
|
||||
mPosition = -1;
|
||||
int systemNumber = 0;
|
||||
for (ImUserBean bean : listUserBean) {
|
||||
//未读消息数
|
||||
String number = bean.getNum();
|
||||
//未读消息不为空并且大于0
|
||||
try {
|
||||
if (!TextUtils.isEmpty(number) && Integer.parseInt(number) > 0) {
|
||||
systemNumber = Integer.parseInt(number) + systemNumber;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
systemNumber = systemNumber + 0;
|
||||
}
|
||||
}
|
||||
MessageIMManager.get(mContext).setSystemNumber(systemNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -177,4 +190,20 @@ public class SystemMessageAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private Runnable updataRunable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//获取一下系统通知
|
||||
MessageIMManager.get(mContext).getSystemMessages(new MessageIMManager.SystemMessagesHttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
List<ImUserBean> listUserBean = JSON.parseArray(Arrays.toString(info), ImUserBean.class);
|
||||
addSystemMessagesView(listUserBean);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user