修复33000

This commit is contained in:
zlzw 2024-05-09 14:12:41 +08:00
parent cc355b0177
commit 4513d8495f
15 changed files with 259 additions and 87 deletions

View File

@ -5,24 +5,28 @@ import android.graphics.Color;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.utils.StringUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.TreeMap; import java.util.TreeMap;
public class DebugDialogAdapter extends RecyclerView.Adapter<DebugDialogAdapter.DebugViewHolder> { public class DebugDialogAdapter extends RecyclerView.Adapter<DebugDialogAdapter.DebugViewHolder> {
TreeMap<String, String> paramMap = new TreeMap<>(); HashMap<String, View> paramMap = new HashMap<>();
private Context mContext; private Context mContext;
public DebugDialogAdapter(Context mContext) { public DebugDialogAdapter(Context mContext) {
this.mContext = mContext; this.mContext = mContext;
} }
public void setParamMap(TreeMap<String, String> paramMap) { public void setParamMap(HashMap<String, View> paramMap) {
Log.i("debug弹窗", "setParamMap: 添加值到view " + paramMap.size()); Log.i("debug弹窗", "setParamMap: 添加值到view " + paramMap.size());
this.paramMap = paramMap; this.paramMap = paramMap;
notifyDataSetChanged(); notifyDataSetChanged();
@ -31,7 +35,8 @@ public class DebugDialogAdapter extends RecyclerView.Adapter<DebugDialogAdapter.
@NonNull @NonNull
@Override @Override
public DebugViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public DebugViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new DebugViewHolder(new TextView(mContext)); Log.i("debug弹窗", "onCreateViewHolder: 创建适配器");
return new DebugViewHolder(new LinearLayout(mContext));
} }
@Override @Override
@ -53,10 +58,24 @@ public class DebugDialogAdapter extends RecyclerView.Adapter<DebugDialogAdapter.
super(itemView); super(itemView);
} }
public void setData(String tag, String msg) { public void setData(String msg, View view) {
Log.i("debug弹窗", "setData: 添加值到view " + tag + "|" + msg); Log.i("debug弹窗", "setData: 添加值到view " + view + "|" + msg + "|" + ((LinearLayout) itemView).indexOfChild(view));
((TextView) itemView).setText(tag + ":" + msg); if (view instanceof TextView && StringUtil.isEmpty(((TextView) view).getText().toString())) {
((TextView) itemView).setTextColor(Color.BLACK); ((TextView) view).setText(msg);
}
int indexOfChild = ((LinearLayout) itemView).indexOfChild(view);
if (indexOfChild != -1) {
if (((LinearLayout) itemView).getChildAt(indexOfChild) instanceof TextView) {
((TextView) ((LinearLayout) itemView).getChildAt(indexOfChild)).setText(msg);
} else {
((LinearLayout) itemView).removeViewAt(indexOfChild);
}
} else {
if (view.getParent() != null) {
((ViewGroup) view.getParent()).removeView(view);
}
((LinearLayout) itemView).addView(view);
}
} }
} }
} }

View File

