直播间聊天信息问题
This commit is contained in:
parent
234877fabc
commit
25e3e86230
@ -32,9 +32,9 @@ import static com.yunbao.common.CommonAppContext.isReady;
|
|||||||
*/
|
*/
|
||||||
public class RongcloudIMManager {
|
public class RongcloudIMManager {
|
||||||
//融云开发者平台注册app唯一识别符
|
//融云开发者平台注册app唯一识别符
|
||||||
// public static final String RONG_IM_KEY = "uwd1c0sxu1p71";
|
public static final String RONG_IM_KEY = "uwd1c0sxu1p71";
|
||||||
//测试环境
|
//测试环境
|
||||||
public static final String RONG_IM_KEY = "pvxdm17jpd3hr";
|
// public static final String RONG_IM_KEY = "pvxdm17jpd3hr";
|
||||||
|
|
||||||
private static final String CLASSNAME = "RongcloudIMManager";
|
private static final String CLASSNAME = "RongcloudIMManager";
|
||||||
|
|
||||||
|
@ -3,12 +3,9 @@ package com.yunbao.live.adapter;
|
|||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.text.style.ForegroundColorSpan;
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -17,6 +14,11 @@ import android.widget.ImageView;
|
|||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
@ -278,23 +280,46 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
|||||||
mTextView.setText(builder);
|
mTextView.setText(builder);
|
||||||
} else if (bean.getType() == -10) {
|
} else if (bean.getType() == -10) {
|
||||||
mBg.setBackground(null);
|
mBg.setBackground(null);
|
||||||
// mTextView.setVisibility(View.GONE);
|
|
||||||
} else if (bean.getType() == LiveChatBean.SYSTEM) {
|
} else if (bean.getType() == LiveChatBean.SYSTEM) {
|
||||||
|
boolean isContains = false;
|
||||||
|
for (LiveChatBean model : mList) {
|
||||||
|
if (!TextUtils.isEmpty(model.getContent())&&model.getContent().contains("堅決維護青少年群體精神文明健康")) {
|
||||||
|
isContains = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isContains) {
|
||||||
mTextView.setTextColor(0xffffffff);
|
mTextView.setTextColor(0xffffffff);
|
||||||
mBg.setBackground(null);
|
mBg.setBackground(null);
|
||||||
mTextView.setText(bean.getContent());
|
mTextView.setText(bean.getContent());
|
||||||
|
}
|
||||||
} else if (bean.getType() == -1) {//自动消息,关注
|
} else if (bean.getType() == -1) {//自动消息,关注
|
||||||
|
boolean isContains = false;
|
||||||
|
for (LiveChatBean model : mList) {
|
||||||
|
if (bean.getType() == -1) {
|
||||||
|
isContains = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isContains) {
|
||||||
mBg.setBackground(null);
|
mBg.setBackground(null);
|
||||||
mTextView.setVisibility(View.GONE);
|
mTextView.setVisibility(View.GONE);
|
||||||
view_follow.setVisibility(View.VISIBLE);
|
view_follow.setVisibility(View.VISIBLE);
|
||||||
ImgLoader.display(mContext, bean.getId(), avatar);
|
ImgLoader.display(mContext, bean.getId(), avatar);
|
||||||
bean.setHeart(position);
|
bean.setHeart(position);
|
||||||
|
}
|
||||||
|
|
||||||
} else if (bean.getType() == -2) {//自动消息,点击发言
|
} else if (bean.getType() == -2) {//自动消息,点击发言
|
||||||
|
boolean isContains = false;
|
||||||
|
for (LiveChatBean model : mList) {
|
||||||
|
if (bean.getType() == -2) {
|
||||||
|
isContains = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isContains) {
|
||||||
mBg.setBackgroundResource(R.drawable.bg_chat_automatic_item);
|
mBg.setBackgroundResource(R.drawable.bg_chat_automatic_item);
|
||||||
mTextView.setText(R.string.automatic_chat);
|
mTextView.setText(R.string.automatic_chat);
|
||||||
bean.setHeart(position);
|
bean.setHeart(position);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// LoadDian9TuUtil.loadDian9Tu(mContext, mBg, "https://qny.shayucm.com/huangdi-new-qipao.png");
|
|
||||||
if (bean.getBubble() != null && !bean.getBubble().equals("")) {
|
if (bean.getBubble() != null && !bean.getBubble().equals("")) {
|
||||||
//加载.9图聊天气泡
|
//加载.9图聊天气泡
|
||||||
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getBubble(), 1);
|
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getBubble(), 1);
|
||||||
@ -306,23 +331,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
|||||||
} else {
|
} else {
|
||||||
mTextView.setTextColor(0xffffffff);
|
mTextView.setTextColor(0xffffffff);
|
||||||
}
|
}
|
||||||
// Log.e("tag",bean.getContent().length()+"");
|
|
||||||
// RecyclerView.LayoutParams linearParams = (RecyclerView.LayoutParams) mBg.getLayoutParams();
|
|
||||||
// linearParams.height = RecyclerView.LayoutParams.WRAP_CONTENT;
|
|
||||||
// // 控件的宽强制设成40
|
|
||||||
// mBg.setLayoutParams(linearParams); //使设置好的布局参数应用到控件
|
|
||||||
// if(bean.getContent().length()<=7) {
|
|
||||||
// RecyclerView.LayoutParams linearParams1 = (RecyclerView.LayoutParams) mBg.getLayoutParams();
|
|
||||||
// linearParams1.height = mContext.getResources().getDimensionPixelOffset(R.dimen.live_chat1);
|
|
||||||
// // 控件的宽强制设成40
|
|
||||||
// mBg.setLayoutParams(linearParams1); //使设置好的布局参数应用到控件
|
|
||||||
// }
|
|
||||||
// else if(bean.getContent().length()<=20){
|
|
||||||
// RecyclerView.LayoutParams linearParams = (RecyclerView.LayoutParams) mBg.getLayoutParams();
|
|
||||||
// linearParams.height = mContext.getResources().getDimensionPixelOffset(R.dimen.live_chat2);
|
|
||||||
// // 控件的宽强制设成40
|
|
||||||
// mBg.setLayoutParams(linearParams); //使设置好的布局参数应用到控件
|
|
||||||
// }
|
|
||||||
LiveTextRender.render(mContext, mTextView, bean);
|
LiveTextRender.render(mContext, mTextView, bean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user