From b3d4d2b8f906216e22c870bf09ff4fdd67bfa97b Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Sat, 8 Apr 2023 13:36:12 +0800 Subject: [PATCH] xiu gai xinyuan dan --- .../yunbao/live/views/LiveRoomViewHolder.java | 108 ++++++++++-------- 1 file changed, 61 insertions(+), 47 deletions(-) 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 b92ac4235..2771f691b 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1,12 +1,10 @@ package com.yunbao.live.views; import static com.yunbao.live.bean.LiveChatBean.RECOMMEND_CARD_NOTIFY; -import static com.yunbao.live.views.LivePushRyViewHolder.btn_close; import android.app.Activity; import android.app.Dialog; import android.content.Context; -import android.graphics.Color; import android.graphics.Outline; import android.graphics.drawable.Drawable; import android.os.Bundle; @@ -4234,7 +4232,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } - public void wishListProgress(WishModel wishModel, String userNiceName,int level) { + public void wishListProgress(WishModel wishModel, String userNiceName, int level) { wishListProgress = null; WishModel model = wishModel; if (!TextUtils.isEmpty(model.getWishlistName()) || !TextUtils.isEmpty(model.getWishlistProgress())) { @@ -4243,7 +4241,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mTopBannerList.remove(bannerBean); } } - topBanner1.update(mTopBannerList); + if (mTopBannerList.size()==0){ + topBanner1.setVisibility(View.GONE); + }else { + topBanner1.update(mTopBannerList); + } new Handler().postDelayed(new Runnable() { @Override public void run() { @@ -4263,7 +4265,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis bean.setType(LiveChatBean.WISH_LIST_PROGRESS); bean.setLevel(level); mLiveChatAdapter.insertItem(bean); - topBanner1.update(mTopBannerList); + if (mTopBannerList.size()==0){ + topBanner1.setVisibility(View.GONE); + }else { + topBanner1.update(mTopBannerList); + } } }, 500); @@ -4279,7 +4285,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis // bean.setAtUserName(model.getWishlistName()); // bean.setType(LiveChatBean.WISH_LIST_PROGRESS); // mLiveChatAdapter.insertItem(bean); - topBanner1.update(mTopBannerList); + if (mTopBannerList.size()==0){ + topBanner1.setVisibility(View.GONE); + }else { + topBanner1.update(mTopBannerList); + } + } } @@ -4559,8 +4570,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis enterRoomLeave.setBackgroundResource(R.drawable.background_100); enterRoomLeave2.setBackgroundResource(R.drawable.bg_100_leave); } - - new LiveTextRender().getLiveLevelImage(mContext, model.getLevel(), true,new ImgLoader.DrawableCallback() { + boolean max = level > 99; + new LiveTextRender().getLiveLevelImage(mContext, model.getLevel(), max, new ImgLoader.DrawableCallback() { @Override public void onLoadSuccess(Drawable drawable) { ImgLoader.display2(mContext, drawable, imageView); @@ -4751,49 +4762,52 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .setOnBannerClickListener(new OnBannerClickListener() { @Override public void onBannerClick(List datas, int position) { - if (mTopBannerList.get(position).getType() == TopBannerCustomViewHolder.TYPE_CALL_ANCHOR) { - Dialog loading = DialogUitl.loadingDialog(mContext); - loading.show(); - LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); - fragment.setOnDismissListener(dialog -> { - checkNewLetter(); - } - ); - fragment.setOnShowListener(dialog -> mHandler.postDelayed(loading::dismiss, 500)); - Bundle bundle = new Bundle(); - bundle.putString(Constants.LIVE_UID, mLiveUid); - bundle.putString(Constants.LIVE_STREAM, mStream); - bundle.putString(Constants.LIVE_WISH_GIFTID, mTopBannerList.get(position).getActivityId() + ""); - bundle.putBoolean("isContactGift", true); - fragment.setArguments(bundle); - fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); - } else { - BannerBean bean = mTopBannerList.get(position); - IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); - String type = ""; - StringBuffer htmlUrl = new StringBuffer(); - htmlUrl.append(bean.getLink()) - .append(bean.getLink().contains("?") ? "&uid=" : "?uid=") - .append(userInfo.getId()) - .append("&token=") - .append(userInfo.getToken()) - .append("&anchorUid=") - .append(mLiveUid) - .append("&liveUid=") - .append(mLiveUid) - .append("&t=") - .append(System.currentTimeMillis()) - .append("&g=Appapi&m=Wish&a=index"); - if (TextUtils.equals(type, "1")) { - ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); - } else { + if (datas.size()>0){ + if (mTopBannerList.get(position).getType() == TopBannerCustomViewHolder.TYPE_CALL_ANCHOR) { + Dialog loading = DialogUitl.loadingDialog(mContext); + loading.show(); + LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); + fragment.setOnDismissListener(dialog -> { + checkNewLetter(); + } + ); + fragment.setOnShowListener(dialog -> mHandler.postDelayed(loading::dismiss, 500)); Bundle bundle = new Bundle(); - bundle.putString("url", htmlUrl.toString()); - LiveHDDialogFragment fragment = new LiveHDDialogFragment(); + bundle.putString(Constants.LIVE_UID, mLiveUid); + bundle.putString(Constants.LIVE_STREAM, mStream); + bundle.putString(Constants.LIVE_WISH_GIFTID, mTopBannerList.get(position).getActivityId() + ""); + bundle.putBoolean("isContactGift", true); fragment.setArguments(bundle); - fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); + fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); + } else { + BannerBean bean = mTopBannerList.get(position); + IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); + String type = ""; + StringBuffer htmlUrl = new StringBuffer(); + htmlUrl.append(bean.getLink()) + .append(bean.getLink().contains("?") ? "&uid=" : "?uid=") + .append(userInfo.getId()) + .append("&token=") + .append(userInfo.getToken()) + .append("&anchorUid=") + .append(mLiveUid) + .append("&liveUid=") + .append(mLiveUid) + .append("&t=") + .append(System.currentTimeMillis()) + .append("&g=Appapi&m=Wish&a=index"); + if (TextUtils.equals(type, "1")) { + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); + } else { + Bundle bundle = new Bundle(); + bundle.putString("url", htmlUrl.toString()); + LiveHDDialogFragment fragment = new LiveHDDialogFragment(); + fragment.setArguments(bundle); + fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); + } } } + } }) .start();