From d5ca010ec7fe29a4e78bc9239e128beb2a1630ef Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 4 Aug 2023 13:57:36 +0800 Subject: [PATCH] =?UTF-8?q?6.5.4=E7=A4=BC=E7=89=A9=E5=86=A0=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/common/http/PDLiveApi.java | 2 +- .../yunbao/common/http/live/LiveNetManager.java | 5 +++-- .../com/yunbao/live/activity/GiftWallActivity.java | 2 +- .../yunbao/live/activity/LiveRyAnchorActivity.java | 14 +++++++++++++- .../com/yunbao/live/dialog/GiftWallDialog.java | 2 +- .../yunbao/live/dialog/MedalAchievementPopup.java | 7 ++++--- 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 1155d847c..4ba053a05 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -897,6 +897,6 @@ public interface PDLiveApi { Observable> getUserMedalList(@Query("to_uid") String toUid); @GET("/api/public/?service=Gift.getLiveMedalList") - Observable> getLiveMedalList(); + Observable> getLiveMedalList( @Query("liveuid") String liveUid); } diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 07c530e3b..da51979a1 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -63,6 +63,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; import io.reactivex.functions.Consumer; import io.reactivex.schedulers.Schedulers; +import retrofit2.http.Query; /** @@ -1977,9 +1978,9 @@ public class LiveNetManager { }).isDisposed(); } - public void getLiveMedalList(HttpCallback callback) { + public void getLiveMedalList( String liveUid,HttpCallback callback) { API.get().pdLiveApi(mContext) - .getLiveMedalList() + .getLiveMedalList(liveUid) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Consumer>() { diff --git a/live/src/main/java/com/yunbao/live/activity/GiftWallActivity.java b/live/src/main/java/com/yunbao/live/activity/GiftWallActivity.java index 1844987cd..7cf23cf24 100644 --- a/live/src/main/java/com/yunbao/live/activity/GiftWallActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/GiftWallActivity.java @@ -125,7 +125,7 @@ public class GiftWallActivity extends AbsActivity { public void onViewClicks() { new XPopup.Builder(GiftWallActivity.this) .enableDrag(false) - .asCustom(new MedalAchievementPopup(GiftWallActivity.this, false, mLiveUid)) + .asCustom(new MedalAchievementPopup(GiftWallActivity.this, false, mLiveUid,mLiveUid)) .show(); } }); diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index 701d796b2..59d2218aa 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -50,6 +50,7 @@ import com.yunbao.common.bean.LiveUserGiftBean; import com.yunbao.common.bean.MicUserBean; import com.yunbao.common.bean.UserBean; import com.yunbao.common.dialog.NotCancelableDialog; +import com.yunbao.common.event.GiftWallIlluminateEvent; import com.yunbao.common.event.LoginInvalidEvent; import com.yunbao.common.event.SendBlindGiftEvent; import com.yunbao.common.http.CommonHttpConsts; @@ -792,6 +793,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl mLiveRoomViewHolder.startAnchorLight(); //初始化女神说 mLiveRoomViewHolder.initAnchorSay(); + mLiveRoomViewHolder.setGiftWall(obj.getString("gift_wall_lighten_number"),obj.getString("gift_wall_lighten_total")); } if (mLiveAnchorViewHolder == null) { mLiveAnchorViewHolder = new LiveRyAnchorViewHolder(mContext, mContainer); @@ -1654,9 +1656,19 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl mLiveRoomViewHolder.blindBoxAllServerNotify(event.getAllServerNotifyEvent()); } break; + case GIFT_WALL: + if (mLiveRoomViewHolder != null) { + mLiveRoomViewHolder.showGiftWall(event.getUid()); + } + break; + } + } + @Subscribe(threadMode = ThreadMode.MAIN) + public void GiftWallIlluminateEvent(GiftWallIlluminateEvent event) { + if (mLiveRoomViewHolder != null) { + mLiveRoomViewHolder.setGiftWall(String.valueOf(event.getNewNumber()), String.valueOf(event.getMaxNumber())); } } - /** * 检查指定直播间连麦人数 * diff --git a/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java b/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java index 5f0db059c..a392848e1 100644 --- a/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java @@ -145,7 +145,7 @@ public class GiftWallDialog extends AbsDialogFragment { public void onViewClicks() { new XPopup.Builder(getContext()) .enableDrag(false) - .asCustom(new MedalAchievementPopup(getContext(), isLive, toUid)) + .asCustom(new MedalAchievementPopup(getContext(), isLive, toUid,mLiveUid)) .show(); } }); diff --git a/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java b/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java index e03216756..7d306ee5a 100644 --- a/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java @@ -22,15 +22,16 @@ import com.yunbao.live.activity.ZhuangBanActivity; public class MedalAchievementPopup extends BottomPopupView { private boolean isLive; - private String toUid; + private String toUid,mLiveUid; private TextView achievementText; private RecyclerView achievementList; private MedalAchievementAdapter medalAchievementAdapter; - public MedalAchievementPopup(@NonNull Context context, boolean isLive, String toUid) { + public MedalAchievementPopup(@NonNull Context context, boolean isLive, String toUid, String mLiveUid) { super(context); this.isLive = isLive; this.toUid = toUid; + this.mLiveUid = mLiveUid; } // 返回自定义弹窗的布局 @@ -50,7 +51,7 @@ public class MedalAchievementPopup extends BottomPopupView { private void initDate() { if (isLive) { LiveNetManager.get(getContext()) - .getLiveMedalList(new HttpCallback() { + .getLiveMedalList(mLiveUid,new HttpCallback() { @Override public void onSuccess(MedalAchievementModel data) { StringBuffer stringBuffer = new StringBuffer();