From 124b18dcb00f071a25b8be5a95dd291faeddfbcb Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Sat, 8 Jul 2023 15:15:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/dialog/ReceiveRendPacketPopup.java | 21 +++++++---- .../live/dialog/ResultRendPacketPopup.java | 36 +++++++++---------- .../yunbao/live/views/LiveRoomViewHolder.java | 12 +++++-- 3 files changed, 41 insertions(+), 28 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/dialog/ReceiveRendPacketPopup.java b/live/src/main/java/com/yunbao/live/dialog/ReceiveRendPacketPopup.java index 5e778ed84..f1e2e85ab 100644 --- a/live/src/main/java/com/yunbao/live/dialog/ReceiveRendPacketPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/ReceiveRendPacketPopup.java @@ -156,12 +156,19 @@ public class ReceiveRendPacketPopup extends CenterPopupView { @Override public void onSuccess(RedPacketInfoModel data) { dismiss(); - new XPopup.Builder(getContext()) - .asCustom(new ResultRendPacketPopup(getContext(), - false, - data.setSuperJackpotId(redPacketInfoModel.getSuperJackpotId()), - isSuperJackpot)) - .show(); + if (data.getGiftModels().size() > 0) { + new XPopup.Builder(getContext()) + .asCustom(new ResultRendPacketPopup(getContext(), + false, + data.setSuperJackpotId(redPacketInfoModel.getSuperJackpotId()), + isSuperJackpot)) + .show(); + } else { + new XPopup.Builder(getContext()) + .asCustom(new ResultRendPacketPopup(getContext(), true, data.setRedPacketId(redPacketInfoModel.getSuperJackpotId()), false)) + .show(); + } + } @Override @@ -171,7 +178,7 @@ public class ReceiveRendPacketPopup extends CenterPopupView { } }); } else { - if (TextUtils.equals(redPacketInfoModel.getConditions(),"1")){ + if (TextUtils.equals(redPacketInfoModel.getConditions(), "1")) { LiveRoomViewHolder.follow(); } diff --git a/live/src/main/java/com/yunbao/live/dialog/ResultRendPacketPopup.java b/live/src/main/java/com/yunbao/live/dialog/ResultRendPacketPopup.java index 5e3b48bdf..4a490ef7f 100644 --- a/live/src/main/java/com/yunbao/live/dialog/ResultRendPacketPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/ResultRendPacketPopup.java @@ -105,18 +105,18 @@ public class ResultRendPacketPopup extends CenterPopupView { new HttpCallback>() { @Override public void onSuccess(List data) { - if (data.size() > 0) { +// if (data.size() > 0) { new XPopup.Builder(getContext()) .asCustom(new LuckUserRedPacketPopup(getContext(), data)) .show(); - } else { - new XPopup.Builder(getContext()) - .asCustom(new ResultRendPacketPopup(getContext(), - true, - redPacketInfoModel, - isSuperJackpot)) - .show(); - } +// } else { +// new XPopup.Builder(getContext()) +// .asCustom(new ResultRendPacketPopup(getContext(), +// true, +// redPacketInfoModel, +// isSuperJackpot)) +// .show(); +// } } @@ -131,18 +131,18 @@ public class ResultRendPacketPopup extends CenterPopupView { new HttpCallback>() { @Override public void onSuccess(List data) { - if (data.size() > 0) { +// if (data.size() > 0) { new XPopup.Builder(getContext()) .asCustom(new LuckUserRedPacketPopup(getContext(), data)) .show(); - } else { - new XPopup.Builder(getContext()) - .asCustom(new ResultRendPacketPopup(getContext(), - true, - redPacketInfoModel, - isSuperJackpot)) - .show(); - } +// } else { +// new XPopup.Builder(getContext()) +// .asCustom(new ResultRendPacketPopup(getContext(), +// true, +// redPacketInfoModel, +// isSuperJackpot)) +// .show(); +// } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index f44a743fe..ebca71e8f 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1500,9 +1500,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .asCustom(new ResultRendPacketPopup(mContext, true, data.setRedPacketId(redPacketModel.getRedPacketId()), false)) .show(); } else { - new XPopup.Builder(mContext) - .asCustom(new ResultRendPacketPopup(mContext, false, data.setRedPacketId(redPacketModel.getRedPacketId()), false)) - .show(); + if (data.getGiftModels().size() > 0) { + new XPopup.Builder(mContext) + .asCustom(new ResultRendPacketPopup(mContext, false, data.setRedPacketId(redPacketModel.getRedPacketId()), false)) + .show(); + } else { + new XPopup.Builder(mContext) + .asCustom(new ResultRendPacketPopup(mContext, true, data.setRedPacketId(redPacketModel.getRedPacketId()), false)) + .show(); + } } }