[Modify]幸运塔罗新增公屏通知, 飘屏

This commit is contained in:
wzq
2023-09-15 18:31:57 +08:00
parent 1c20b65a64
commit 0a54824057
15 changed files with 266 additions and 39 deletions

View File

@@ -85,6 +85,7 @@
android:theme="@style/MyMaterialTheme"
tools:replace="android:name,android:allowBackup"
tools:targetApi="n">
<activity
android:name=".other.activity.SplashActivity"
android:exported="true"
@@ -1004,6 +1005,8 @@
android:name="flutterEmbedding"
android:value="2" />
<meta-data android:name="Mob-Https" android:value="yes"/>
<provider
android:name="com.netease.nimlib.ipc.NIMContentProvider"
android:authorities="${applicationId}.ipc.provider"

Binary file not shown.

View File

@@ -97,6 +97,7 @@ import com.yizhuan.xchat_android_core.channel_page.bean.HelloMessageInfo;
import com.yizhuan.xchat_android_core.gift.GiftModel;
import com.yizhuan.xchat_android_core.gift.bean.GiftInfo;
import com.yizhuan.xchat_android_core.gift.bean.LuckyBagNoticeInfo;
import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.FairyMsgAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.RoomBoxPrizeAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.RoomBoxPrizeInfo;
@@ -105,6 +106,8 @@ import com.yizhuan.xchat_android_core.im.custom.bean.RoomLuckySeaMsgBean;
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPKAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean;
import com.yizhuan.xchat_android_core.im.custom.bean.RoomReceivedLuckyGiftAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.TarotAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.TarotMsgBean;
import com.yizhuan.xchat_android_core.initial.InitialModel;
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
@@ -1243,6 +1246,20 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
}
}
break;
case CustomAttachment.CUSTOM_MESS_TAROT:
if (baseProtocol.getSecond() == CustomAttachment.CUSTOM_MESS_TAROT_SENIOR_PRIZE_WINNING) {
TarotMsgBean tarotMsgBean = JSON.parseObject(String.valueOf(baseProtocol.getData()), TarotMsgBean.class);
TarotAttachment tarotAttachment = new TarotAttachment(CustomAttachment.CUSTOM_MESS_TAROT,
CustomAttachment.CUSTOM_MESS_TAROT_SENIOR_PRIZE_WINNING);
tarotAttachment.setTarotMsgBean(tarotMsgBean);
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(
String.valueOf(AvRoomDataManager.get().getRoomId()), tarotAttachment);
IMNetEaseManager.get().getChatRoomEventObservable()
.onNext(new RoomEvent()
.setEvent(RoomEvent.TAROT_NOTIFY_SVGA)
.setChatRoomMessage(message));
}
break;
case CUSTOM_MSG_LUCKY_SEA://星级厨房
if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL) {
RoomLuckySeaAttachment attachment = new RoomLuckySeaAttachment(CUSTOM_MSG_LUCKY_SEA, CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL);

View File

@@ -1310,15 +1310,25 @@ public class MessageView extends FrameLayout {
private void setTarotMsg(ChatRoomMessage chatRoomMessage, TextView tvContent) {
TarotAttachment attachment = (TarotAttachment) chatRoomMessage.getAttachment();
if (attachment.getSecond() == CustomAttachment.CUSTOM_MESS_TAROT_SUCCESS) {
TarotMsgBean tarotMsgBean = attachment.getTarotMsgBean();
String nickName = RegexUtil.getPrintableString(tarotMsgBean.getNick());
SpannableBuilder text = new SpannableBuilder(tvContent)
.append(ResUtil.getString(R.string.avroom_widget_messageview_026), new ForegroundColorSpan(textColor))
.append(nickName, new ForegroundColorSpan(roomTipNickColor))
.append(" " + tarotMsgBean.getDrawMsgText(), new ForegroundColorSpan(textColor))
.append(tarotMsgBean.getDrawGoldNum() + ResUtil.getString(R.string.avroom_widget_messageview_027), new ForegroundColorSpan(roomTipColor));
tvContent.setText(text.build());
TarotMsgBean tarotMsgBean = attachment.getTarotMsgBean();
String nickName = RegexUtil.getPrintableString(tarotMsgBean.getNick());
SpannableBuilder text = new SpannableBuilder(tvContent);
switch (attachment.getSecond()) {
case CustomAttachment.CUSTOM_MESS_TAROT_SUCCESS:
text.append(ResUtil.getString(R.string.avroom_widget_messageview_026), new ForegroundColorSpan(textColor))
.append(nickName, new ForegroundColorSpan(roomTipNickColor))
.append(" " + tarotMsgBean.getDrawMsgText(), new ForegroundColorSpan(textColor))
.append(tarotMsgBean.getDrawGoldNum() + ResUtil.getString(R.string.avroom_widget_messageview_027), new ForegroundColorSpan(roomTipColor));
tvContent.setText(text.build());
break;
case CustomAttachment.CUSTOM_MESS_TAROT_JUNIOR_PRIZE_WINNING:
case CustomAttachment.CUSTOM_MESS_TAROT_INTERMEDIATE_PRIZE_WINNING:
text.append(ResUtil.getString(R.string.avroom_widget_messageview_026), new ForegroundColorSpan(textColor))
.append(nickName, new ForegroundColorSpan(roomTipNickColor))
.append(ResUtil.getString(R.string.avroom_widget_messageview_0160), new ForegroundColorSpan(textColor))
.append(tarotMsgBean.getDrawGoldNum() + ResUtil.getString(R.string.avroom_widget_messageview_027), new ForegroundColorSpan(roomTipColor));
tvContent.setText(text.build());
break;
}
}

View File

@@ -20,6 +20,7 @@ import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.core.text.HtmlCompat
import com.coorchice.library.SuperTextView
import com.netease.nim.uikit.common.util.sys.ScreenUtil
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage
@@ -31,6 +32,7 @@ import com.yizhuan.erban.avroom.activity.AVRoomActivity
import com.yizhuan.erban.avroom.bean.RoomPlayBean
import com.yizhuan.erban.avroom.helper.AnimHelper
import com.yizhuan.erban.common.svga.SimpleSvgaCallback
import com.yizhuan.erban.databinding.LayoutNotifyTarotIntermediateBinding
import com.yizhuan.erban.databinding.LayoutRoomEffectBinding
import com.yizhuan.erban.ui.utils.ImageLoadUtils
import com.yizhuan.erban.ui.utils.isDestroyed
@@ -41,6 +43,7 @@ import com.yizhuan.erban.ui.widget.SimpleAnimListener
import com.yizhuan.erban.ui.widget.drawgift.DrawGiftPlayHelper
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil
import com.yizhuan.erban.utils.MsgBuilder
import com.yizhuan.erban.utils.RegexUtil
import com.yizhuan.erban.utils.SpannableBuilder
import com.yizhuan.xchat_android_constants.XChatConstants
import com.yizhuan.xchat_android_core.auth.AuthModel
@@ -56,6 +59,7 @@ import com.yizhuan.xchat_android_core.user.bean.UserInfo
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
import com.yizhuan.xchat_android_library.utils.ListUtils
import com.yizhuan.xchat_android_library.utils.ResUtil
import com.yizhuan.xchat_android_library.utils.StringUtils
import io.reactivex.Observable
import io.reactivex.ObservableEmitter
import io.reactivex.ObservableOnSubscribe
@@ -164,18 +168,28 @@ class RoomEffectView @JvmOverloads constructor(
RoomEvent.BOX_NOTIFY -> {//寻爱
addPlayNotify(RoomEvent.BOX_NOTIFY, roomEvent.chatRoomMessage)
}
RoomEvent.BOX_NOTIFY_SVGA -> {//寻爱svga
addPlayNotify(RoomEvent.BOX_NOTIFY_SVGA, roomEvent.chatRoomMessage)
}
RoomEvent.TAROT_NOTIFY,
RoomEvent.TAROT_NOTIFY_SVGA -> {
addPlayNotify(roomEvent.event, roomEvent.chatRoomMessage)
}
RoomEvent.RECEIVE_ROOM_LUCKY_BAG_NOTICE, RoomEvent.RECEIVE_SERVICE_LUCKY_BAG_NOTICE ->//全服福袋
//廳內福袋
addPlayNotify(roomEvent.event, roomEvent.chatRoomMessage)
RoomEvent.LUCKY_SEA_GIFT_ROOM_NOTIFY -> {// 星级厨房房间飘屏通知
addPlayNotify(roomEvent.event, roomEvent.chatRoomMessage)
}
RoomEvent.LUCKY_SEA_GIFT_SERVER_NOTIFY -> {// 星级厨房全服飘屏通知
addPlayNotify(roomEvent.event, roomEvent.chatRoomMessage)
}
RoomEvent.FAIRY_DRAW_GIFT_L4,
RoomEvent.FAIRY_DRAW_GIFT_L5,
RoomEvent.FAIRY_CONVERT_L1,
@@ -183,17 +197,21 @@ class RoomEffectView @JvmOverloads constructor(
RoomEvent.FAIRY_CONVERT_L3 -> {
addPlayNotify(roomEvent.event, roomEvent.chatRoomMessage)
}
RoomEvent.DATING_ALL_NOTIFY -> addDatingAllNotify(roomEvent.chatRoomMessage)
RoomEvent.RADISH_NOTIFY,
RoomEvent.RADISH_NOTIFY_SVGA -> addRadishNotify(roomEvent.chatRoomMessage)
RoomEvent.ROOM_GIFT_COMPOUND -> addGiftCompoundNotify(roomEvent.chatRoomMessage)
RoomEvent.DATING_PUBLISH_RESULT -> showHandAnim((roomEvent.chatRoomMessage.attachment as DatingAttachment).datingNotifyInfo)
RoomEvent.RECEIVE_MEMBER_IN_NOTICE -> //進入房間
addMemberInNotify(roomEvent.chatRoomMessage)
RoomEvent.RECEIVE_EXPER_LEVEL_UP_NOTICE -> addLevelUpNotify(roomEvent.chatRoomMessage)
RoomEvent.ENTER_ROOM -> if (!SuperAdminUtil.isSuperAdmin()) {
playCarSvga(AuthModel.get().currentUid.toString(), null, true)
}
RoomEvent.CAR_MEMBER_IN -> if (roomEvent.mRoomCarMsgAttachment != null) {
playCarSvga(
null,
@@ -205,6 +223,7 @@ class RoomEffectView @JvmOverloads constructor(
false
)
}
RoomEvent.ROOM_PK_NOTIFY -> addRoomPKNotify(roomEvent.chatRoomMessage)
RoomEvent.SINGLE_ROOM_PK_NOTIFY -> addSingleRoomPKNotify(roomEvent.chatRoomMessage)
RoomEvent.SINGLE_ROOM_RANK_TOP_NOTIFY -> showSingleRoomRankNotify(roomEvent.chatRoomMessage)
@@ -213,9 +232,11 @@ class RoomEffectView @JvmOverloads constructor(
isHideCarEffect = true
loopCarAnim()
}
RoomEvent.ROOM_CAR_EFFECT_SHOW -> {
isHideCarEffect = false
}
RoomEvent.DRAW_GIFT_EFFECT -> {
val drawGiftAttachment =
(roomEvent.chatRoomMessage?.attachment as? DrawGiftAttachment)
@@ -226,6 +247,7 @@ class RoomEffectView @JvmOverloads constructor(
false
)
}
else -> {}
}
}
@@ -284,6 +306,7 @@ class RoomEffectView @JvmOverloads constructor(
)
}
}
RoomEvent.BOX_NOTIFY_SVGA -> {//寻爱
if ((mContext as AVRoomActivity).isTopActivity) {
isPlayAnim = true
@@ -308,6 +331,59 @@ class RoomEffectView @JvmOverloads constructor(
showBoxNotifyBySVGA(messagesPlay.removeAt(0))
}
}
RoomEvent.TAROT_NOTIFY -> {
if ((mContext as AVRoomActivity).isTopActivity) {
isPlayAnim = true
val isPlay = onPlayAnimCallback?.invoke() ?: false
if (isPlay) {
margin(
binding.clNotify,
0,
UIUtil.dip2px(context, 180.0),
0,
0
)
} else {
margin(
binding.clNotify,
0,
UIUtil.dip2px(context, 60.0),
0,
0
)
}
showTarotNotify(
messagesPlay.removeAt(0)
)
}
}
RoomEvent.TAROT_NOTIFY_SVGA -> {
if ((mContext as AVRoomActivity).isTopActivity) {
isPlayAnim = true
val isPlay = onPlayAnimCallback?.invoke() ?: false
if (isPlay) {
margin(
binding.clNotify,
0,
UIUtil.dip2px(context, 180.0),
0,
0
)
} else {
margin(
binding.clNotify,
0,
UIUtil.dip2px(context, 60.0),
0,
0
)
}
showTarotNotifyBySVGA(messagesPlay.removeAt(0))
}
}
RoomEvent.RECEIVE_ROOM_LUCKY_BAG_NOTICE, RoomEvent.RECEIVE_SERVICE_LUCKY_BAG_NOTICE -> {//福袋
isPlayAnim = true
val isPlay = onPlayAnimCallback?.invoke() ?: false
@@ -320,6 +396,7 @@ class RoomEffectView @JvmOverloads constructor(
messagesPlay.removeAt(0)
)
}
RoomEvent.LUCKY_SEA_GIFT_ROOM_NOTIFY -> {//星级厨房
isPlayAnim = true
val isPlay = onPlayAnimCallback?.invoke() ?: false
@@ -332,6 +409,7 @@ class RoomEffectView @JvmOverloads constructor(
messagesPlay.removeAt(0)
)
}
RoomEvent.LUCKY_SEA_GIFT_SERVER_NOTIFY -> {//星级厨房
isPlayAnim = true
val isPlay = onPlayAnimCallback?.invoke() ?: false
@@ -344,6 +422,7 @@ class RoomEffectView @JvmOverloads constructor(
messagesPlay.removeAt(0)
)
}
RoomEvent.FAIRY_DRAW_GIFT_L4,
RoomEvent.FAIRY_DRAW_GIFT_L5,
RoomEvent.FAIRY_CONVERT_L1,
@@ -389,6 +468,7 @@ class RoomEffectView @JvmOverloads constructor(
SHOW_TIME.toLong()
)
}
RoomEvent.FAIRY_DRAW_GIFT_L5,
RoomEvent.FAIRY_CONVERT_L3 -> {
showFairyNotifyBySVGA(roomPlayBean)
@@ -759,6 +839,33 @@ class RoomEffectView @JvmOverloads constructor(
)
}
private fun showTarotNotify(roomPlayBean: RoomPlayBean) {
val chatRoomMessage = roomPlayBean.chatRoomMessage
val attachment = chatRoomMessage.attachment as TarotAttachment
val textView =
LayoutInflater.from(mContext).inflate(R.layout.layout_notify_tarot_intermediate, null) as TextView
val string = mContext.getString(
R.string.avroom_widget_roomeffectview_026,
StringUtils.abbreviate(RegexUtil.getPrintableString(attachment.tarotMsgBean.nick), 8),
attachment.tarotMsgBean.drawGoldNum
)
textView.text = HtmlCompat.fromHtml(string, HtmlCompat.FROM_HTML_MODE_COMPACT)
animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
binding.flPlayNotify.addView(textView)
textView.startAnimation(animationPlay)
binding.flPlayNotify.postDelayed(
{
animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify_close)
textView.startAnimation(animationPlay)
},
SHOW_TIME.toLong()
)
binding.flPlayNotify.postDelayed({
binding.flPlayNotify.removeView(textView)
isPlayAnim = false
}, CLOSE_TIME.toLong())
}
private fun showBoxNotify(roomPlayBean: RoomPlayBean) {
val chatRoomMessage = roomPlayBean.chatRoomMessage
val attachment = chatRoomMessage.attachment as RoomBoxPrizeAttachment
@@ -802,6 +909,58 @@ class RoomEffectView @JvmOverloads constructor(
}, CLOSE_TIME.toLong())
}
private fun showTarotNotifyBySVGA(roomPlayBean: RoomPlayBean) {
val chatRoomMessage = roomPlayBean.chatRoomMessage
val attachment = chatRoomMessage.attachment as TarotAttachment
val string = mContext.getString(
R.string.avroom_widget_roomeffectview_026,
StringUtils.abbreviate(RegexUtil.getPrintableString(attachment.tarotMsgBean.nick), 8),
attachment.tarotMsgBean.drawGoldNum
)
val text = HtmlCompat.fromHtml(string, HtmlCompat.FROM_HTML_MODE_COMPACT)
val svgaImageView = SVGAImageView(mContext)
svgaImageView.loops = 1
svgaImageView.clearsAfterStop = true
val params = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
svgaImageView.layoutParams = params
svgaImageView.callback = object : SimpleSvgaCallback() {
override fun onFinished() {
binding.flPlayNotify.post {
binding.flPlayNotify.removeView(svgaImageView)
isPlayAnim = false
}
}
}
binding.flPlayNotify.addView(svgaImageView)
shareParser().decodeFromAssets("svga/svga_tarot_senior.svga", object : SVGAParser.ParseCompletion {
override fun onComplete(videoItem: SVGAVideoEntity) {
val dynamicEntity = SVGADynamicEntity()
val textPaint = TextPaint()
textPaint.color = Color.WHITE //字體顏色
textPaint.textSize = 22f
dynamicEntity.setDynamicText(
StaticLayout(
text,
0,
text.length,
textPaint,
0,
Layout.Alignment.ALIGN_CENTER,
1.0f,
0.0f,
false
), "taxt"
)
val drawable = SVGADrawable(videoItem, dynamicEntity)
svgaImageView.setImageDrawable(drawable)
svgaImageView.stepToFrame(0, true)
}
override fun onError() {}
}, null)
}
private fun showBoxNotifyBySVGA(roomPlayBean: RoomPlayBean) {
val chatRoomMessage = roomPlayBean.chatRoomMessage
val attachment = chatRoomMessage.attachment as RoomBoxPrizeAttachment

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<com.coorchice.library.SuperTextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tv_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:background="@drawable/bg_tarot_intermediate_notice"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingStart="@dimen/dp_50"
android:paddingEnd="0dp"
android:textColor="@color/white"
android:textSize="11sp"
tools:layout_height="wrap_content"
tools:text="@string/avroom_widget_roomeffectview_026" />

View File

@@ -1776,6 +1776,7 @@
<string name="avroom_widget_messageview_0157">歡迎TA</string>
<string name="avroom_widget_messageview_0158"> 駕著 </string>
<string name="avroom_widget_messageview_0159">進入了房間</string>
<string name="avroom_widget_messageview_0160">在幸運塔羅中運氣爆發,獲得</string>
<string name="avroom_widget_pkboardview_01">未開始</string>
<string name="avroom_widget_pkboardview_02">您已經在排麥了~</string>
<string name="avroom_widget_pkboardview_03">您已經在排麥了~</string>
@@ -1807,6 +1808,7 @@
<string name="avroom_widget_roomeffectview_023">的邀請,進入了房間</string>
<string name="avroom_widget_roomeffectview_024">svga解析失敗</string>
<string name="avroom_widget_roomeffectview_025">恭喜</string>
<string name="avroom_widget_roomeffectview_026">恭喜&lt;font color=&quot;#FFEE8F&quot;&gt;%s&lt;/font&gt;在幸運塔羅中運氣爆發,獲得&lt;font color=&quot;#FFEE8F&quot;&gt;%d&lt;/font&gt;钻石!</string>
<string name="avroom_widget_roomranknavigatoradapter_01">貢獻榜</string>
<string name="avroom_widget_roomranknavigatoradapter_02">魅力榜</string>
<string name="erban_base_baseactivity_01">請稍後...</string>

View File

@@ -36,7 +36,6 @@ allprojects {
google()
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://jitpack.io' }
maven { url "https://mvn.mob.com/android" }
maven { url 'https://repo1.maven.org/maven2/' }
}
//网络慢的话就去 https://maven.aliyun.com/mvn/view 里面找个代理的仓库。

View File

@@ -1321,13 +1321,13 @@ public final class IMNetEaseManager {
if (second == CUSTOM_MSG_LUCKY_SEA_GIFT_ROOM_NOTIFY) {
addMessages(msg);
noticeRoomEvent(msg, RoomEvent.LUCKY_SEA_GIFT_ROOM_NOTIFY);
}else if(second == CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_NOTIFY){
} else if (second == CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_NOTIFY) {
addMessages(msg);
noticeRoomEvent(msg, RoomEvent.LUCKY_SEA_GIFT_SERVER_NOTIFY);
}
break;
case ROOM_FREE_GIFT:
if(second == ROOM_FREE_GIFT_CHANGE){
if (second == ROOM_FREE_GIFT_CHANGE) {
RoomFreeGiftAttachment freeGiftAttachment = (RoomFreeGiftAttachment) attachment;
RoomFreeGiftMsgBean bean = freeGiftAttachment.getRoomFreeGiftMsgInfo();
EventBus.getDefault().post(new UpdateKnapFreeGiftDataEvent(bean));
@@ -1355,6 +1355,11 @@ public final class IMNetEaseManager {
break;
}
break;
case CUSTOM_MESS_TAROT:
if (second == CUSTOM_MESS_TAROT_INTERMEDIATE_PRIZE_WINNING
|| second == CUSTOM_MESS_TAROT_SENIOR_PRIZE_WINNING) {
noticeTarot(msg, second);
}
default:
break;
}
@@ -3325,6 +3330,14 @@ public final class IMNetEaseManager {
.setChatRoomMessage(msg));
}
private void noticeTarot(ChatRoomMessage msg, int second) {
getChatRoomEventObservable()
.onNext(new RoomEvent()
.setEvent(second == CUSTOM_MESS_TAROT_INTERMEDIATE_PRIZE_WINNING
? RoomEvent.TAROT_NOTIFY : RoomEvent.TAROT_NOTIFY_SVGA)
.setChatRoomMessage(msg));
}
private void noticeRadish(ChatRoomMessage msg, int second) {
int event = second == CUSTOM_MSG_SUB_RADISH_ALL_ROOM_NOTIFY ? RoomEvent.RADISH_NOTIFY : RoomEvent.RADISH_NOTIFY_SVGA;
getChatRoomEventObservable()

View File

@@ -573,7 +573,7 @@ public class CustomAttachParser implements MsgAttachmentParser {
}
break;
case CustomAttachment.CUSTOM_MESS_TAROT:
attachment = new TarotAttachment(CustomAttachment.CUSTOM_MESS_TAROT, CustomAttachment.CUSTOM_MESS_TAROT_SUCCESS);
attachment = new TarotAttachment(CustomAttachment.CUSTOM_MESS_TAROT, second);
break;
case CustomAttachment.CUSTOM_MSG_CHAT_HINT:
attachment = new ChatHintAttachment(CustomAttachment.CUSTOM_MSG_SUB_CHAT_HINT);

View File

@@ -328,8 +328,13 @@ public class CustomAttachment implements MsgAttachment {
//推送消息
public static final int CUSTOM_MSG_PUSH_NOTIFIFICATION = 70;
public static final int CUSTOM_MSG_SUB_PUSH_NOTIFICATION_IN_ROOM = 701;// 推送进入房间
public static final int CUSTOM_MESS_TAROT = 71; //塔罗牌充值消息
public static final int CUSTOM_MESS_TAROT_SUCCESS = 711; //塔罗牌充值中奖消息
public static final int CUSTOM_MESS_TAROT_JUNIOR_PRIZE_WINNING = 712; //塔罗牌初级卡中奖消息
public static final int CUSTOM_MESS_TAROT_INTERMEDIATE_PRIZE_WINNING = 713; //塔罗牌中级卡中奖消息
public static final int CUSTOM_MESS_TAROT_SENIOR_PRIZE_WINNING = 714; //塔罗牌高级卡中奖消息
//相亲模式
public static final int CUSTOM_MSG_DATING = 72;
public static final int CUSTOM_MSG_SUB_DATING_SELECT = 721;

View File

@@ -258,6 +258,10 @@ public class RoomEvent {
public static final int FAIRY_CONVERT_L2 = 105;
public static final int FAIRY_CONVERT_L3 = 106;
public static final int TAROT_NOTIFY = 107;
public static final int TAROT_NOTIFY_SVGA = 108;
private int event = NONE;
private int micPosition = Integer.MIN_VALUE;
private int posState = -1;

View File

@@ -299,20 +299,17 @@ public class MonsterHuntingModel extends BaseModel implements IMonsterHuntingMod
* 注册云信全服广播接收器
*/
private void registerMonsterBroadcastMessage() {
NIMSDK.getMsgServiceObserve().observeBroadcastMessage(new Observer<BroadcastMessage>() {
@Override
public void onEvent(BroadcastMessage broadcastMessage) {
if (broadcastMessage != null) {
String contentStr = broadcastMessage.getContent();
Logger.i(ResUtil.getString(R.string.monsterhunting_model_monsterhuntingmodel_03) + contentStr);
if (TextUtils.isEmpty(contentStr)) return;
JSONObject jsonObject = JSON.parseObject(contentStr);
if (jsonObject == null) return;
if (jsonObject.containsKey("body")) {
String body = jsonObject.getString("body");
if (TextUtils.isEmpty(body)) return;
onReceivedNimBroadcastMessage(body);
}
NIMSDK.getMsgServiceObserve().observeBroadcastMessage((Observer<BroadcastMessage>) broadcastMessage -> {
if (broadcastMessage != null) {
String contentStr = broadcastMessage.getContent();
Logger.i(ResUtil.getString(R.string.monsterhunting_model_monsterhuntingmodel_03) + contentStr);
if (TextUtils.isEmpty(contentStr)) return;
JSONObject jsonObject = JSON.parseObject(contentStr);
if (jsonObject == null) return;
if (jsonObject.containsKey("body")) {
String body = jsonObject.getString("body");
if (TextUtils.isEmpty(body)) return;
onReceivedNimBroadcastMessage(body);
}
}
}, true);
@@ -357,18 +354,15 @@ public class MonsterHuntingModel extends BaseModel implements IMonsterHuntingMod
// 保留 10 秒
Single.just(data).delay(10, TimeUnit.SECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<MonsterProtocol.DataBean>() {
@Override
public void accept(MonsterProtocol.DataBean data) throws Exception {
//移除怪兽
int size = monsterList.size();
for (int i = 0; i < size; i++) {
MonsterProtocol.DataBean monsterInfos = monsterList.get(i);
if (monsterInfos.getMonsterId() == data.getMonsterId()){
monsterList.remove(i);
RxBusHelper.post(new MonsterUpdateEvent(monsterList));
break;
}
.subscribe(data1 -> {
//移除怪兽
int size = monsterList.size();
for (int i = 0; i < size; i++) {
MonsterProtocol.DataBean monsterInfos = monsterList.get(i);
if (monsterInfos.getMonsterId() == data1.getMonsterId()){
monsterList.remove(i);
RxBusHelper.post(new MonsterUpdateEvent(monsterList));
break;
}
}
});
@@ -413,6 +407,9 @@ public class MonsterHuntingModel extends BaseModel implements IMonsterHuntingMod
break;
}
}
break;
case CustomAttachment.CUSTOM_MESS_TAROT:
break;
default:
break;

View File

@@ -9,6 +9,7 @@ MobSDK {
appLinkHost "cebg.t4m.cn"
}
ShareSDK {
version '3.10.9'
//平台配置信息
gui false
devInfo {