fix:修復直播间内送礼物热度榜不刷新的问题

This commit is contained in:
zlzw 2022-08-31 11:10:52 +08:00
parent 57f6d7da86
commit eab4f1686a
2 changed files with 10 additions and 4 deletions

View File

@ -783,6 +783,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
if (mLiveUserAdapter != null) { if (mLiveUserAdapter != null) {
JSONObject obj = JSON.parseObject(info[0]); JSONObject obj = JSON.parseObject(info[0]);
List<LiveUserGiftBean> list = JSON.parseArray(obj.getString("userlist"), LiveUserGiftBean.class); List<LiveUserGiftBean> list = JSON.parseArray(obj.getString("userlist"), LiveUserGiftBean.class);
if(list.size()>3){
ViewGroup.LayoutParams layoutParams = mUserRecyclerView.getLayoutParams();
layoutParams.height=DpUtil.dp2px(100);
mUserRecyclerView.setLayoutParams(layoutParams);
}
mLiveUserAdapter.refreshList(list); mLiveUserAdapter.refreshList(list);
} }
} }
@ -1167,7 +1172,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* @param hot 热度值 * @param hot 热度值
*/ */
public void setHotData(String hot) { public void setHotData(String hot) {
if (mHotText != null) { if (mHotText != null&&!TextUtils.isEmpty(hot)) {
mHotText.setText(hot); mHotText.setText(hot);
} }
@ -1968,7 +1973,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void showGiftMessage(LiveReceiveGiftBean bean) { public void showGiftMessage(LiveReceiveGiftBean bean) {
mVotes.setText(bean.getVotes()); mVotes.setText(bean.getVotes());
room_hot.setText(formatBigNum.formatBigNum(bean.getHot_num())); room_hot.setText(formatBigNum.formatBigNum(bean.getHot_num()));
setHotData(formatBigNum.formatBigNum(bean.getLiveChatBean().getHot_num())); setHotData(formatBigNum.formatBigNum(bean.getHot_num()));
mTvMedalRank.setText(bean.getMedalRankNum()); mTvMedalRank.setText(bean.getMedalRankNum());
if (mLiveGiftAnimPresenter == null) { if (mLiveGiftAnimPresenter == null) {
mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager); mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager);
@ -1982,7 +1987,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void showGiftMessage(LiveReceiveGiftBean bean, boolean isAncher) { public void showGiftMessage(LiveReceiveGiftBean bean, boolean isAncher) {
mVotes.setText(bean.getVotes()); mVotes.setText(bean.getVotes());
room_hot.setText(formatBigNum.formatBigNum(bean.getHot_num())); room_hot.setText(formatBigNum.formatBigNum(bean.getHot_num()));
setHotData(formatBigNum.formatBigNum(bean.getLiveChatBean().getHot_num())); setHotData(formatBigNum.formatBigNum(bean.getHot_num()));
mTvMedalRank.setText(bean.getMedalRankNum()); mTvMedalRank.setText(bean.getMedalRankNum());
//开通粉丝勋章成功弹窗 //开通粉丝勋章成功弹窗
if (!isAncher && bean.getMedalFirstGet() != null && bean.getMedalFirstGet().equals("1") if (!isAncher && bean.getMedalFirstGet() != null && bean.getMedalFirstGet().equals("1")
@ -2004,6 +2009,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager); mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager);
} }
mLiveGiftAnimPresenter.showBuyGuardGiftAnim(bean); mLiveGiftAnimPresenter.showBuyGuardGiftAnim(bean);
setHotData(bean.getHot_num());
} }
//全服通知 购买坐骑 //全服通知 购买坐骑

View File

@ -177,6 +177,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@id/group_1" android:layout_alignBottom="@id/group_1"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginEnd="10dp"
android:layout_toRightOf="@id/group_1"> android:layout_toRightOf="@id/group_1">
<LinearLayout <LinearLayout
@ -232,7 +233,6 @@
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:layout_marginEnd="10dp"
android:src="@mipmap/icon_live_close_3" /> android:src="@mipmap/icon_live_close_3" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>