@ -3,10 +3,10 @@ package com.yunbao.common.dialog;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.graphics.Color; import android.graphics.Color;
import android.os.Handler;
import android.os.Looper;
import android.util.Log; import android.util.Log;
import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -19,23 +19,32 @@ import com.yunbao.common.adapter.DebugDialogAdapter;
import com.yunbao.common.utils.AppManager; import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import java.util.HashMap;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
import java.util.TreeMap;
public class DebugDialog { public class DebugDialog {
RecyclerView recyclerView; RecyclerView recyclerView;
TreeMap<String, String> params; HashMap<String, View> params;
DebugDialogAdapter adapter; DebugDialogAdapter adapter;
private static DebugDialog debugDialog; private static DebugDialog debugDialog;
Context mContext; Context mContext;
private ShowPattern showPattern = ShowPattern.CURRENT_ACTIVITY;
public static DebugDialog getInstance() { private DebugDialogRunnable runnable;
public static void getInstance(DebugDialogRunnable runnable) {
if (debugDialog == null) { if (debugDialog == null) {
debugDialog = new DebugDialog(); debugDialog = new DebugDialog(runnable);
} else {
runnable.run(debugDialog);
} }
return debugDialog; debugDialog.showPattern = ShowPattern.CURRENT_ACTIVITY;
}
public static boolean checkShow() {
return EasyFloat.isShow("debug");
} }
public DebugDialog clear() { public DebugDialog clear() {
@ -44,25 +53,59 @@ public class DebugDialog {
} }
public void setParams(String tag, String msg) { public void setParams(String tag, String msg) {
Log.i("debug弹窗", "setParams: "+tag+"|"+msg); Log.i("debug弹窗", "setParams: " + tag + "|" + msg);
params.put(tag, msg); if (params.containsKey(tag)) {
if (adapter != null) ((TextView) params.get(tag)).setText(tag + ":" + msg);
} else {
TextView textView = new TextView(mContext);
textView.setText(tag + ":" + msg);
params.put(tag, textView);
adapter.setParamMap(params); adapter.setParamMap(params);
} }
EasyFloat.updateFloat("debug");
}
private DebugDialog() { private DebugDialog(DebugDialogRunnable runnable) {
if(params==null) { this.runnable = runnable;
if (params == null) {
Log.i("debug弹窗", "DebugDialog: 初始化参数"); Log.i("debug弹窗", "DebugDialog: 初始化参数");
params = new TreeMap<>(); params = new HashMap<>();
} }
init(); init();
} }
private void init(){
private void init() {
this.mContext = AppManager.getInstance().getMainActivity(); this.mContext = AppManager.getInstance().getMainActivity();
if (mContext == null) { if (mContext == null) {
startWaitMainActivity(); startWaitMainActivity();
return; return;
} }
runnable.run(this);
// createView();
}
private void startWaitMainActivity() {
new Timer().schedule(new TimerTask() {
@Override
public void run() {
Log.i("debug弹窗", "run: " + AppManager.getInstance().getMainActivity());
if (AppManager.getInstance().getMainActivity() != null) {
init();
cancel();
}
}
}, 0, 1000);
}
public void close() {
EasyFloat.dismiss("debug");
}
public void show() {
if (showPattern == ShowPattern.CURRENT_ACTIVITY) {
createView();
return;
}
if (PermissionUtils.checkPermission(mContext)) { if (PermissionUtils.checkPermission(mContext)) {
createView(); createView();
} else { } else {
@ -76,44 +119,51 @@ public class DebugDialog {
} }
}); });
} }
// createView();
}
private void startWaitMainActivity() {
new Timer().schedule(new TimerTask() {
@Override
public void run() {
Log.i("debug弹窗", "run: "+AppManager.getInstance().getMainActivity());
if (AppManager.getInstance().getMainActivity() != null) {
init();
cancel();
}
}
}, 0,1000);
} }
protected void createView() { protected void createView() {
recyclerView = new RecyclerView(mContext); recyclerView = new RecyclerView(mContext);
adapter = new DebugDialogAdapter(mContext); adapter = new DebugDialogAdapter(mContext);
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
recyclerView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT)); recyclerView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
recyclerView.setAdapter(adapter); recyclerView.setAdapter(adapter);
recyclerView.setBackgroundColor(Color.WHITE); recyclerView.setBackgroundColor(Color.WHITE);
TextView textView = new TextView(mContext);
textView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ToastUtil.show("debug弹窗:" + params.size());
EasyFloat.updateFloat("debug");
}
});
params.put("debug弹窗", textView);
adapter.setParamMap(params);
EasyFloat.with(mContext) EasyFloat.with(mContext)
.setTag("debug") .setTag("debug")
.setShowPattern(ShowPattern.FOREGROUND) .setShowPattern(this.showPattern)
.setLayout(recyclerView) .setLayout(recyclerView)
.show(); .show();
if(!params.isEmpty()){ runnable.run(this);
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {
adapter.setParamMap(params);
}
},1000);
Log.i("debug弹窗", "createView: 有值");
}
Log.i("debug弹窗", "createView: 创建"); Log.i("debug弹窗", "createView: 创建");
} }
public void setView(String value, View view, View.OnClickListener onClickListener) {
if (params.containsKey(value)) {
params.get(value).setOnClickListener(onClickListener);
} else {
view.setOnClickListener(onClickListener);
params.put(value, view);
}
adapter.setParamMap(params);
EasyFloat.updateFloat("debug");
}
public void setShowPattern(ShowPattern showPattern) {
this.showPattern = showPattern;
}
public interface DebugDialogRunnable {
void run(DebugDialog dialog);
}
} }

View File

