feat : 新增BOOM 公屏消息, 封禁弹窗功能修改 , 修复部分发现的bug

This commit is contained in:
eggmanQQQ
2024-10-11 18:01:23 +08:00
parent 4dc4dfc93b
commit 47d1985d66
18 changed files with 137 additions and 85 deletions

View File

@@ -51,11 +51,11 @@ class RoomBoomInfoDialog : BaseDialogFragment<DialogRoomBoomInfoBinding>() {
} }
private fun setView(boomInfos: List<BoomInfo>) { private fun setView(boomInfos: List<BoomInfo>) {
val sortedByDescending = boomInfos.sortedByDescending { it.level }
boomInfos.forEachIndexed{ index, boomInfo -> sortedByDescending.forEachIndexed{ index, boomInfo ->
val levelView = ItemRoomBoomInfoLevelBinding.inflate(layoutInflater, binding.levelLayout, true) val levelView = ItemRoomBoomInfoLevelBinding.inflate(layoutInflater, binding.levelLayout, true)
levelView.root.setBackgroundResource(R.color.transparent) levelView.root.setBackgroundResource(R.color.transparent)
levelView.levelText.text="LV.${index+1}" levelView.levelText.text="LV.${boomInfo.level}"
levelView.levelIcon.loadImage(boomInfo.pic) levelView.levelIcon.loadImage(boomInfo.pic)
levelView.root.tag = boomInfo levelView.root.tag = boomInfo
levelView.root.setOnClickListener { levelView.root.setOnClickListener {

View File

@@ -4,12 +4,11 @@ import android.content.Context
import android.view.Gravity import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.Window
import com.chwl.app.R import com.chwl.app.R
import com.chwl.app.bindadapter.BaseAdapter import com.chwl.app.bindadapter.BaseAdapter
import com.chwl.app.bindadapter.BindingViewHolder import com.chwl.app.bindadapter.BindingViewHolder
import com.chwl.app.databinding.RoomNotifyBoomRewardBinding import com.chwl.app.databinding.RoomBoomRewardBinding
import com.chwl.app.databinding.RoomNotifyBoomRewardItemBinding import com.chwl.app.databinding.RoomBoomRewardItemBinding
import com.chwl.app.ui.utils.loadImage import com.chwl.app.ui.utils.loadImage
import com.chwl.core.auth.AuthModel import com.chwl.core.auth.AuthModel
import com.chwl.core.gift.bean.BoomMsgAwardBean import com.chwl.core.gift.bean.BoomMsgAwardBean
@@ -17,22 +16,22 @@ import com.chwl.library.common.util.isVerify
import com.chwl.library.common.util.setViewWH import com.chwl.library.common.util.setViewWH
import com.chwl.library.common.util.setVis import com.chwl.library.common.util.setVis
class RoomNotifyBoomRewardDialog(private val context: Context) : class RoomBoomRewardDialog(private val context: Context) :
BaseRoomNotifyDialog<RoomNotifyBoomRewardBinding>(context) { BaseRoomNotifyDialog<RoomBoomRewardBinding>(context) {
var list : List<BoomMsgAwardBean>?=null var list : List<BoomMsgAwardBean>?=null
var mAdapter = object : BaseAdapter<BoomMsgAwardBean>(R.layout.room_notify_boom_reward_item, 1) { var mAdapter = object : BaseAdapter<BoomMsgAwardBean>(R.layout.room_boom_reward_item, 1) {
override fun convert(helper: BindingViewHolder, item: BoomMsgAwardBean?) { override fun convert(helper: BindingViewHolder, item: BoomMsgAwardBean?) {
val binding = RoomNotifyBoomRewardItemBinding.bind(helper.itemView) val binding = RoomBoomRewardItemBinding.bind(helper.itemView)
binding.boomItem.loadImage(item?.awardPic) binding.boomItem.loadImage(item?.awardPic)
} }
} }
override fun createBinding(inflater: LayoutInflater): RoomNotifyBoomRewardBinding { override fun createBinding(inflater: LayoutInflater): RoomBoomRewardBinding {
return RoomNotifyBoomRewardBinding.inflate(inflater) return RoomBoomRewardBinding.inflate(inflater)
} }

View File

@@ -60,7 +60,6 @@ import com.chwl.app.friend.view.SelectFriendActivity
import com.chwl.app.home.adapter.RoomActAdapter import com.chwl.app.home.adapter.RoomActAdapter
import com.chwl.app.music.widget.MusicPlayerView import com.chwl.app.music.widget.MusicPlayerView
import com.chwl.app.room_chat.activity.RoomMsgActivity import com.chwl.app.room_chat.activity.RoomMsgActivity
import com.chwl.app.ui.utils.BoomUtil
import com.chwl.app.ui.utils.ImageLoadUtils import com.chwl.app.ui.utils.ImageLoadUtils
import com.chwl.app.ui.utils.loadImage import com.chwl.app.ui.utils.loadImage
import com.chwl.app.ui.webview.CommonWebViewActivity import com.chwl.app.ui.webview.CommonWebViewActivity

View File

@@ -26,7 +26,7 @@ import com.chwl.app.databinding.LayoutRoomNotifyLuckyGiftTipBinding;
import com.chwl.app.utils.GiftAnimUtil; import com.chwl.app.utils.GiftAnimUtil;
import com.chwl.app.utils.NumberUtils; import com.chwl.app.utils.NumberUtils;
import com.chwl.app.utils.RoomBoomManager; import com.chwl.app.utils.RoomBoomManager;
import com.chwl.app.utils.RoomNotifyManager; import com.chwl.app.utils.RoomNotifyDialogManager;
import com.chwl.app.utils.WeakPool; import com.chwl.app.utils.WeakPool;
import com.chwl.core.auth.AuthModel; import com.chwl.core.auth.AuthModel;
import com.chwl.core.gift.bean.CpMsgBean; import com.chwl.core.gift.bean.CpMsgBean;
@@ -524,7 +524,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
luckyGiftTipPool.clear(); luckyGiftTipPool.clear();
handler.removeCallbacksAndMessages(null); handler.removeCallbacksAndMessages(null);
RoomNotifyManager.INSTANCE. clear(); RoomNotifyDialogManager.INSTANCE. clear();
RoomBoomManager.INSTANCE. clear(); RoomBoomManager.INSTANCE. clear();
if (giftView != null) { if (giftView != null) {
@@ -766,7 +766,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
private void showLuckyGiftDlg(LuckyGiftMsgAllBean data) { private void showLuckyGiftDlg(LuckyGiftMsgAllBean data) {
//todo do 校验数据是否异常 //todo do 校验数据是否异常
RoomNotifyManager.INSTANCE.addDialog(new RoomNotifyDialogBean( RoomNotifyDialogManager.INSTANCE.addDialog(new RoomNotifyDialogBean(
CustomAttachment.CUSTOM_MSG_SUPER_LUCKY_GIFT_TEMPLATE, CustomAttachment.CUSTOM_MSG_SUPER_LUCKY_GIFT_TEMPLATE,
CustomAttachment.CUSTOM_MSG_SUPER_LUCKY_GIFT_ROOM, CustomAttachment.CUSTOM_MSG_SUPER_LUCKY_GIFT_ROOM,
data data
@@ -781,7 +781,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
//todo do 校验数据是否异常 //todo do 校验数据是否异常
CpMsgBean cpMsgBean = roomEvent.getCpMsgBean(); CpMsgBean cpMsgBean = roomEvent.getCpMsgBean();
if (cpMsgBean != null) { if (cpMsgBean != null) {
RoomNotifyManager.INSTANCE.addDialog(new RoomNotifyDialogBean( RoomNotifyDialogManager.INSTANCE.addDialog(new RoomNotifyDialogBean(
CustomAttachment.CP_FIRST, CustomAttachment.CP_FIRST,
cpMsgBean.getSecond(), cpMsgBean.getSecond(),
cpMsgBean cpMsgBean

View File

@@ -238,24 +238,34 @@ public class BottomView extends LinearLayout implements View.OnClickListener {
// openMic.setImageResource(R.drawable.room_menu_ic_mic_close); // openMic.setImageResource(R.drawable.room_menu_ic_mic_close);
// } // }
// if (isOpen) {
RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo; if (AudioEngineManager.get().isNotRecord()) {
if (currentRoomInfo != null) { openMic.setImageResource(R.drawable.room_menu_ic_mic_music);
openMic.setEnabled(true); } else {
if(!AudioEngineManager.get().isMute()){ openMic.setImageResource(R.drawable.room_menu_ic_mic_open);
if (AudioEngineManager.get().isNotRecord()) {
openMic.setImageResource(R.drawable.room_menu_ic_mic_music);
} else {
openMic.setImageResource(R.drawable.room_menu_ic_mic_open);
}
}else{
openMic.setImageResource(R.drawable.room_menu_ic_mic_close);
} }
} else { } else {
openMic.setEnabled(false);
openMic.setImageResource(R.drawable.room_menu_ic_mic_close); openMic.setImageResource(R.drawable.room_menu_ic_mic_close);
} }
//
// RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
// if (currentRoomInfo != null) {
// openMic.setEnabled(true);
// if(!AudioEngineManager.get().isMute()){
// if (AudioEngineManager.get().isNotRecord()) {
// openMic.setImageResource(R.drawable.room_menu_ic_mic_music);
// } else {
// openMic.setImageResource(R.drawable.room_menu_ic_mic_open);
// }
// }else{
// openMic.setImageResource(R.drawable.room_menu_ic_mic_close);
// }
// } else {
// openMic.setEnabled(false);
// openMic.setImageResource(R.drawable.room_menu_ic_mic_close);
// }
} }
@@ -490,10 +500,12 @@ public class BottomView extends LinearLayout implements View.OnClickListener {
contentView = LayoutInflater.from(getContext()).inflate(R.layout.popup_mic_set, null); contentView = LayoutInflater.from(getContext()).inflate(R.layout.popup_mic_set, null);
micSetPopupWindow = new PopupWindow(contentView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); micSetPopupWindow = new PopupWindow(contentView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
micSetPopupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); micSetPopupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
micSetPopupWindow.setTouchable(true); micSetPopupWindow.setOutsideTouchable(true);
micSetPopupWindow.setFocusable(false); // micSetPopupWindow.setTouchable(true);
// micSetPopupWindow.setFocusable(false);
// micSetPopupWindow.setAnimationStyle(R.style.style_anim_mic_set); // micSetPopupWindow.setAnimationStyle(R.style.style_anim_mic_set);
} else { } else {
if (micSetPopupWindow.isShowing()) return;
contentView = micSetPopupWindow.getContentView(); contentView = micSetPopupWindow.getContentView();
} }
@@ -526,7 +538,7 @@ public class BottomView extends LinearLayout implements View.OnClickListener {
int[] vLoc = new int[2]; int[] vLoc = new int[2];
parent.getLocationInWindow(vLoc); parent.getLocationInWindow(vLoc);
try { try {
micSetPopupWindow.showAsDropDown(parent,0, -ScreenUtil.dip2px(180),Gravity.CENTER_HORIZONTAL); micSetPopupWindow.showAsDropDown(parent,0, -ScreenUtil.dip2px(190),Gravity.CENTER_HORIZONTAL);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@@ -1,5 +1,7 @@
package com.chwl.app.avroom.widget; package com.chwl.app.avroom.widget;
import static com.chwl.core.im.custom.bean.CustomAttachment.BOOM_FIRST;
import static com.chwl.core.im.custom.bean.CustomAttachment.BOOM_SECOND_DIALOG;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_FAIRY; import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_FAIRY;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GIFT_COMPOUND; import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GIFT_COMPOUND;
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_RED_PACKAGE; import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_RED_PACKAGE;
@@ -58,6 +60,8 @@ import com.chwl.app.photo.BigPhotoActivity;
import com.chwl.app.photo.PagerOption; import com.chwl.app.photo.PagerOption;
import com.chwl.app.ui.widget.TextSpannableBuilder; import com.chwl.app.ui.widget.TextSpannableBuilder;
import com.chwl.app.utils.ObjectTypeHelper; import com.chwl.app.utils.ObjectTypeHelper;
import com.chwl.core.gift.bean.BoomMsgDialogBean;
import com.chwl.core.im.custom.bean.BoomMsgAttachment;
import com.chwl.core.im.custom.bean.TemplateMessageAttachment; import com.chwl.core.im.custom.bean.TemplateMessageAttachment;
import com.chwl.core.monsterhunting.bean.MonsterDataBean; import com.chwl.core.monsterhunting.bean.MonsterDataBean;
import com.chwl.core.utils.extension.StringExtensionKt; import com.chwl.core.utils.extension.StringExtensionKt;
@@ -246,6 +250,8 @@ public class MessageView extends FrameLayout {
private int expLevelWidth; private int expLevelWidth;
private int expLevelHeight; private int expLevelHeight;
private int giftLength; private int giftLength;
private int boomWidth;
private int boomHeight;
private volatile boolean needAutoScroll = true;//是否自動滾動到底部 private volatile boolean needAutoScroll = true;//是否自動滾動到底部
private Consumer<String> clickConsumer; private Consumer<String> clickConsumer;
private OnClick onClick; private OnClick onClick;
@@ -269,7 +275,9 @@ public class MessageView extends FrameLayout {
mMessageAdapter.notifyDataSetChanged(); mMessageAdapter.notifyDataSetChanged();
messageListView.post(() -> { messageListView.post(() -> {
needAutoScroll = true; needAutoScroll = true;
messageListView.scrollToPosition(mMessageAdapter.getItemCount() - 1); if (mMessageAdapter.getItemCount() - 1 >= 0) {
messageListView.scrollToPosition(mMessageAdapter.getItemCount() - 1);
}
}); });
} }
@@ -319,7 +327,9 @@ public class MessageView extends FrameLayout {
this.allMessages.addAll(tmpList); this.allMessages.addAll(tmpList);
addMsgByType(tmpList,false); addMsgByType(tmpList,false);
} }
messageListView.scrollToPosition(mMessageAdapter.getItemCount() - 1); if (mMessageAdapter.getItemCount() - 1 >= 0) {
messageListView.scrollToPosition(mMessageAdapter.getItemCount() - 1);
}
disposable = AvRoomDataManager.get().getChatRoomMsgProcessor() disposable = AvRoomDataManager.get().getChatRoomMsgProcessor()
.subscribe(this::onCurrentRoomReceiveNewMsg); .subscribe(this::onCurrentRoomReceiveNewMsg);
} }
@@ -367,6 +377,8 @@ public class MessageView extends FrameLayout {
expLevelHeight = Utils.dip2px(context, 18); expLevelHeight = Utils.dip2px(context, 18);
expLevelWidth = expLevelHeight * 36 / 18;//expLevelHeight * 114 / 45 expLevelWidth = expLevelHeight * 36 / 18;//expLevelHeight * 114 / 45
giftLength = Utils.dip2px(context, 35); giftLength = Utils.dip2px(context, 35);
boomWidth = Utils.dip2px(context, 41);
boomHeight = Utils.dip2px(context, 60);
// 內容區域 // 內容區域
layoutManger = new LinearLayoutManager(context, RecyclerView.VERTICAL, false); layoutManger = new LinearLayoutManager(context, RecyclerView.VERTICAL, false);
FrameLayout.LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); FrameLayout.LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
@@ -404,7 +416,10 @@ public class MessageView extends FrameLayout {
tvBottomTip.setOnClickListener(v -> { tvBottomTip.setOnClickListener(v -> {
tvBottomTip.setVisibility(GONE); tvBottomTip.setVisibility(GONE);
needAutoScroll = true; needAutoScroll = true;
messageListView.smoothScrollToPosition(mMessageAdapter.getItemCount() - 1); if (mMessageAdapter.getItemCount() - 1 >= 0) {
messageListView.smoothScrollToPosition(mMessageAdapter.getItemCount() - 1);
}
}); });
addView(tvBottomTip); addView(tvBottomTip);
@@ -512,7 +527,9 @@ public class MessageView extends FrameLayout {
List<ChatRoomMessage> msgs = new ArrayList<>(); List<ChatRoomMessage> msgs = new ArrayList<>();
msgs.add(msg); msgs.add(msg);
addMsgByType(msgs,false); addMsgByType(msgs,false);
mMessageAdapter.notifyItemInserted(mMessageAdapter.getItemCount() - 1); if (mMessageAdapter.getItemCount() - 1 >= 0) {
mMessageAdapter.notifyItemInserted(mMessageAdapter.getItemCount() - 1);
}
showTipsOrScrollToBottom(); showTipsOrScrollToBottom();
checkAtMe(msg, false); checkAtMe(msg, false);
keepSizeUnderLimit(); keepSizeUnderLimit();
@@ -522,7 +539,9 @@ public class MessageView extends FrameLayout {
allMessages.addAll(allMessages.size() > 0 ? 1 : 0, messages); allMessages.addAll(allMessages.size() > 0 ? 1 : 0, messages);
addMsgByType(messages,true); addMsgByType(messages,true);
mMessageAdapter.notifyDataSetChanged(); mMessageAdapter.notifyDataSetChanged();
messageListView.scrollToPosition(mMessageAdapter.getItemCount() - 1); if (mMessageAdapter.getItemCount() - 1 >= 0) {
messageListView.scrollToPosition(mMessageAdapter.getItemCount() - 1);
}
for (ChatRoomMessage message : messages) { for (ChatRoomMessage message : messages) {
checkAtMe(message, true); checkAtMe(message, true);
} }
@@ -591,7 +610,10 @@ public class MessageView extends FrameLayout {
} }
return; return;
} }
messageListView.smoothScrollToPosition(mMessageAdapter.getItemCount() - 1);
if (mMessageAdapter.getItemCount() - 1 >= 0) {
messageListView.smoothScrollToPosition(mMessageAdapter.getItemCount() - 1);
}
} }
public void release() { public void release() {
@@ -982,6 +1004,11 @@ public class MessageView extends FrameLayout {
} else { } else {
getTemplateMessageAdapter().convert(tvContent, null); getTemplateMessageAdapter().convert(tvContent, null);
} }
} else if (first == BOOM_FIRST) {
if (second == BOOM_SECOND_DIALOG) {
BoomMsgAttachment boomMsgAttachment = (BoomMsgAttachment) chatRoomMessage.getAttachment();
setMsgBoom(tvContent, boomMsgAttachment);
}
} else { } else {
tvContent.setTextColor(Color.WHITE); tvContent.setTextColor(Color.WHITE);
tvContent.setText(tvContent.getResources().getText(R.string.not_support_message_tip)); tvContent.setText(tvContent.getResources().getText(R.string.not_support_message_tip));
@@ -2664,6 +2691,26 @@ public class MessageView extends FrameLayout {
tvContent.setOnClickListener(null); tvContent.setOnClickListener(null);
tvContent.setMovementMethod(new LinkMovementMethod()); tvContent.setMovementMethod(new LinkMovementMethod());
} }
/**
* {boom图片} 恭喜! {用户名} 触发了超级大奖BOOM...
*/
private void setMsgBoom(TextView tvContent, BoomMsgAttachment boomMsgAttachment) {
if (boomMsgAttachment == null || boomMsgAttachment.DialogBean == null) return;
BoomMsgDialogBean data = boomMsgAttachment.DialogBean;
String boomUrl = data.getPic();
String nick = RegexUtil.getPrintableString(data.getNick());
TextSpannableBuilder text = new TextSpannableBuilder(tvContent)
.append(boomUrl, boomWidth, boomHeight)
.append(ResUtil.getString(R.string.avroom_widget_roomeffectview_04), new ForegroundColorSpan(getResources().getColor(R.color.white)))
.append(" "+nick+" ", new ForegroundColorSpan(Color.parseColor("#FF3b3b")))
.append(ResUtil.getString(R.string.roomBoomMessageView), new ForegroundColorSpan(getResources().getColor(R.color.white)));
tvContent.setText(text.build());
tvContent.setOnClickListener(null);
tvContent.setMovementMethod(new LinkMovementMethod());
tvContent.setBackgroundResource(R.drawable.shape_room_message_bg);
}
/** /**
* {badge}xxx來了 * {badge}xxx來了

View File

@@ -51,14 +51,19 @@ import com.chwl.app.utils.RoomBoomManager;
import com.chwl.core.gift.bean.BoomMsgAnimBean; import com.chwl.core.gift.bean.BoomMsgAnimBean;
import com.chwl.core.gift.bean.BoomMsgDialogBean; import com.chwl.core.gift.bean.BoomMsgDialogBean;
import com.chwl.core.im.custom.bean.BoomMsgAttachment; import com.chwl.core.im.custom.bean.BoomMsgAttachment;
import com.chwl.core.manager.AvRoomDataManager;
import com.chwl.core.utils.LogUtils; import com.chwl.core.utils.LogUtils;
import com.chwl.library.language.LanguageHelper; import com.chwl.library.language.LanguageHelper;
import com.example.lib_utils.UiUtils; import com.example.lib_utils.UiUtils;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.netease.nim.uikit.common.util.log.LogUtil; import com.netease.nim.uikit.common.util.log.LogUtil;
import com.netease.nimlib.chatroom.model.ChatRoomMessageImpl;
import com.netease.nimlib.sdk.NIMSDK; import com.netease.nimlib.sdk.NIMSDK;
import com.netease.nimlib.sdk.Observer; import com.netease.nimlib.sdk.Observer;
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
import com.netease.nimlib.sdk.msg.model.BroadcastMessage; import com.netease.nimlib.sdk.msg.model.BroadcastMessage;
import com.netease.nimlib.session.IMMessageImpl;
import com.orhanobut.logger.Logger; import com.orhanobut.logger.Logger;
import com.readystatesoftware.systembartint.SystemBarTintManager; import com.readystatesoftware.systembartint.SystemBarTintManager;
import com.tbruyelle.rxpermissions2.RxPermissions; import com.tbruyelle.rxpermissions2.RxPermissions;
@@ -1185,14 +1190,15 @@ public abstract class BaseActivity extends RxAppCompatActivity
BoomMsgDialogBean bean = JSON.parseObject(String.valueOf(baseProtocol.getData()), BoomMsgDialogBean.class); BoomMsgDialogBean bean = JSON.parseObject(String.valueOf(baseProtocol.getData()), BoomMsgDialogBean.class);
RoomBoomManager.INSTANCE.addDialog(bean); RoomBoomManager.INSTANCE.addDialog(bean);
// BoomMsgAnimBean boomMsgAnimBean = new BoomMsgAnimBean();
// boomMsgAnimBean.countDownUrl = bean.getCountDownVapUrl();
// boomMsgAnimBean.endUrl = bean.getEndVapUrl();
// boomMsgAnimBean.level = bean.getLevel();
// RoomBoomManager.INSTANCE.addAnim(boomMsgAnimBean);
RoomBoomManager.INSTANCE.notify(bean); RoomBoomManager.INSTANCE.notify(bean);
BoomMsgAttachment boomMsgAttachment = new BoomMsgAttachment(BOOM_FIRST, BOOM_SECOND_DIALOG);
boomMsgAttachment.DialogBean = bean;
ChatRoomMessage chatRoomMessage = new ChatRoomMessageImpl();
chatRoomMessage.setAttachment(boomMsgAttachment);
((IMMessageImpl)chatRoomMessage).setMsgType(MsgTypeEnum.custom.getValue());
AvRoomDataManager.get().addChatRoomMessage(chatRoomMessage);
} }
break; break;
default: default:

View File

@@ -17,9 +17,7 @@ import com.chwl.app.UIHelper
import com.chwl.app.application.IReportConstants import com.chwl.app.application.IReportConstants
import com.chwl.app.application.ReportManager import com.chwl.app.application.ReportManager
import com.chwl.app.avroom.activity.AVRoomActivity import com.chwl.app.avroom.activity.AVRoomActivity
import com.chwl.app.avroom.dialog.RoomBoomInfoDialog import com.chwl.app.avroom.dialog.RoomBoomRewardDialog
import com.chwl.app.avroom.dialog.RoomNotifyBoomDialog
import com.chwl.app.avroom.dialog.RoomNotifyBoomRewardDialog
import com.chwl.app.base.BaseActivity import com.chwl.app.base.BaseActivity
import com.chwl.app.base.BaseFragment import com.chwl.app.base.BaseFragment
import com.chwl.app.databinding.FragmentMeBinding import com.chwl.app.databinding.FragmentMeBinding
@@ -374,7 +372,7 @@ class MeFragment : BaseFragment(), View.OnClickListener {
R.id.tv_user_name -> { R.id.tv_user_name -> {
//todo do 测试按钮 //todo do 测试按钮
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
RoomNotifyBoomRewardDialog(requireContext()).apply { RoomBoomRewardDialog(requireContext()).apply {
list = arrayListOf(BoomMsgAwardBean().apply { list = arrayListOf(BoomMsgAwardBean().apply {
awardPic = "https://img.molistar.xyz/default_avatar_molistar.png" awardPic = "https://img.molistar.xyz/default_avatar_molistar.png"
uid = AuthModel.get().currentUid uid = AuthModel.get().currentUid

View File

@@ -19,7 +19,7 @@ import com.chwl.core.noble.bean.AllServiceGiftProtocol
class NotifyAdapter : FloatViewAdapter { class NotifyAdapter : FloatViewAdapter {
var onShowUserCard: ((String) -> Unit)? = null var onShowUserCard: ((String) -> Unit)? = null
//todo do 通用飘屏
override fun onCreateFloatView(context: Context, item: Any): FloatView? { override fun onCreateFloatView(context: Context, item: Any): FloatView? {
when (item) { when (item) {
// 通用飘屏 // 通用飘屏

View File

@@ -46,9 +46,8 @@ public class LogoutHelper {
if (e instanceof SocketTimeoutException || e instanceof SocketException || e instanceof HttpException) { if (e instanceof SocketTimeoutException || e instanceof SocketException || e instanceof HttpException) {
activity.toast(ResUtil.getString(R.string.login_helper_logouthelper_013)); activity.toast(ResUtil.getString(R.string.login_helper_logouthelper_013));
} else if (e instanceof BanAccountException) { } else if (e instanceof BanAccountException) {
//todo do 封禁 显示id 跟 原因
BanAccountException exception = (BanAccountException) e; BanAccountException exception = (BanAccountException) e;
String text = ResUtil.getString(R.string.login_helper_logouthelper_02) + exception.getMessage() + ResUtil.getString(R.string.login_helper_logouthelper_03); String text = exception.getMessage() + " " +ResUtil.getString(R.string.login_helper_logouthelper_03);
int start = text.length(); int start = text.length();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(ResUtil.getString(R.string.login_helper_logouthelper_04), Locale.ENGLISH); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(ResUtil.getString(R.string.login_helper_logouthelper_04), Locale.ENGLISH);
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT+08")); simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT+08"));

View File

@@ -1,22 +0,0 @@
package com.chwl.app.ui.utils
import com.chwl.app.R
object BoomUtil {
private var boomTextIcons = arrayListOf(
R.drawable.transparent_draw
)
private var boomRoomIcons = arrayListOf(
R.drawable.transparent_draw
)
fun getBoomTextIcon(level: Int) : Int{
return boomTextIcons.getOrNull(level)?:R.drawable.transparent_draw
}
fun getBoomRoomIcon(level: Int) : Int{
return boomRoomIcons.getOrNull(level)?:R.drawable.transparent_draw
}
}

View File

@@ -9,7 +9,7 @@ import com.bumptech.glide.request.target.Target
import com.chwl.app.application.GlobalHandleManager import com.chwl.app.application.GlobalHandleManager
import com.chwl.app.avroom.dialog.BaseRoomNotifyDialog import com.chwl.app.avroom.dialog.BaseRoomNotifyDialog
import com.chwl.app.avroom.dialog.RoomNotifyBoomDialog import com.chwl.app.avroom.dialog.RoomNotifyBoomDialog
import com.chwl.app.avroom.dialog.RoomNotifyBoomRewardDialog import com.chwl.app.avroom.dialog.RoomBoomRewardDialog
import com.chwl.app.avroom.widget.GalleryLayoutManager.LayoutParams import com.chwl.app.avroom.widget.GalleryLayoutManager.LayoutParams
import com.chwl.core.gift.bean.BoomInfo import com.chwl.core.gift.bean.BoomInfo
import com.chwl.core.gift.bean.BoomMsgAnimBean import com.chwl.core.gift.bean.BoomMsgAnimBean
@@ -88,12 +88,18 @@ object RoomBoomManager {
private fun showNextAnim() { private fun showNextAnim() {
LogUtils.d(" RoomBoomManager showNextAnim()-- start") LogUtils.d(" RoomBoomManager showNextAnim()-- start")
if (AnimQueue.isNotEmpty() && mAnimLayout != null && !isAnimStart) { if (AnimQueue.isNotEmpty() && mAnimLayout != null && !isAnimStart) {
val animData = AnimQueue.removeAt(0) // val animData = AnimQueue.removeAt(0)
val urls = arrayListOf<String>() val minBy = AnimQueue.minBy { it.level }
if (animData.countDownUrl.isVerify()) urls.add(animData.countDownUrl) val index = AnimQueue.indexOf(minBy)
if (animData.endUrl.isVerify()) urls.add(animData.endUrl) val animData = AnimQueue.removeAt(index)
LogUtils.d(" RoomBoomManager showNextAnim()-- end") animData?.let { anim ->
startDownAnim(urls, animData) val urls = arrayListOf<String>()
if (anim.countDownUrl.isVerify()) urls.add(anim.countDownUrl)
if (anim.endUrl.isVerify()) urls.add(anim.endUrl)
LogUtils.d(" RoomBoomManager showNextAnim()-- end")
startDownAnim(urls, anim)
}
} }
} }
@@ -251,10 +257,10 @@ object RoomBoomManager {
val award = awardQueue.removeAt(awardIndex) val award = awardQueue.removeAt(awardIndex)
if (award.list.isVerify()) { if (award.list.isVerify()) {
val activity = GlobalHandleManager.get().activity ?: return val activity = GlobalHandleManager.get().activity ?: return
val dialog = RoomNotifyBoomRewardDialog(activity) val dialog = RoomBoomRewardDialog(activity)
dialog.list = award.list dialog.list = award.list
dialog.setOnDismissListener { dialog.setOnDismissListener {
startAnimEnd(animData) startAnimEnd(animData,false)
} }
dialog.showDialog() dialog.showDialog()
LogUtils.d(" RoomBoomManager showAwardDialog showDialog ") LogUtils.d(" RoomBoomManager showAwardDialog showDialog ")

View File

@@ -12,7 +12,7 @@ import com.chwl.core.gift.bean.RoomNotifyDialogBean
import com.chwl.core.im.custom.bean.CustomAttachment import com.chwl.core.im.custom.bean.CustomAttachment
import java.util.LinkedList import java.util.LinkedList
object RoomNotifyManager { object RoomNotifyDialogManager {
private val queue = LinkedList<RoomNotifyDialogBean>() private val queue = LinkedList<RoomNotifyDialogBean>()
private var dialog : BaseRoomNotifyDialog<*>?=null private var dialog : BaseRoomNotifyDialog<*>?=null

View File

@@ -65,7 +65,7 @@
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="3" app:spanCount="3"
tools:itemCount="1" tools:itemCount="1"
tools:listitem="@layout/room_notify_boom_reward_item" /> tools:listitem="@layout/room_boom_reward_item" />
</FrameLayout> </FrameLayout>

View File

@@ -5372,6 +5372,7 @@ You cannot join again within 24 hours after leaving</string>
<string name="roomBoomInfoRankTitle">roomBoomInfoRankTitle</string> <string name="roomBoomInfoRankTitle">roomBoomInfoRankTitle</string>
<string name="roomBoomInfoAwardHint">roomBoomInfoAwardHint</string> <string name="roomBoomInfoAwardHint">roomBoomInfoAwardHint</string>
<string name="roomBoomInfoAwardBtn">roomBoomInfoAwardBtn</string> <string name="roomBoomInfoAwardBtn">roomBoomInfoAwardBtn</string>
<string name="roomBoomMessageView">触发大奖</string>

View File

@@ -11,6 +11,7 @@ import androidx.annotation.NonNull;
import com.chwl.app.ui.widget.dialog.BaseDialog; import com.chwl.app.ui.widget.dialog.BaseDialog;
import com.chwl.app.R; import com.chwl.app.R;
import com.chwl.core.manager.AudioEngineManager;
import com.chwl.core.music.model.PlayerModel; import com.chwl.core.music.model.PlayerModel;

View File

@@ -281,10 +281,16 @@ public class PlayerModel extends BaseModel implements IPlayerModel {
AudioEngineManager.get().adjustAudioMixingVolume(volume); AudioEngineManager.get().adjustAudioMixingVolume(volume);
} }
/**
* 此方法是 音乐播放处的 音量调节弹窗 ,音量进度条回调那里 调用
*/
@Override @Override
public void seekRecordingVolume(int volume) { public void seekRecordingVolume(int volume) {
this.recordingVolume = volume; this.recordingVolume = volume;
// CommonPref.instance(BasicConfig.INSTANCE.getAppContext()).putInt("recordingVolume", volume); // CommonPref.instance(BasicConfig.INSTANCE.getAppContext()).putInt("recordingVolume", volume);
if (AudioEngineManager.get().isNotRecord()){
AudioEngineManager.get().setNotRecord(false);
}
VolumeSetting.putVoiceVolume(volume); VolumeSetting.putVoiceVolume(volume);
AudioEngineManager.get().adjustRecordingSignalVolume(volume); AudioEngineManager.get().adjustRecordingSignalVolume(volume);
} }