fix:调整幸运礼物动画播放条件(去掉价值520的条件,恢复luckyGiftSvgaUrl逻辑)

This commit is contained in:
Max
2023-11-01 18:34:15 +08:00
parent b63b4ba07a
commit 5c7d2e9645

View File

@@ -296,16 +296,24 @@ public class GiftV2View extends FrameLayout implements GiftEffectView.GiftEffect
if (roomInfo != null) {
List<GiftReceiver> 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();