From 6316f9489eff339cf1c0eba36be3122b1e29b926 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Mon, 29 Aug 2022 13:24:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=20=E5=BF=83?= =?UTF-8?q?=E6=84=BF=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/activity/LiveAudienceActivity.java | 3 +++ .../com/yunbao/live/bean/WishlistItemModel.java | 4 ++++ .../yunbao/live/views/LiveRoomViewHolder.java | 17 +++++++++-------- .../yunbao/live/views/PortraitLiveManager.java | 2 +- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index f1e61654e..d73238318 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -417,6 +417,8 @@ public class LiveAudienceActivity extends LiveActivity { } else if (Micing == 2) { manager.micIngTypeTwo(mLiveBean, mLiveType, mLiveTypeVal); } else { + manager.exitLiveRoom(); + manager.onRemove(); super.onBackPressed(); } @@ -437,6 +439,7 @@ public class LiveAudienceActivity extends LiveActivity { @Override protected void onDestroy() { super.onDestroy(); + Bus.getOff(this); L.e("LiveAudienceActivity-------onDestroy------->"); } diff --git a/live/src/main/java/com/yunbao/live/bean/WishlistItemModel.java b/live/src/main/java/com/yunbao/live/bean/WishlistItemModel.java index 2ff070c13..676fd1e4e 100644 --- a/live/src/main/java/com/yunbao/live/bean/WishlistItemModel.java +++ b/live/src/main/java/com/yunbao/live/bean/WishlistItemModel.java @@ -115,4 +115,8 @@ public class WishlistItemModel extends BaseModel { this.wishlistProgress = wishlistProgress; return this; } + + public String getWishlistNumP() { + return wishlistProgress + "/" + wishlistNum; + } } 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 95d865260..c22a101fa 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -855,8 +855,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis ViewClicksAntiShake.clicksAntiShake(wishListLayout, () -> startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url", ""))); //打招呼消息 fastMsgRecyclerView = (RecyclerView) findViewById(R.id.room_fast_msg); - fastMsgRecyclerView.setLayoutManager(new LinearLayoutManager(mContext,LinearLayoutManager.HORIZONTAL,false)); - fastMessageRecyclerViewAdapter=new LiveRoomFastMessageRecyclerViewAdapter(mContext); + fastMsgRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false)); + fastMessageRecyclerViewAdapter = new LiveRoomFastMessageRecyclerViewAdapter(mContext); fastMsgRecyclerView.setAdapter(fastMessageRecyclerViewAdapter); fastMessageRecyclerViewAdapter.setMessageListener(msg -> { //点击的消息发送出去 @@ -1053,7 +1053,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis ImageView wishPic = wish.findViewById(R.id.wish_pic); TextView wishIndex = wish.findViewById(R.id.wish_index); ImgLoader.display(mContext, wishlist.get(i).getWishlistIcon(), wishPic); - wishIndex.setText((i + 1) + "/" + wishlist.size()); + wishIndex.setText(wishlist.get(i).getWishlistNumP()); wishListFlipper.addView(wish); } wishListFlipper.startFlipping(); @@ -1415,7 +1415,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private void setGuardIcon(LiveUserGiftBean guard) { if (guard != null) { - nowGuardUser=guard; + nowGuardUser = guard; ImgLoader.displayAvatar(mContext, guard.getAvatar(), userGuard); gift_svga.setVisibility(View.VISIBLE); } @@ -1494,7 +1494,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } else if (i == R.id.ft_hot_add) { ((LiveActivity) mContext).openHotListWindow(1); } else if (i == R.id.user_guard) { - // ((LiveActivity) mContext).openUserMoreListWindow(2, true); + // ((LiveActivity) mContext).openUserMoreListWindow(2, true); ((LiveActivity) mContext).openGuardListWindow(); } @@ -1775,7 +1775,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } room_hot.setText(formatBigNum.formatBigNum(bean.getLiveChatBean().getHot_num())); LiveUserGiftBean chatBean = bean.getUserBean(); - if(chatBean!=null&&nowGuardUser!=null) { + if (chatBean != null && nowGuardUser != null) { LiveUserGiftBean tmp = null; if (chatBean.getGuardType() != 0 && chatBean.getGuardType() > nowGuardUser.getGuardType()) { tmp = chatBean; @@ -1788,10 +1788,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis /** * 用户离开房间 + * * @param bean 用户 */ - public void onExitRoom(UserBean bean){ - // getGuardInfo(); + public void onExitRoom(UserBean bean) { + // getGuardInfo(); } /** 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 7ceb67d56..430a1f6c9 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -1259,7 +1259,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mEnd = true; //断开socket - if (mSocketRyClient != null) { + if (mSocketRyClient != null) { mSocketRyClient.disConnect(); } mSocketRyClient = null;