Compare commits
5 Commits
peko_relea
...
peko_relea
Author | SHA1 | Date | |
---|---|---|---|
![]() |
098bf777d7 | ||
![]() |
6f1165dc37 | ||
![]() |
5c4c4cc284 | ||
![]() |
6b7adc5950 | ||
![]() |
87b81b7761 |
BIN
app/src/main/assets/svga/zoo_notify.svga
Normal file
BIN
app/src/main/assets/svga/zoo_notify.svga
Normal file
Binary file not shown.
@@ -3,6 +3,8 @@ package com.yizhuan.erban.avroom.activity;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_ALL_SERVICE_GIFT;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_BOX;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_CRAZY_ZOO;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_FAIRY;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_GIFT;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT;
|
||||
@@ -1285,6 +1287,14 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
IMNetEaseManager.get().noticeRoomEvent(message, RoomEvent.LUCKY_SEA_GIFT_SERVER_NOTIFY);
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_CRAZY_ZOO://疯狂动物园
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM) {
|
||||
RoomLuckySeaAttachment attachment = new RoomLuckySeaAttachment(CUSTOM_MSG_CRAZY_ZOO, CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM);
|
||||
attachment.setRoomLuckySeaMsgBean(JSON.parseObject(String.valueOf(baseProtocol.getData()), RoomLuckySeaMsgBean.class));
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
|
||||
IMNetEaseManager.get().noticeRoomEvent(message, RoomEvent.CRAZY_ZOO_ALL_ROOM_NOTIFY);
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_LUCKY_GIFT://福袋
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY || baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_ALL) {
|
||||
RoomReceivedLuckyGiftAttachment attachment = new RoomReceivedLuckyGiftAttachment(CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY);
|
||||
|
@@ -506,10 +506,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
} else {
|
||||
val roomQueueInfo = AvRoomDataManager.get()
|
||||
.getRoomQueueMemberInfoByAccount(myUid.toString())
|
||||
if (roomQueueInfo?.mChatRoomMember?.isNoProhibitMic == true && roomQueueInfo.mRoomMicInfo?.isMicMute == false) {
|
||||
bottomView.setMicBtnEnable(true)
|
||||
bottomView.setMicBtnOpen(true)
|
||||
} else if (roomQueueInfo?.mChatRoomMember != null
|
||||
if (roomQueueInfo?.mChatRoomMember != null
|
||||
&& myUid.toString() == roomQueueInfo.mChatRoomMember.account
|
||||
&& roomQueueInfo.mRoomMicInfo?.isMicMute == true
|
||||
) {
|
||||
|
@@ -210,6 +210,14 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
addPlayNotify(roomEvent.event, roomEvent.chatRoomMessage)
|
||||
}
|
||||
|
||||
RoomEvent.CRAZY_ZOO_ROOM_NOTIFY -> {// 疯狂动物园-房间
|
||||
addPlayNotify(roomEvent.event, roomEvent.chatRoomMessage)
|
||||
}
|
||||
|
||||
RoomEvent.CRAZY_ZOO_ALL_ROOM_NOTIFY -> {// 疯狂动物园-全服
|
||||
addPlayNotify(roomEvent.event, roomEvent.chatRoomMessage)
|
||||
}
|
||||
|
||||
RoomEvent.FAIRY_DRAW_GIFT_L4,
|
||||
RoomEvent.FAIRY_DRAW_GIFT_L5,
|
||||
RoomEvent.FAIRY_CONVERT_L1,
|
||||
@@ -388,6 +396,22 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
)
|
||||
}
|
||||
|
||||
RoomEvent.CRAZY_ZOO_ROOM_NOTIFY -> {//疯狂动物园-房间(静态)
|
||||
playNotifyStateLiveData?.value = true
|
||||
resetPlayNotifyMargin()
|
||||
showZooNotify(
|
||||
messagesPlay.removeAt(0)
|
||||
)
|
||||
}
|
||||
|
||||
RoomEvent.CRAZY_ZOO_ALL_ROOM_NOTIFY -> {//疯狂动物园-全服(动态)
|
||||
playNotifyStateLiveData?.value = true
|
||||
resetPlayNotifyMargin()
|
||||
showZooNotifyBySVGA(
|
||||
messagesPlay.removeAt(0)
|
||||
)
|
||||
}
|
||||
|
||||
RoomEvent.FAIRY_DRAW_GIFT_L4,
|
||||
RoomEvent.FAIRY_DRAW_GIFT_L5,
|
||||
RoomEvent.FAIRY_CONVERT_L1,
|
||||
@@ -707,6 +731,56 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
)
|
||||
}
|
||||
|
||||
private fun showZooNotify(roomPlayBean: RoomPlayBean) {
|
||||
val chatRoomMessage = roomPlayBean.chatRoomMessage
|
||||
val attachment = chatRoomMessage.attachment as RoomLuckySeaAttachment
|
||||
val bean = attachment.roomLuckySeaMsgInfo
|
||||
val textView =
|
||||
LayoutInflater.from(mContext)
|
||||
.inflate(R.layout.layout_room_zoo_notify, null) as TextView
|
||||
val text = SpannableBuilder()
|
||||
.append(
|
||||
ResUtil.getString(R.string.congratulation),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
bean.nick,
|
||||
ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_FEF23E))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.in_the_zoo),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
bean.itemMultiple.toString(),
|
||||
ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_00EAFF))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.times_reward_get),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
bean.diamonds.toString(),
|
||||
ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_00EAFF))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.diamond_point),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
textView.text = text.build()
|
||||
animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
|
||||
binding.flPlayNotify.addView(textView)
|
||||
textView.startAnimation(animationPlay)
|
||||
binding.flPlayNotify.postDelayed(
|
||||
{
|
||||
playNotifyStateLiveData?.value = false
|
||||
binding.flPlayNotify.removeView(textView)
|
||||
},
|
||||
SHOW_TIME.toLong()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
private fun showLuckySeaNotifyBySVGA(roomPlayBean: RoomPlayBean) {
|
||||
val chatRoomMessage = roomPlayBean.chatRoomMessage
|
||||
val attachment = chatRoomMessage.attachment as RoomLuckySeaAttachment
|
||||
@@ -791,6 +865,90 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
)
|
||||
}
|
||||
|
||||
private fun showZooNotifyBySVGA(roomPlayBean: RoomPlayBean) {
|
||||
val chatRoomMessage = roomPlayBean.chatRoomMessage
|
||||
val attachment = chatRoomMessage.attachment as RoomLuckySeaAttachment
|
||||
val bean = attachment.roomLuckySeaMsgInfo
|
||||
val text = SpannableBuilder()
|
||||
.append(
|
||||
ResUtil.getString(R.string.congratulation),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
bean.nick + " ",
|
||||
ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_FEF23E))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.in_the_zoo),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
bean.itemMultiple.toString(),
|
||||
ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_00EAFF))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.times_reward_get),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
bean.diamonds.toString(),
|
||||
ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_00EAFF))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.diamond_point),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
val svgaImageView = SVGAImageView(mContext)
|
||||
svgaImageView.loops = 1
|
||||
svgaImageView.clearsAfterDetached = true
|
||||
val params = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
|
||||
svgaImageView.layoutParams = params
|
||||
svgaImageView.callback = object : SimpleSvgaCallback() {
|
||||
override fun onFinished() {
|
||||
binding.flPlayNotify.post {
|
||||
playNotifyStateLiveData?.value = false
|
||||
binding.flPlayNotify.removeView(svgaImageView)
|
||||
}
|
||||
}
|
||||
}
|
||||
binding.flPlayNotify.addView(svgaImageView)
|
||||
shareParser().decodeFromAssets(
|
||||
"svga/zoo_notify.svga",
|
||||
object : SVGAParser.ParseCompletion {
|
||||
override fun onComplete(videoItem: SVGAVideoEntity) {
|
||||
val dynamicEntity = SVGADynamicEntity()
|
||||
val textPaint = TextPaint()
|
||||
textPaint.color = Color.WHITE //字體顏色
|
||||
textPaint.textSize = 24f //字體大小
|
||||
dynamicEntity.setDynamicText(
|
||||
StaticLayout(
|
||||
text.build(),
|
||||
0,
|
||||
text.build().length,
|
||||
textPaint,
|
||||
0,
|
||||
Layout.Alignment.ALIGN_CENTER,
|
||||
1.0f,
|
||||
0.0f,
|
||||
false
|
||||
), "noble_text_tx"
|
||||
)
|
||||
svgaImageView.setOnClickListener {
|
||||
if (!TextUtils.isEmpty(bean.skipUrl)) {
|
||||
CommonWebViewActivity.start(mContext, bean.skipUrl)
|
||||
}
|
||||
}
|
||||
val drawable = SVGADrawable(videoItem, dynamicEntity)
|
||||
svgaImageView.setImageDrawable(drawable)
|
||||
svgaImageView.stepToFrame(0, true)
|
||||
}
|
||||
|
||||
override fun onError() {}
|
||||
},
|
||||
null
|
||||
)
|
||||
}
|
||||
|
||||
private fun showNotifyH5(data: NotifyH5Info) {
|
||||
val textView = LayoutInflater.from(mContext)
|
||||
.inflate(R.layout.layout_notify_h5, null) as TextView
|
||||
|
@@ -6,6 +6,8 @@ import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUS
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_RENEWNOBLE;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_ALL_SERVICE_GIFT;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_BOX;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_CRAZY_ZOO;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_FAIRY;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_GIFT;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT;
|
||||
@@ -1099,7 +1101,7 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
if (roomLuckySeaMsgBean == null) return;
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL) {
|
||||
PlayEffectInfo playEffectInfo = new PlayEffectInfo();
|
||||
playEffectInfo.setSecond(CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL);
|
||||
playEffectInfo.setSecond(baseProtocol.getSecond());
|
||||
playEffectInfo.setRoomLuckySeaMsgBean(roomLuckySeaMsgBean);
|
||||
playEffectList.add(playEffectInfo);
|
||||
if (playEffectDialog != null && playEffectDialog.isShowing()) {
|
||||
@@ -1115,6 +1117,35 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_CRAZY_ZOO://疯狂动物园
|
||||
if (!isValid() || getWindow().getDecorView().getVisibility() != View.VISIBLE) return;
|
||||
if (this instanceof AddUserInfoActivity || this instanceof AVRoomActivity
|
||||
|| this instanceof TreasureBoxActivity || this instanceof HomeFairyActivity
|
||||
|| UserUtils.getUserInfo() == null)
|
||||
return;
|
||||
if (playEffectList == null) {
|
||||
playEffectList = new LinkedList<>();
|
||||
}
|
||||
RoomLuckySeaMsgBean roomLuckySeaMsgBean2 = JSON.parseObject(String.valueOf(baseProtocol.getData()), RoomLuckySeaMsgBean.class);
|
||||
if (roomLuckySeaMsgBean2 == null) return;
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM) {
|
||||
PlayEffectInfo playEffectInfo = new PlayEffectInfo();
|
||||
playEffectInfo.setSecond(baseProtocol.getSecond());
|
||||
playEffectInfo.setRoomLuckySeaMsgBean(roomLuckySeaMsgBean2);
|
||||
playEffectList.add(playEffectInfo);
|
||||
if (playEffectDialog != null && playEffectDialog.isShowing()) {
|
||||
// 如果当前以及有礼物弹窗在展示,则需要等到他 dismiss 后再显示下一个
|
||||
PlayEffectInfo dataBean = playEffectList.peekFirst();
|
||||
if (dataBean != null) {
|
||||
return;
|
||||
} else {
|
||||
playEffectDialog.dismiss();
|
||||
}
|
||||
} else {
|
||||
showPlayEffectDialog();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_LUCKY_GIFT://福袋
|
||||
if (!isValid() || getWindow().getDecorView().getVisibility() != View.VISIBLE) return;
|
||||
if (this instanceof AddUserInfoActivity || this instanceof AVRoomActivity
|
||||
|
@@ -533,6 +533,25 @@ class HomeFairyActivity : BaseViewBindingActivity<TreasureFairyDialogHomeBinding
|
||||
.noticeRoomEvent(message, RoomEvent.LUCKY_SEA_GIFT_SERVER_NOTIFY)
|
||||
}
|
||||
|
||||
CustomAttachment.CUSTOM_MSG_CRAZY_ZOO -> if (baseProtocol.second == CustomAttachment.CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM) {
|
||||
val attachment = RoomLuckySeaAttachment(
|
||||
CustomAttachment.CUSTOM_MSG_CRAZY_ZOO,
|
||||
CustomAttachment.CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM
|
||||
)
|
||||
attachment.setRoomLuckySeaMsgBean(
|
||||
JSON.parseObject(
|
||||
baseProtocol.data.toString(),
|
||||
RoomLuckySeaMsgBean::class.java
|
||||
)
|
||||
)
|
||||
val message = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
AvRoomDataManager.get().roomId.toString(),
|
||||
attachment
|
||||
)
|
||||
IMNetEaseManager.get()
|
||||
.noticeRoomEvent(message, RoomEvent.CRAZY_ZOO_ALL_ROOM_NOTIFY)
|
||||
}
|
||||
|
||||
CustomAttachment.CUSTOM_MSG_LUCKY_GIFT -> if (baseProtocol.second == CustomAttachment.CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY || baseProtocol.second == CustomAttachment.CUSTOM_MSG_LUCKY_GIFT_SERVER_ALL) {
|
||||
val attachment =
|
||||
RoomReceivedLuckyGiftAttachment(CustomAttachment.CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY)
|
||||
|
@@ -217,9 +217,8 @@ class SettingActivity : BaseViewBindingActivity<ActivitySettingBinding>(), View.
|
||||
}
|
||||
|
||||
private fun debug() {
|
||||
// val json = "{\"data\":{\"diamonds\":225000,\"itemId\":32,\"itemMultiple\":45,\"nick\":\"XG001\",\"roomUid\":2881,\"uid\":2881},\"first\":95,\"second\":955}"
|
||||
// RedPackageOpenDialog2().show(this)
|
||||
// val json = "{\"first\":3,\"second\":32,\"data\":{\"recvUserUid\":2735,\"recvUserAvatar\":\"https://img.pekolive.com/default_avatar.png\",\"recvUserNick\":\"66丢丢丢丢丢多多多的hhhh\",\"sendUserNick\":\"11的ass\",\"sendUserAvatar\":\"http://beta.img.pekolive.com/Fk7aur-1RBqKXC-qqBwMTjivZ3lV?imageslim\",\"sendUserUid\":2737,\"giftUrl\":\"http://beta.img.pekolive.com/Fn6h_gPFD5MwA-Ql_kcWqNpKp0JM?imageslim\",\"giftName\":\"幽靈糖果\",\"giftId\":2075,\"giftNum\":${Random.nextInt(1,1000)},\"giftGolds\":33440,\"notifyStaySecond\":5,\"isHomeShow\":true,\"isSkipRoom\":true,\"isFullScreen\":false,\"isSendMsg\":false,\"roomUid\":2737,\"roomErbanNo\":11,\"roomTitle\":\"11的工会\",\"levelNum\":${Random.nextInt(1,4)}}}"
|
||||
// onReceivedNimBroadcastMessage(json)
|
||||
// val json = "{\"first\":85,\"second\":855,\"data\":{\"nick\":\"66丢丢丢丢丢多多多的hhhh\",\"preVipName\":\"子爵\",\"floatPic\":\"https://image.hfighting.com/Fq3JtbK2acO3FN-3vWZo8ldtHfse\",\"uid\":2735,\"currVipName\":\"侯爵\",\"erbanNo\":66,\"roomUid\":2734,\"avatar\":\"https://img.pekolive.com/default_avatar.png\",\"currVipLevel\":5}}"
|
||||
// onReceivedNimBroadcastMessage(json)
|
||||
// CommonWebViewActivity.start(this,"https://api.anan.chat/anan_vestBag/modules/rank/index.html#/rank")
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.yizhuan.erban.ui.widget.dialog;
|
||||
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT_SERVER_ALL;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY_BY_SVGA;
|
||||
@@ -106,6 +107,9 @@ public class AllPlayEffectDialog extends BaseDialog {
|
||||
case CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL:
|
||||
showLuckySeaNotifyBySVGA(playEffectInfo.getRoomLuckySeaMsgBean());
|
||||
break;
|
||||
case CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM:
|
||||
showZooNotifyBySVGA(playEffectInfo.getRoomLuckySeaMsgBean());
|
||||
break;
|
||||
case CUSTOM_MSG_LUCKY_GIFT_SERVER_ALL:
|
||||
showLuckyBagNotify(playEffectInfo.getLuckyBagNoticeInfo());
|
||||
break;
|
||||
@@ -279,6 +283,91 @@ public class AllPlayEffectDialog extends BaseDialog {
|
||||
}
|
||||
}
|
||||
|
||||
private void showZooNotifyBySVGA(RoomLuckySeaMsgBean roomLuckySeaMsgBean) {
|
||||
SpannableBuilder text = new SpannableBuilder()
|
||||
.append(
|
||||
ResUtil.getString(R.string.congratulation),
|
||||
new ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
roomLuckySeaMsgBean.getNick() + " ",
|
||||
new ForegroundColorSpan(ContextCompat.getColor(getContext(), R.color.color_FEF23E))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.in_the_zoo),
|
||||
new ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
String.valueOf(roomLuckySeaMsgBean.getItemMultiple()),
|
||||
new ForegroundColorSpan(ContextCompat.getColor(getContext(), R.color.color_00EAFF))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.times_reward_get),
|
||||
new ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
String.valueOf(roomLuckySeaMsgBean.getDiamonds()),
|
||||
new ForegroundColorSpan(ContextCompat.getColor(getContext(), R.color.color_00EAFF))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.diamond_point),
|
||||
new ForegroundColorSpan(Color.WHITE)
|
||||
);
|
||||
SVGAImageView svgaImageView = new SVGAImageView(getContext());
|
||||
svgaImageView.setLoops(1);
|
||||
svgaImageView.setClearsAfterDetached(true);
|
||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
|
||||
svgaImageView.setLayoutParams(params);
|
||||
svgaImageView.setCallback(new SimpleSvgaCallback() {
|
||||
@Override
|
||||
public void onFinished() {
|
||||
closeSelf();
|
||||
}
|
||||
});
|
||||
binding.flSvgaNotify.addView(svgaImageView);
|
||||
try {
|
||||
SVGAParser.Companion.shareParser().decodeFromAssets("svga/zoo_notify.svga", new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(@NonNull SVGAVideoEntity svgaVideoEntity) {
|
||||
SVGADynamicEntity dynamicEntity = new SVGADynamicEntity();
|
||||
TextPaint textPaint = new TextPaint();
|
||||
textPaint.setColor(Color.WHITE);//字体颜色
|
||||
textPaint.setTextSize(24);//字体大小
|
||||
dynamicEntity.setDynamicText(new StaticLayout(
|
||||
text.build(),
|
||||
0,
|
||||
text.build().length(),
|
||||
textPaint,
|
||||
0,
|
||||
Layout.Alignment.ALIGN_CENTER,
|
||||
1.0f,
|
||||
0.0f,
|
||||
false
|
||||
), "noble_text_tx");
|
||||
svgaImageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (!TextUtils.isEmpty(roomLuckySeaMsgBean.getSkipUrl())) {
|
||||
CommonWebViewActivity.start(getContext(), roomLuckySeaMsgBean.getSkipUrl());
|
||||
}
|
||||
}
|
||||
});
|
||||
SVGADrawable drawable = new SVGADrawable(svgaVideoEntity, dynamicEntity);
|
||||
svgaImageView.setImageDrawable(drawable);
|
||||
svgaImageView.stepToFrame(0, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
closeSelf();
|
||||
}
|
||||
}, null);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
closeSelf();
|
||||
}
|
||||
}
|
||||
|
||||
private void showLuckyBagNotify(LuckyBagNoticeInfo noticeInfo) {
|
||||
View roomView = LayoutInflater.from(getContext())
|
||||
.inflate(R.layout.layout_room_lucky_bag_notify, null);
|
||||
|
BIN
app/src/main/res/drawable-xhdpi/bg_zoo_notice.webp
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_zoo_notice.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
19
app/src/main/res/layout/layout_room_zoo_notify.xml
Normal file
19
app/src/main/res/layout/layout_room_zoo_notify.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@drawable/bg_zoo_notice"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:lineSpacingExtra="0dp"
|
||||
android:lineSpacingMultiplier="0.8"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="80dp"
|
||||
android:paddingTop="@dimen/dp_6"
|
||||
android:paddingEnd="80dp"
|
||||
android:textSize="12sp"
|
||||
tools:layout_height="wrap_content"
|
||||
tools:text="@string/layout_layout_room_box_notify_01" />
|
@@ -713,5 +713,6 @@
|
||||
<color name="color_ffffff_30">#4CFFFFFF</color>
|
||||
<color name="color_FFE468">#FFFFE468</color>
|
||||
<color name="color_C9CBD1">#C9CBD1</color>
|
||||
<color name="color_FEF23E">#FEF23E</color>
|
||||
|
||||
</resources>
|
||||
|
@@ -4985,6 +4985,7 @@
|
||||
<string name="room">房間</string>
|
||||
<string name="congratulation">恭喜</string>
|
||||
<string name="in_the_star_kitchen_draw">在星級厨房抽中</string>
|
||||
<string name="in_the_zoo">在瘋狂動物園中</string>
|
||||
<string name="guardian_planet_msg_1">在守護星球中成功擊敗怪獸,獲得</string>
|
||||
<string name="guardian_planet_msg_2">鉆石獎勵!</string>
|
||||
<string name="times_reward_get">倍獎勵,獲得</string>
|
||||
|
@@ -1,6 +1,8 @@
|
||||
package com.yizhuan.erban.treasure_box.activity;
|
||||
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_BOX;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_CRAZY_ZOO;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_FAIRY;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LUCKY_GIFT_SERVER_ALL;
|
||||
@@ -496,6 +498,14 @@ public class TreasureBoxActivity extends BaseBindingActivity<ActivityTreasureBox
|
||||
IMNetEaseManager.get().noticeRoomEvent(message, RoomEvent.LUCKY_SEA_GIFT_SERVER_NOTIFY);
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_CRAZY_ZOO://疯狂动物园
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM) {
|
||||
RoomLuckySeaAttachment attachment = new RoomLuckySeaAttachment(CUSTOM_MSG_CRAZY_ZOO, CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM);
|
||||
attachment.setRoomLuckySeaMsgBean(JSON.parseObject(String.valueOf(baseProtocol.getData()), RoomLuckySeaMsgBean.class));
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
|
||||
IMNetEaseManager.get().noticeRoomEvent(message, RoomEvent.CRAZY_ZOO_ALL_ROOM_NOTIFY);
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_LUCKY_GIFT://福袋
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY || baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_GIFT_SERVER_ALL) {
|
||||
RoomReceivedLuckyGiftAttachment attachment = new RoomReceivedLuckyGiftAttachment(CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY);
|
||||
|
@@ -1302,6 +1302,14 @@ public final class IMNetEaseManager {
|
||||
noticeRoomEvent(msg, RoomEvent.ROOM_PK_ACCEPT);
|
||||
if (second == CUSTOM_MSG_SUB_SINGLE_ROOM_PK_ACCEPT &&
|
||||
AuthModel.get().getCurrentUid() == roomPkBean.getInviteUid()) {
|
||||
/*
|
||||
* TODO #特殊问题记录#
|
||||
* 2024.3.12发现问题:A给B发出PK邀请,B接收后,A无法听到B的声音,B能听到A的声音;
|
||||
* 问题原因:B接收后,服务端会发839给A(A就连接B了),但没有地方触发B连接A;
|
||||
* 临时解决:借用839通道、服务端也发839给B,但由于线上版本839处理时判断了inviteUid==当前房间(即:上面的判断)
|
||||
* ,所以补发的这条消息某些字段是反的(inviteUid、aRoomId、aUid)
|
||||
* 所以:后面再处理839事件时需要考虑这点!!!
|
||||
*/
|
||||
AudioEngineManager.get().connectOtherRoom(String.valueOf(roomPkBean.getARoomId()), roomPkBean.getAUid());
|
||||
}
|
||||
break;
|
||||
@@ -1463,6 +1471,11 @@ public final class IMNetEaseManager {
|
||||
case CUSTOM_MSG_ROOM_ALBUM:
|
||||
addMessages(msg);
|
||||
break;
|
||||
case CUSTOM_MSG_CRAZY_ZOO:
|
||||
if (second == CUSTOM_MSG_CRAZY_ZOO_SUB_ROOM) {
|
||||
noticeRoomEvent(msg, RoomEvent.CRAZY_ZOO_ROOM_NOTIFY);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -2103,6 +2116,9 @@ public final class IMNetEaseManager {
|
||||
PkModel.get().syncPkList(userInfo, chatRoomMember.getGroupType());
|
||||
noticePKInfo();
|
||||
|
||||
int oldMicPosition = AvRoomDataManager.get().getMicPosition(AuthModel.get().getCurrentUid());
|
||||
boolean oldIsOnMic = AvRoomDataManager.get().isOwnerOnMic();
|
||||
|
||||
int size = mMicQueueMemberMap.size();
|
||||
if (size > 0) {
|
||||
for (int j = 0; j < size; j++) {
|
||||
@@ -2146,11 +2162,18 @@ public final class IMNetEaseManager {
|
||||
//開麥
|
||||
AudioEngineManager.get().setRole(Constants.CLIENT_ROLE_BROADCASTER);
|
||||
if (!roomQueueInfo.mChatRoomMember.isNoProhibitMic()) {
|
||||
/*
|
||||
修复相亲房自动闭麦bug
|
||||
原因:相亲房的某些麦位状态更新,走的是上麦通道,导致默认闭麦了
|
||||
临时解决:若是相亲房且之前在麦或麦位没变化->不做闭麦操作
|
||||
*/
|
||||
if (!AvRoomDataManager.get().isDatingMode() || (AvRoomDataManager.get().isDatingMode() && (!oldIsOnMic || oldMicPosition != micPosition))) {
|
||||
AudioEngineManager.get().setMute(roomQueueInfo.mRoomMicInfo.isMicMute() || AvRoomDataManager.get().mIsNeedOpenMic);
|
||||
//默認閉麥去掉聲音采集
|
||||
// 默認閉麥去掉聲音采集upMicroQueue
|
||||
AudioEngineManager.get().stopLocalAudio();
|
||||
}
|
||||
}
|
||||
}
|
||||
noticeUpMic(Integer.parseInt(key), chatRoomMember.getAccount());
|
||||
}
|
||||
} else {
|
||||
|
@@ -169,11 +169,17 @@ public class EngineEventHandler extends IRtcEngineEventHandler {
|
||||
@Override
|
||||
public void onAudioMixingFinished() {//伴奏播放已结束回调
|
||||
super.onAudioMixingFinished();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAudioMixingStateChanged(int state, int reasonCode) {
|
||||
super.onAudioMixingStateChanged(state, reasonCode);
|
||||
if (state == Constants.AUDIO_MIXING_STATE_STOPPED && reasonCode == Constants.AUDIO_MIXING_REASON_ALL_LOOPS_COMPLETED) {
|
||||
IMNetEaseManager.get().getChatRoomEventObservable().onNext(
|
||||
new RoomEvent().setEvent(RoomEvent.METHOD_ON_AUDIO_MIXING_FINISHED)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteAudioStateChanged(int i, int i1, int i2, int i3) {
|
||||
|
@@ -14,6 +14,9 @@ import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUS
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_CHATTER_BOX_DROP;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_CHATTER_BOX_INIT;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_CLAN;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_CRAZY_ZOO;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_CRAZY_ZOO_SUB_ROOM;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_DRAGON_BAR;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_DRAW_GIFT_EFFECT;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_EXPER_LEVEL_UP;
|
||||
@@ -665,6 +668,14 @@ public class CustomAttachParser implements MsgAttachmentParser {
|
||||
attachment = new TemplateMessageAttachment(first, second);
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_CRAZY_ZOO:
|
||||
switch (second) {
|
||||
case CUSTOM_MSG_CRAZY_ZOO_SUB_ROOM:
|
||||
case CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM:
|
||||
attachment = new RoomLuckySeaAttachment(first, second);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LogUtils.e(ResUtil.getString(R.string.custom_bean_customattachparser_01) + first + " second=" + second);
|
||||
break;
|
||||
|
@@ -490,6 +490,11 @@ public class CustomAttachment implements MsgAttachment {
|
||||
public static final int CUSTOM_MSG_ROOM_TEMPLATE_SUB_ROOM = 1031;
|
||||
public static final int CUSTOM_MSG_ROOM_TEMPLATE_SUB_ALL_ROOM = 1032;
|
||||
|
||||
// 疯狂动物圆
|
||||
public static final int CUSTOM_MSG_CRAZY_ZOO = 104;
|
||||
public static final int CUSTOM_MSG_CRAZY_ZOO_SUB_ROOM = 1041;// 动物园房间飘屏通知
|
||||
public static final int CUSTOM_MSG_CRAZY_ZOO_SUB_ALL_ROOM = 1042;// 动物园全服飘屏通知
|
||||
|
||||
/**
|
||||
* 自定义消息附件的类型,根据该字段区分不同的自定义消息
|
||||
*/
|
||||
|
@@ -264,6 +264,11 @@ public class RoomEvent {
|
||||
|
||||
public static final int NOTIFY_H5 = 109;
|
||||
|
||||
//疯狂动物园 - 房间飘窗通知
|
||||
public static final int CRAZY_ZOO_ROOM_NOTIFY = 110;
|
||||
//疯狂动物园 - 全服房间飘窗通知
|
||||
public static final int CRAZY_ZOO_ALL_ROOM_NOTIFY = 111;
|
||||
|
||||
private int event = NONE;
|
||||
private int micPosition = Integer.MIN_VALUE;
|
||||
private int posState = -1;
|
||||
|
Reference in New Issue
Block a user