fix:修复房间内点击红包跳转到其他房间后没弹出红包问题

This commit is contained in:
Max
2023-10-30 15:16:06 +08:00
parent e031dd9d02
commit 80e21bee74

View File

@@ -225,10 +225,10 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
private GiftBroadcastObserver giftObserver;
private Dialog giftDialog;
private LinkedList<AllServiceGiftProtocol.DataBean> giftList;
private boolean isResume = true;
@Nullable
private SingleRoomTipDialog singleRoomTipDialog;
// 通过红包进来时,有该参数
private RedPackageNotifyInfo redPackageNotifyInfo;
public static void start(Context context, long roomUid) {
startForFromType(context, roomUid, FROM_TYPE_NORMAL, null, null);
}
@@ -412,6 +412,12 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
fromUid = intent.getStringExtra("fromUid");
giftId = intent.getIntExtra("giftId", 0);
mRoomInfo = intent.getParcelableExtra(Constants.ROOM_INFO);
Object notifyInfo = intent.getSerializableExtra("notifyInfo");
if (notifyInfo instanceof RedPackageNotifyInfo) {
redPackageNotifyInfo = (RedPackageNotifyInfo) notifyInfo;
}else{
redPackageNotifyInfo = null;
}
if (mRoomInfo != null) {
roomUid = mRoomInfo.getRoomUid();
} else {
@@ -510,7 +516,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
if (giftList != null) {
giftList.clear();
}
isResume = true;
}
private void onRoomEventReceive(RoomEvent roomEvent) {
@@ -727,11 +732,10 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
*/
private void tryShowSourceRedPackage() {
try {
RedPackageNotifyInfo inRoomNotifyInfo = (RedPackageNotifyInfo) getIntent().getSerializableExtra("notifyInfo");
if (inRoomNotifyInfo != null) {
if (redPackageNotifyInfo != null) {
RedPackageHandler handler = getRoomContext().findAbility(RedPackageHandler.class.getSimpleName());
if (handler != null) {
long id = Long.parseLong(inRoomNotifyInfo.getRedEnvelopeId());
long id = Long.parseLong(redPackageNotifyInfo.getRedEnvelopeId());
handler.tryShowRedPackage(id);
}
}
@@ -1340,10 +1344,8 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
protected void onPause() {
super.onPause();
registerGiftBroadcastMessage(false);
isResume = false;
}
private void handlePmExitRoom() {
EventBus.getDefault().post(new PmDismissAllLimitDialogEvent());
getMvpPresenter().exitRoom();