diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index 50114eeaa..13d5fe08b 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -10,7 +10,6 @@ import android.content.res.Configuration; import android.graphics.drawable.AnimationDrawable; import android.os.CountDownTimer; import android.os.Handler; -import android.os.Looper; import android.text.TextUtils; import android.util.Log; import android.view.LayoutInflater; @@ -99,8 +98,6 @@ import org.greenrobot.eventbus.EventBus; import java.util.ArrayList; import java.util.List; -import java.util.Timer; -import java.util.TimerTask; import cn.rongcloud.rtc.api.RCRTCEngine; import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback; @@ -1128,18 +1125,21 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void onSendGift(LiveReceiveGiftBean bean, SendBlindGiftEvent event) { if (event != null) { LiveChatBean liveChatBean = null; - if (!TextUtils.isEmpty(event.getDressName()) && !TextUtils.isEmpty(event.getDressMsg())) { - liveChatBean = new LiveChatBean(); - liveChatBean.setUserNiceName(event.getUserNiceName()); - liveChatBean.setType(LiveChatBean.BLIND_BOX); - liveChatBean.setGiftName(event.getDressName()); - liveChatBean.setContent(event.getDressMsg()); + if (!TextUtils.isEmpty(event.isBlindBoxStatus()) && TextUtils.equals(event.isBlindBoxStatus(), "true")) { + if (!TextUtils.isEmpty(event.getDressName()) && !TextUtils.isEmpty(event.getDressMsg())) { + liveChatBean = new LiveChatBean(); + liveChatBean.setUserNiceName(event.getUserNiceName()); + liveChatBean.setType(LiveChatBean.BLIND_BOX); + liveChatBean.setGiftName(event.getDressName()); + liveChatBean.setContent(event.getDressMsg()); + } + //插入盲盒礼物消息 + bean.getLiveChatBean().setType(LiveChatBean.BLIND_BOX); + bean.getLiveChatBean().setContent(event.getGiftMsg()); + bean.getLiveChatBean().setGiftName(event.getGiftname()); + bean.getLiveChatBean().setUserNiceName(event.getUserNiceName()); } - //插入盲盒礼物消息 - bean.getLiveChatBean().setType(LiveChatBean.BLIND_BOX); - bean.getLiveChatBean().setContent(event.getGiftMsg()); - bean.getLiveChatBean().setGiftName(event.getGiftname()); - bean.getLiveChatBean().setUserNiceName(event.getUserNiceName()); + if (mLiveRoomViewHolder != null) { if (bean.getmLiveUId().equals(bean.getRoomnum())) { @@ -1209,12 +1209,12 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } @Override - public void onEndPk(long leftUid, long rightUid, long left, long right,LivePKUserListBean bean) { + public void onEndPk(long leftUid, long rightUid, long left, long right, LivePKUserListBean bean) { if (mLiveRyLinkMicPkPresenter != null) { if (mLiveUid.equals(leftUid + "")) { - mLiveRyLinkMicPkPresenter.onPkProgressEnd(left, right,bean); + mLiveRyLinkMicPkPresenter.onPkProgressEnd(left, right, bean); } else { - mLiveRyLinkMicPkPresenter.onPkProgressEnd(right, left,bean); + mLiveRyLinkMicPkPresenter.onPkProgressEnd(right, left, bean); } } }