@ -484,7 +484,7 @@ public class GameMicManager {
Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM; Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM;
TextMessage messageContent = TextMessage.obtain(new Gson().toJson(sudGameSocketImEvent)); TextMessage messageContent = TextMessage.obtain(new Gson().toJson(sudGameSocketImEvent));
Message message = Message.obtain("v" + mRoomID, conversationType, messageContent); Message message = Message.obtain("v" + mRoomID, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {

View File

@ -15,10 +15,14 @@ import com.bumptech.glide.request.RequestOptions;
import com.iflytek.cloud.SpeechConstant; import com.iflytek.cloud.SpeechConstant;
import com.iflytek.cloud.SpeechUtility; import com.iflytek.cloud.SpeechUtility;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.R;
import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.dialog.DebugDialog;
import com.yunbao.common.event.RongIMConnectionStatusEvent; import com.yunbao.common.event.RongIMConnectionStatusEvent;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
@ -26,6 +30,7 @@ import io.rong.imkit.GlideKitImageEngine;
import io.rong.imkit.IMCenter; import io.rong.imkit.IMCenter;
import io.rong.imkit.RongIM; import io.rong.imkit.RongIM;
import io.rong.imkit.config.RongConfigCenter; import io.rong.imkit.config.RongConfigCenter;
import io.rong.imlib.IRongCallback;
import io.rong.imlib.RongIMClient; import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation; import io.rong.imlib.model.Conversation;
import io.rong.imlib.model.Message; import io.rong.imlib.model.Message;
@ -113,14 +118,33 @@ public class RongcloudIMManager {
} }
public static void connectIM(Context context) {
connectIM(context, new RongIMClient.ConnectCallback() {
@Override
public void onSuccess(String t) {
}
@Override
public void onError(RongIMClient.ConnectionErrorCode e) {
}
@Override
public void onDatabaseOpened(RongIMClient.DatabaseOpenStatus code) {
}
});
}
/** /**
* 连接融云服务器 * 连接融云服务器
* *
* @param context * @param context
*/ */
public static void connectIM(Context context) { public static void connectIM(Context context, RongIMClient.ConnectCallback callback) {
// MessageIMManager.get(context).addImRongCloudObserver(); MessageIMManager.get(context).addImRongCloudObserver();
// MessageIMManager.get(context).getSystemMessages(); MessageIMManager.get(context).getSystemMessages();
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo(); IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
String IMToken = userInfo.getTokenRong(); String IMToken = userInfo.getTokenRong();
Log.e(CLASSNAME, "connectIM:" + IMToken); Log.e(CLASSNAME, "connectIM:" + IMToken);
@ -130,6 +154,7 @@ public class RongcloudIMManager {
RongIM.connect(IMToken, 0, new RongIMClient.ConnectCallback() { RongIM.connect(IMToken, 0, new RongIMClient.ConnectCallback() {
@Override @Override
public void onSuccess(String s) { public void onSuccess(String s) {
callback.onSuccess(s);
//连接成功如果 onDatabaseOpened() 时没有页面跳转也可在此时进行跳转 //连接成功如果 onDatabaseOpened() 时没有页面跳转也可在此时进行跳转
Log.e(CLASSNAME, "onSuccess:" + s); Log.e(CLASSNAME, "onSuccess:" + s);
isReady = true; isReady = true;
@ -139,7 +164,7 @@ public class RongcloudIMManager {
@Override @Override
public void onError(RongIMClient.ConnectionErrorCode connectionErrorCode) { public void onError(RongIMClient.ConnectionErrorCode connectionErrorCode) {
callback.onError(connectionErrorCode);
if (connectionErrorCode.equals(RongIMClient.ConnectionErrorCode.RC_CONN_TOKEN_EXPIRE)) { if (connectionErrorCode.equals(RongIMClient.ConnectionErrorCode.RC_CONN_TOKEN_EXPIRE)) {
// APP 服务请求新 token获取到新 token 后重新 connect() // APP 服务请求新 token获取到新 token 后重新 connect()
Log.e(CLASSNAME, "onError:(从 APP 服务请求新 token" + RongIMClient.ConnectionErrorCode.RC_CONN_TOKEN_EXPIRE); Log.e(CLASSNAME, "onError:(从 APP 服务请求新 token" + RongIMClient.ConnectionErrorCode.RC_CONN_TOKEN_EXPIRE);
@ -154,13 +179,11 @@ public class RongcloudIMManager {
@Override @Override
public void onDatabaseOpened(RongIMClient.DatabaseOpenStatus databaseOpenStatus) { public void onDatabaseOpened(RongIMClient.DatabaseOpenStatus databaseOpenStatus) {
callback.onDatabaseOpened(databaseOpenStatus);
if (RongIMClient.DatabaseOpenStatus.DATABASE_OPEN_SUCCESS.equals(databaseOpenStatus)) { if (RongIMClient.DatabaseOpenStatus.DATABASE_OPEN_SUCCESS.equals(databaseOpenStatus)) {
//本地数据库打开跳转到会话列表页面 //本地数据库打开跳转到会话列表页面
Log.e(CLASSNAME, "onDatabaseOpened:(本地数据库打开)" + databaseOpenStatus); Log.e(CLASSNAME, "onDatabaseOpened:(本地数据库打开)" + databaseOpenStatus);
} else { } else {
//数据库打开失败可以弹出 toast 提示 //数据库打开失败可以弹出 toast 提示
Log.e(CLASSNAME, "onDatabaseOpened:(数据库打开失败)" + databaseOpenStatus); Log.e(CLASSNAME, "onDatabaseOpened:(数据库打开失败)" + databaseOpenStatus);
} }
@ -191,14 +214,13 @@ public class RongcloudIMManager {
break; break;
//用户账号在其它设备登录此设备被踢下线 //用户账号在其它设备登录此设备被踢下线
case KICKED_OFFLINE_BY_OTHER_CLIENT: case KICKED_OFFLINE_BY_OTHER_CLIENT:
EventBus.getDefault().post(new RongIMConnectionStatusEvent().setStatus(-1)); EventBus.getDefault().post(new RongIMConnectionStatusEvent());
break; break;
//连接暂时挂起多是由于网络问题导致SDK 会在合适时机进行自动重连 //连接暂时挂起多是由于网络问题导致SDK 会在合适时机进行自动重连
case SUSPEND: case SUSPEND:
break; break;
//连接成功 //连接成功
case CONNECTED: case CONNECTED:
EventBus.getDefault().post(new RongIMConnectionStatusEvent().setStatus(1));
break; break;
//连接超时SDK 将停止连接用户需要做超时处理再自行调用连接接口进行连接 //连接超时SDK 将停止连接用户需要做超时处理再自行调用连接接口进行连接
case TIMEOUT: case TIMEOUT:
@ -231,4 +253,66 @@ public class RongcloudIMManager {
} }
/**
* 发送消息失败重连次数超过3就重新登录
*/
private static int reconnectIndex = 0;
public static void sendMessage(final Message message, final String pushContent, final String pushData, final IRongCallback.ISendMessageCallback callback) {
RongIMClient.getInstance().sendMessage(message, pushContent, pushData, new IRongCallback.ISendMessageCallback() {
@Override
public void onAttached(Message message) {
if (callback != null) {
callback.onAttached(message);
}
}
@Override
public void onSuccess(Message message) {
reconnectIndex = 0;
if (callback != null) {
callback.onSuccess(message);
}
}
@Override
public void onError(Message message, RongIMClient.ErrorCode errorCode) {
if (reconnectIndex > 2) {
reconnectIndex = 0;
ToastUtil.show(WordUtil.getNewString(R.string.login_invalid));
EventBus.getDefault().post(new RongIMConnectionStatusEvent());
return;
}
if (errorCode.code == 33000) {
reconnectIndex++;
connectIM(AppManager.getInstance().getMainActivity(), new RongIMClient.ConnectCallback() {
@Override
public void onSuccess(String t) {
sendMessage(message, pushContent, pushData, callback);
}
@Override
public void onError(RongIMClient.ConnectionErrorCode e) {
sendMessage(message, pushContent, pushData, callback);
}
@Override
public void onDatabaseOpened(RongIMClient.DatabaseOpenStatus code) {
if (RongIMClient.DatabaseOpenStatus.DATABASE_OPEN_ERROR.equals(code)) {
sendMessage(message, pushContent, pushData, callback);
}
}
});
} else {
if (callback != null) {
callback.onError(message, errorCode);
}
}
}
});
}
} }

View File

@ -22,11 +22,11 @@ ext {
// true表示谷歌支付 false // true表示谷歌支付 false
// isGooglePlay : false, // isGooglePlay : false,
// true表示谷歌支付 false 0 1 2 // true表示谷歌支付 false 0 1 2
isGooglePlay : 1, isGooglePlay : 0,
// //
isUploadLog : true, isUploadLog : true,
// //
isPluginModel : false, isPluginModel : true,
] ]
} }

View File

@ -70,6 +70,7 @@ import com.yunbao.common.manager.IMRTCManager;
import com.yunbao.common.manager.MicUserManager; import com.yunbao.common.manager.MicUserManager;
import com.yunbao.common.manager.MicedUserManager; import com.yunbao.common.manager.MicedUserManager;
import com.yunbao.common.manager.RandomPkManager; import com.yunbao.common.manager.RandomPkManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.BitmapUtil; import com.yunbao.common.utils.BitmapUtil;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DateFormatUtil; import com.yunbao.common.utils.DateFormatUtil;
@ -429,7 +430,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
Message message = Message.obtain("g" + mLiveUid, conversationType, messageContent); Message message = Message.obtain("g" + mLiveUid, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {
@ -1873,7 +1874,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(targetId, conversationType, messageContent); Message message = Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {

View File

@ -30,6 +30,7 @@ import com.yunbao.common.http.API;
import com.yunbao.common.http.ResponseModel; import com.yunbao.common.http.ResponseModel;
import com.yunbao.common.manager.MicUserManager; import com.yunbao.common.manager.MicUserManager;
import com.yunbao.common.manager.MicedUserManager; import com.yunbao.common.manager.MicedUserManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.CommonIconUtil; import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
@ -181,7 +182,7 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter<UserBean> {
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE; Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(bean.getId(), conversationType, messageContent); io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(bean.getId(), conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(io.rong.imlib.model.Message message) { public void onAttached(io.rong.imlib.model.Message message) {

View File

@ -25,6 +25,7 @@ import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient; import com.yunbao.common.http.HttpClient;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
@ -204,7 +205,7 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent); io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(io.rong.imlib.model.Message message) { public void onAttached(io.rong.imlib.model.Message message) {
@ -253,7 +254,7 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent); io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(io.rong.imlib.model.Message message) { public void onAttached(io.rong.imlib.model.Message message) {

View File

@ -14,6 +14,7 @@ import androidx.annotation.NonNull;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.dialog.DebugDialog;
import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.message.content.MessageChatTipsContent; import com.yunbao.common.message.content.MessageChatTipsContent;
import com.yunbao.common.utils.DateFormatUtil; import com.yunbao.common.utils.DateFormatUtil;
@ -162,6 +163,15 @@ public class PDLiveMessageListAdapter extends MessageListAdapter {
holder.getView(R.id.right_liveStatus).setVisibility(View.GONE); holder.getView(R.id.right_liveStatus).setVisibility(View.GONE);
} }
} }
/* if (messageDirection == Message.MessageDirection.RECEIVE) {
holder.setText(R.id.left_time, DateFormatUtil.formatDate(new Date(mDataList.get(position).getSentTime()), "MM-dd hh:mm:ss"));
holder.getView(R.id.left_time).setVisibility(View.VISIBLE);
holder.getView(R.id.right_time).setVisibility(View.INVISIBLE);
} else if (messageDirection == Message.MessageDirection.SEND) {
holder.setText(R.id.right_time, DateFormatUtil.formatDate(new Date(mDataList.get(position).getSentTime()), "MM-dd hh:mm:ss"));
holder.getView(R.id.right_time).setVisibility(View.VISIBLE);
holder.getView(R.id.left_time).setVisibility(View.INVISIBLE);
}*/
} }

View File

@ -49,6 +49,7 @@ import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.IMRTCManager; import com.yunbao.common.manager.IMRTCManager;
import com.yunbao.common.manager.RandomPkManager; import com.yunbao.common.manager.RandomPkManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
@ -805,7 +806,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain("g" + CommonAppConfig.getInstance().getUid(), conversationType, messageContent); io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain("g" + CommonAppConfig.getInstance().getUid(), conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(io.rong.imlib.model.Message message) { public void onAttached(io.rong.imlib.model.Message message) {
@ -1068,7 +1069,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent); io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(io.rong.imlib.model.Message message) { public void onAttached(io.rong.imlib.model.Message message) {
@ -1343,7 +1344,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent); io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(io.rong.imlib.model.Message message) { public void onAttached(io.rong.imlib.model.Message message) {
@ -1439,7 +1440,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent); io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(io.rong.imlib.model.Message message) { public void onAttached(io.rong.imlib.model.Message message) {
@ -1543,7 +1544,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent); io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(io.rong.imlib.model.Message message) { public void onAttached(io.rong.imlib.model.Message message) {
@ -1585,7 +1586,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent); io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(io.rong.imlib.model.Message message) { public void onAttached(io.rong.imlib.model.Message message) {

View File

@ -13,6 +13,7 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
@ -55,7 +56,7 @@ public class SocketRyChatUtil {
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(targetId, conversationType, messageContent); Message message = Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {
@ -121,7 +122,7 @@ public class SocketRyChatUtil {
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(targetId, conversationType, messageContent); Message message = Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {
@ -192,7 +193,7 @@ public class SocketRyChatUtil {
Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM; Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM;
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(targetId, conversationType, messageContent); Message message = Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {
@ -257,7 +258,7 @@ public class SocketRyChatUtil {
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(targetId, conversationType, messageContent); Message message = Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {
@ -396,7 +397,7 @@ public class SocketRyChatUtil {
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(targetId, conversationType, messageContent); Message message = Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {
@ -466,7 +467,7 @@ public class SocketRyChatUtil {
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(targetId, conversationType, messageContent); Message message = Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {
@ -513,7 +514,7 @@ public class SocketRyChatUtil {
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(targetId, conversationType, messageContent); Message message = Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {
@ -550,7 +551,7 @@ public class SocketRyChatUtil {
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(targetId, conversationType, messageContent); Message message = Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {
@ -593,7 +594,7 @@ public class SocketRyChatUtil {
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(targetId, conversationType, messageContent); Message message = Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {
@ -630,7 +631,7 @@ public class SocketRyChatUtil {
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(targetId, conversationType, messageContent); Message message = Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {
@ -670,7 +671,7 @@ public class SocketRyChatUtil {
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(targetId, conversationType, messageContent); Message message = Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {
@ -776,7 +777,7 @@ public class SocketRyChatUtil {
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(targetId, conversationType, messageContent); Message message = Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {

View File

@ -7,6 +7,7 @@ import com.yunbao.common.Constants;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient; import com.yunbao.common.http.HttpClient;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.live.activity.LiveRyAnchorActivity; import com.yunbao.live.activity.LiveRyAnchorActivity;
import io.rong.imlib.IRongCallback; import io.rong.imlib.IRongCallback;
@ -73,7 +74,7 @@ public class SocketRyLinkMicPkUtil {
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
Message message1 = Message.obtain("g" + CommonAppConfig.getInstance().getUid(), conversationType, messageContent); Message message1 = Message.obtain("g" + CommonAppConfig.getInstance().getUid(), conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message1, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message1, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {
@ -136,7 +137,7 @@ public class SocketRyLinkMicPkUtil {
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(pkUid, conversationType, messageContent); Message message = Message.obtain(pkUid, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {

View File

@ -46,6 +46,7 @@ import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.IMRTCManager; import com.yunbao.common.manager.IMRTCManager;
import com.yunbao.common.manager.RandomPkManager; import com.yunbao.common.manager.RandomPkManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
@ -258,7 +259,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent); io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(io.rong.imlib.model.Message message) { public void onAttached(io.rong.imlib.model.Message message) {

View File

@ -29,6 +29,7 @@ import com.blankj.utilcode.util.GsonUtils;
import com.lzf.easyfloat.EasyFloat; import com.lzf.easyfloat.EasyFloat;
import com.lzf.easyfloat.permission.PermissionUtils; import com.lzf.easyfloat.permission.PermissionUtils;
import com.lzf.easyfloat.utils.LifecycleUtils; import com.lzf.easyfloat.utils.LifecycleUtils;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.MobclickAgent; import com.yunbao.common.utils.MobclickAgent;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext; import com.yunbao.common.CommonAppContext;
@ -1005,7 +1006,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(liveID, conversationType, messageContent); io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(liveID, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(io.rong.imlib.model.Message message) { public void onAttached(io.rong.imlib.model.Message message) {

View File

@ -59,6 +59,7 @@ import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.interfaces.OnItemLongClickListener; import com.yunbao.common.interfaces.OnItemLongClickListener;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.SpUtil;
@ -589,7 +590,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
messagesList.remove(position); messagesList.remove(position);
setDellPosition(position); setDellPosition(position);
} }
RongIMClient.getInstance().sendMessage(inMessage, null, null, new IRongCallback.ISendMessageCallback() { RongcloudIMManager.sendMessage(inMessage, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
public void onAttached(Message message) { public void onAttached(Message message) {