心愿单刷新数量进度

This commit is contained in:
18401019693 2022-08-29 15:26:58 +08:00
parent e2cd64ec0f
commit 623e17ae4e
5 changed files with 34 additions and 13 deletions

View File

@ -32,9 +32,9 @@ import static com.yunbao.common.CommonAppContext.isReady;
*/
public class RongcloudIMManager {
//融云开发者平台注册app唯一识别符
public static final String RONG_IM_KEY = "uwd1c0sxu1p71";
// public static final String RONG_IM_KEY = "uwd1c0sxu1p71";
//测试环境
// public static final String RONG_IM_KEY = "pvxdm17jpd3hr";
public static final String RONG_IM_KEY = "pvxdm17jpd3hr";
private static final String CLASSNAME = "RongcloudIMManager";

View File

@ -10,9 +10,9 @@ ext {
manifestPlaceholders = [
//
serverHost : "https://napi.yaoulive.com",
// serverHost : "https://napi.yaoulive.com",
//
// serverHost : "https://ceshi.yaoulive.com",
serverHost : "https://ceshi.yaoulive.com",
//
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",

View File

@ -3,7 +3,6 @@ package com.yunbao.live.views;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Outline;
import android.os.Bundle;
import android.os.Handler;
@ -115,7 +114,6 @@ import java.util.List;
import pl.droidsonroids.gif.GifImageView;
import static com.blankj.utilcode.util.ActivityUtils.startActivity;
import static com.yunbao.common.CommonAppContext.logger;
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
@ -252,6 +250,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private LiveRoomFastMessageRecyclerViewAdapter fastMessageRecyclerViewAdapter;
private LiveUserGiftBean nowGuardUser;
private ViewFlipper wishListFlipper;
private List<WishlistItemModel> wishlist = new ArrayList<>();
public LiveRoomViewHolder(boolean isRys, int forActivity, Context context, ViewGroup parentView, GifImageView gifImageView, SVGAImageView svgaImageView, ViewGroup liveGiftPrizePoolContainer, WindowManager windowManager) {
super(context, parentView);
@ -1040,14 +1040,16 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
*/
public void initWishList(List<WishlistItemModel> wishlist) {
if (wishlist.size() > 0) {
this.wishlist = wishlist;
wishListLayout.setVisibility(View.VISIBLE);
} else {
wishListLayout.setVisibility(View.GONE);
}
((Activity) mContext).runOnUiThread(() -> {
ViewFlipper wishListFlipper = (ViewFlipper) findViewById(R.id.wish_list);
wishListFlipper = (ViewFlipper) findViewById(R.id.wish_list);
for (int i = 0; i < wishlist.size(); i++) {
View wish = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
wish.setTag(wishlist.get(i).getId());
ImageView wishPic = wish.findViewById(R.id.wish_pic);
TextView wishIndex = wish.findViewById(R.id.wish_index);
ImgLoader.display(mContext, wishlist.get(i).getWishlistIcon(), wishPic);
@ -1060,6 +1062,23 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
/**
* 更新心愿单进度
*
* @param giftId 礼物ID
* @param giftCount 礼物数量
*/
public void updataWishList(String giftId, int giftCount) {
for (WishlistItemModel model : wishlist) {
if (TextUtils.equals(giftId, model.getLid())) {
int number = Integer.parseInt(model.getWishlistProgress()) + giftCount;
model.setWishlistProgress(String.valueOf(number));
}
}
wishListFlipper.removeAllViews();
initWishList(wishlist);
}
//点击头像
private void clickAvatar() {
livePKUserListBean = new LivePKUserListBean();

View File

@ -575,7 +575,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveLinkMicPresenter.onAudienceLeaveRoom(bean);
}
try {
if(mLiveRoomViewHolder!=null){
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.onExitRoom(bean);
if (mLiveRoomViewHolder.room_hot != null) {
if (!"".equals(bean.getHot_num()) && !"0".equals(bean.getHot_num())) {
@ -596,13 +596,15 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.showGuardGifMessage(bean);
}
} else {
if (mLiveRoomViewHolder != null) {
if (bean.getmLiveUId().equals(bean.getRoomnum())) {
mLiveRoomViewHolder.insertChat(bean.getLiveChatBean(), 1);
}
mLiveRoomViewHolder.showGiftMessage(bean, false);
mLiveRoomViewHolder.updataWishList(bean.getGiftId(), bean.getGiftCount());
}
}
}

View File

@ -7,8 +7,8 @@
<ImageView
android:id="@+id/wish_pic"
android:layout_width="20dp"
android:layout_height="20dp" />
android:layout_width="17dp"
android:layout_height="17dp" />
<com.yunbao.common.views.weight.MarqueeTextView
android:id="@+id/wish_index"