From 5c7d2e96452a4b53face9b75ad3c17a05a3efec6 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 1 Nov 2023 18:34:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4=E5=B9=B8=E8=BF=90?= =?UTF-8?q?=E7=A4=BC=E7=89=A9=E5=8A=A8=E7=94=BB=E6=92=AD=E6=94=BE=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=EF=BC=88=E5=8E=BB=E6=8E=89=E4=BB=B7=E5=80=BC520?= =?UTF-8?q?=E7=9A=84=E6=9D=A1=E4=BB=B6=EF=BC=8C=E6=81=A2=E5=A4=8DluckyGift?= =?UTF-8?q?SvgaUrl=E9=80=BB=E8=BE=91=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erban/avroom/widget/GiftV2View.java | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/yizhuan/erban/avroom/widget/GiftV2View.java b/app/src/main/java/com/yizhuan/erban/avroom/widget/GiftV2View.java index e15c3fc08..2b17d5e99 100644 --- a/app/src/main/java/com/yizhuan/erban/avroom/widget/GiftV2View.java +++ b/app/src/main/java/com/yizhuan/erban/avroom/widget/GiftV2View.java @@ -296,16 +296,24 @@ public class GiftV2View extends FrameLayout implements GiftEffectView.GiftEffect if (roomInfo != null) { List targetUsers = new ArrayList<>(); int totalCoin = 0; - drawLuckyGiftAnimation(roomInfo, giftReceiveInfos, totalCoin, targetUsers, giftReceiveType, isShowAnimation, pos); -// if (AvRoomDataManager.get().mIsNeedGiftEffect && -// !AvRoomDataManager.get().isSelfGamePlaying()) { -// SVGAImageView imageView = playLuckyBagAnim(svgaUrl); -// handler.postDelayed(() -> { -// removeView(imageView); -// imageView.stopAnimation(true); -// }, 1800); -// } -// handler.postDelayed(() -> drawLuckyGiftAnimation(roomInfo, giftReceiveInfos, totalCoin, targetUsers, giftReceiveType, isShowAnimation, pos), 1200); + boolean isPlaySvga = false; + if (AvRoomDataManager.get().mIsNeedGiftEffect && + !AvRoomDataManager.get().isSelfGamePlaying()) { + if (svgaUrl != null && !svgaUrl.isEmpty()) { + isPlaySvga = true; + SVGAImageView imageView = playLuckyBagAnim(svgaUrl); + handler.postDelayed(() -> { + removeView(imageView); + imageView.stopAnimation(true); + }, 1800); + } + } + + if (isPlaySvga) { + handler.postDelayed(() -> drawLuckyGiftAnimation(roomInfo, giftReceiveInfos, totalCoin, targetUsers, giftReceiveType, isShowAnimation, pos), 1200); + } else { + drawLuckyGiftAnimation(roomInfo, giftReceiveInfos, totalCoin, targetUsers, giftReceiveType, isShowAnimation, pos); + } } } @@ -353,7 +361,7 @@ public class GiftV2View extends FrameLayout implements GiftEffectView.GiftEffect targetUsers.add(giftReceiver); if (!isShowAnimation) return; giftInfo = giftReceiveInfo.getDisplayGift().get(pos); - if (totalCoin >= 520 || (giftInfo != null && giftInfo.isHasEffect())) { + if (giftInfo != null && giftInfo.isHasEffect()) { Message msg = Message.obtain(); msg.what = 0; GiftEffectInfo giftEffectInfo = new GiftEffectInfo();