From 4d437be248208e41b3f88a32e5615506d231a194 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 23 Nov 2022 15:04:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=B4=E6=92=AD=E9=97=B4?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E9=80=81=E7=A4=BC=E5=88=97=E8=A1=A8=E4=B8=8D?= =?UTF-8?q?=E5=81=9C=E6=AD=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/presenter/LiveGiftAnimPresenter.java | 26 +++---------------- .../yunbao/live/views/LiveRoomViewHolder.java | 14 +++++----- .../live/views/PortraitLiveManager.java | 2 +- 3 files changed, 11 insertions(+), 31 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java index 8ce58270f..d7e3ac087 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -36,6 +36,7 @@ import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.HtmlConfig; import com.yunbao.common.activity.WebViewActivity; +import com.yunbao.common.bean.LiveBean; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpUtil; @@ -50,7 +51,6 @@ import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; import com.yunbao.live.activity.LiveAudienceActivity; -import com.yunbao.common.bean.LiveBean; import com.yunbao.live.bean.LiveGiftPrizePoolWinBean; import com.yunbao.live.bean.LiveLuckGiftWinBean; import com.yunbao.live.bean.LiveReceiveGiftBean; @@ -231,13 +231,6 @@ public class LiveGiftAnimPresenter { mFrameImageView = (FrameImageView) v.findViewById(R.id.all_frame_img); -// mGifGiftTipAllServer.setSelected(true); -// mGifGiftTipBuyGuard.setSelected(true); -// mGifGiftTipBuyZuoji.setSelected(true); -// mGifGiftTipBuyLiangName.setSelected(true); -// mGifGiftTipBuyVip.setSelected(true); - - mIvLookClick(); mIvLookBuyGuardClick(); mIvLookBuyZuojiClick(); @@ -285,11 +278,6 @@ public class LiveGiftAnimPresenter { mAnimator.setDuration(800); mAnimator.setRepeatCount(3); mAnimator.setInterpolator(new LinearInterpolator()); - - -// mGifGiftTipAllServer.init(windowManager); -// mGifGiftTipBuyGuard.init(windowManager); -// mGifGiftTipBuyVip.init(windowManager); } @@ -361,10 +349,6 @@ public class LiveGiftAnimPresenter { mGifGiftTipGroupBuyVip.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { -// UserBean u = CommonAppConfig.getInstance().getUserBean(); -// String url = CommonAppConfig.HOST+"/h5/Noble/index.html?nickname="+u.getUserNiceName()+"&usernobId="+u.getNoble_id()+"&token="+ CommonAppConfig.getInstance().getToken()+"&uid="+CommonAppConfig.getInstance().getUid(); -// startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url",url)); - // WebViewActivity.forward(mContext, HtmlConfig.SHOP); changeLiveRoom(); } }); @@ -558,7 +542,6 @@ public class LiveGiftAnimPresenter { }); mDp10 = DpUtil.dp2px(10); mGifGiftTipHideAnimatorBuyVip = ObjectAnimator.ofFloat(mGifGiftTipGroupBuyVip, "translationX", 0);//平移 -// mGifGiftTipHideAnimatorBuyVip = ObjectAnimator.ofFloat(mGifGiftTipGroupBuyVip, "alpha", 1f, 0f);//渐变 mGifGiftTipHideAnimatorBuyVip.setDuration(3000); mGifGiftTipHideAnimatorBuyVip.setInterpolator(new AccelerateDecelerateInterpolator()); mGifGiftTipHideAnimatorBuyVip.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @@ -616,9 +599,6 @@ public class LiveGiftAnimPresenter { diffTime = 0; } mSVGAImageViewFront.clear(); -// if (mHandler != null) { -// mHandler.sendEmptyMessageDelayed(WHAT_GIF_All_SERVER, diffTime); -// } } @Override @@ -673,7 +653,6 @@ public class LiveGiftAnimPresenter { if (!mIsSameRoom) { mGifGiftTipHideAnimatorAllServer.setFloatValues(0, -mDp10 - mGifGiftTipGroupAllServer.getWidth()); mGifGiftTipHideAnimatorAllServer.start(); -// mHandler.sendEmptyMessageDelayed(WHAT_GIF_All_SERVER, 800); } } else if (msg.what == WHAT_ALL_SERVER_1) { mGifGiftTipHideAnimatorAllServer.setFloatValues(0, -mDp10 - mGifGiftTipGroupAllServer.getWidth()); @@ -804,7 +783,6 @@ public class LiveGiftAnimPresenter { //同一直播间,其他玩家也能看到全服通知 String userId = CommonAppConfig.getInstance().getUid(); String uid = bean.getUid(); -// if (userId.equals(uid)) if (mIsAllServerNotify) { if (!isAncher) { if (!bean.getDrpk_status().equals("1")) { @@ -1516,9 +1494,11 @@ public class LiveGiftAnimPresenter { public void release() { clearAnim(); if (mLiveGiftViewHolders[0] != null) { + mLiveGiftViewHolders[0].hideNormal(); mLiveGiftViewHolders[0].release(); } if (mLiveGiftViewHolders[1] != null) { + mLiveGiftViewHolders[1].hideNormal(); mLiveGiftViewHolders[1].release(); } if (mSVGAImageView != null) { 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 74eaf8a0c..f14e7c04d 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -91,7 +91,6 @@ import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.utils.ScreenDimenUtil; import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.StringUtil; -import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.formatBigNum; import com.yunbao.common.views.AbsViewHolder; @@ -1582,7 +1581,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis pkRankVf.setOnClickListener(v -> { Bundle bundle = new Bundle(); String path = bean.getClickUrl(); - if (!path.startsWith("/")&&!path.startsWith("http")) { + if (!path.startsWith("/") && !path.startsWith("http")) { path = "/" + path; } String url = null; @@ -2681,11 +2680,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis * @param bean */ public void showBuyVipMessage(LiveReceiveGiftBean bean) { -// if (mLiveGiftAnimPresenter == null) { -// mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager); -// } -// mLiveGiftAnimPresenter.showBuyVipGiftAnim(bean); - switch (bean.getNobilityid()) { case "1": noble.setRootView(bean.getUhead(), @@ -2929,6 +2923,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mUserRecyclerView.setLayoutParams(params); } + public void releaseGift() { + if (mLiveGiftAnimPresenter != null) { + mLiveGiftAnimPresenter.cancelAllAnim(); + } + } + public void release() { EventBus.getDefault().unregister(this); LiveHttpUtil.cancel(LiveHttpConsts.GET_USER_LIST); 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 7e1fa33e5..52ca4a8e2 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -277,7 +277,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.setTitle(data.getTitle()); mLiveRoomViewHolder.setAnchorGoodNumber(data.getGoodNum()); mLiveRoomViewHolder.clearGuardIcon(); - + mLiveRoomViewHolder.releaseGift(); mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), ""); mLiveRoomViewHolder.setLiveUid(data.getUid());