From aa809ebaf4c1b71517f6ed91bf210356d3de711c Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 10 Aug 2023 10:03:01 +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 --- .../main/java/com/yunbao/common/http/PDLiveApi.java | 6 ++++-- .../com/yunbao/common/http/live/LiveNetManager.java | 8 ++++---- .../com/yunbao/live/activity/GiftWallActivity.java | 2 +- .../java/com/yunbao/live/adapter/CodexAdapter.java | 7 ++++--- .../java/com/yunbao/live/dialog/CodexDialog.java | 13 +++++++------ .../java/com/yunbao/live/dialog/GiftWallDialog.java | 2 +- .../java/com/yunbao/live/dialog/LiveGiftPopup.java | 2 ++ .../java/com/yunbao/live/views/CodexViewHolder.java | 4 ++-- 8 files changed, 25 insertions(+), 19 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 a32b22392..078435eea 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -913,12 +913,14 @@ public interface PDLiveApi { */ @GET("/api/public/?service=Gift.getGiftGuide") Observable>> getGiftGuide( - @Query("liveuid") String liveUid + @Query("liveuid") String liveUid, + @Query("to_uid") String toUid ); @GET("/api/public/?service=Gift.getGiftGuideHistory") Observable>> getGiftGuideHistory( - @Query("liveuid") String liveUid + @Query("liveuid") String liveUid, + @Query("to_uid") String toUid ); @GET("/api/public/?service=Gift.getUserMedalList") 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 b628a359e..42ddb6305 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 @@ -1984,9 +1984,9 @@ public class LiveNetManager { }).isDisposed(); } - public void getGiftGuide(String liveUid, HttpCallback> callback) { + public void getGiftGuide(String liveUid,String toUid ,HttpCallback> callback) { API.get().pdLiveApi(mContext) - .getGiftGuide(liveUid) + .getGiftGuide(liveUid,toUid) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Consumer>>() { @@ -2006,9 +2006,9 @@ public class LiveNetManager { }).isDisposed(); } - public void getGiftGuideHistory(String liveUid, HttpCallback> callback) { + public void getGiftGuideHistory(String toUid,String liveUid, HttpCallback> callback) { API.get().pdLiveApi(mContext) - .getGiftGuideHistory(liveUid) + .getGiftGuideHistory(liveUid,toUid) .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 77e6028f5..fcddf7967 100644 --- a/live/src/main/java/com/yunbao/live/activity/GiftWallActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/GiftWallActivity.java @@ -118,7 +118,7 @@ public class GiftWallActivity extends AbsActivity { public void onViewClicks() { new XPopup.Builder(GiftWallActivity.this) .enableDrag(false) - .asCustom(new CodexDialog(GiftWallActivity.this, mStream, mLiveUid, isLive)) + .asCustom(new CodexDialog(GiftWallActivity.this, mStream, mLiveUid, mLiveUid,isLive)) .show(); } }); diff --git a/live/src/main/java/com/yunbao/live/adapter/CodexAdapter.java b/live/src/main/java/com/yunbao/live/adapter/CodexAdapter.java index 3c87cc947..f8554b4ba 100644 --- a/live/src/main/java/com/yunbao/live/adapter/CodexAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/CodexAdapter.java @@ -17,7 +17,7 @@ import java.util.List; public class CodexAdapter extends RecyclerView.Adapter { private List giftGuideModels = new ArrayList<>(); private boolean history; - private String mStream, mLiveUid; + private String mStream, mLiveUid,toUid; @NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { @@ -28,7 +28,7 @@ public class CodexAdapter extends RecyclerView.Adapter { @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { CodexViewHolder codexViewHolder = (CodexViewHolder) holder; - codexViewHolder.showData(giftGuideModels.get(position), history,mStream,mLiveUid); + codexViewHolder.showData(giftGuideModels.get(position), history,mStream,mLiveUid,toUid); } @Override @@ -36,10 +36,11 @@ public class CodexAdapter extends RecyclerView.Adapter { return giftGuideModels.size(); } - public void addAllData(List mGiftWall, boolean history, String mStream, String mLiveUid) { + public void addAllData(List mGiftWall, boolean history, String mStream, String mLiveUid, String toUid) { this.history = history; this.mStream = mStream; this.mLiveUid = mLiveUid; + this.toUid = toUid; giftGuideModels.clear(); giftGuideModels.addAll(mGiftWall); notifyDataSetChanged(); diff --git a/live/src/main/java/com/yunbao/live/dialog/CodexDialog.java b/live/src/main/java/com/yunbao/live/dialog/CodexDialog.java index a0e192154..e1dcb2c61 100644 --- a/live/src/main/java/com/yunbao/live/dialog/CodexDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/CodexDialog.java @@ -24,16 +24,17 @@ import org.greenrobot.eventbus.ThreadMode; import java.util.List; public class CodexDialog extends BottomPopupView { - private String mStream, mLiveUid; + private String mStream, mLiveUid, toUid; private RecyclerView liveCodex; private CodexAdapter codexAdapter; private boolean history; - public CodexDialog(@NonNull Context context, String mStream, String mLiveUid, boolean history) { + public CodexDialog(@NonNull Context context, String mStream, String mLiveUid, String toUid, boolean history) { super(context); this.mLiveUid = mLiveUid; this.mStream = mStream; this.history = history; + this.toUid = toUid; } // 返回自定义弹窗的布局 @@ -54,10 +55,10 @@ public class CodexDialog extends BottomPopupView { private void initDate() { if (history) { LiveNetManager.get(getContext()). - getGiftGuideHistory(mLiveUid, new HttpCallback>() { + getGiftGuideHistory(toUid,mLiveUid, new HttpCallback>() { @Override public void onSuccess(List data) { - codexAdapter.addAllData(data,history,mStream,mLiveUid); + codexAdapter.addAllData(data,history,mStream,mLiveUid,toUid); } @Override @@ -67,10 +68,10 @@ public class CodexDialog extends BottomPopupView { }); } else { LiveNetManager.get(getContext()). - getGiftGuide(mLiveUid, new HttpCallback>() { + getGiftGuide(mLiveUid, toUid,new HttpCallback>() { @Override public void onSuccess(List data) { - codexAdapter.addAllData(data,history,mStream,mLiveUid); + codexAdapter.addAllData(data,history,mStream,mLiveUid,toUid); } @Override 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 4dc1ded9b..0e5a1cea6 100644 --- a/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java @@ -115,7 +115,7 @@ public class GiftWallDialog extends AbsDialogFragment { public void onViewClicks() { new XPopup.Builder(getContext()) .enableDrag(false) - .asCustom(new CodexDialog(getContext(), mStream, mLiveUid, false)) + .asCustom(new CodexDialog(getContext(), mStream, mLiveUid, toUid,false)) .show(); } }); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index 43a59f7cf..7075cc511 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -690,11 +690,13 @@ public class LiveGiftPopup extends AbsDialogFragment { } if (liveGiftModel.getType() == 7) { + iconArrow.setVisibility(View.GONE); showBlindProgress(liveGiftModel.getBlind_box_type()); } else { blindBox.setVisibility(View.INVISIBLE); mCount = DEFAULT_COUNT; giftNumber.setText(mCount); + iconArrow.setVisibility(View.VISIBLE); } liveGiftSend.setEnabled(true); giftNumberLayout.setVisibility(View.VISIBLE); diff --git a/live/src/main/java/com/yunbao/live/views/CodexViewHolder.java b/live/src/main/java/com/yunbao/live/views/CodexViewHolder.java index cc5f42643..716bd8767 100644 --- a/live/src/main/java/com/yunbao/live/views/CodexViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/CodexViewHolder.java @@ -37,7 +37,7 @@ public class CodexViewHolder extends RecyclerView.ViewHolder { giftList.setAdapter(codexItemAdapter); } - public void showData(GiftGuideModel giftGuideModel, boolean history, String mStream, String mLiveUid) { + public void showData(GiftGuideModel giftGuideModel, boolean history, String mStream, String mLiveUid, String toUid) { StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append(giftGuideModel.getIlluminateCount()) .append("/") @@ -60,7 +60,7 @@ public class CodexViewHolder extends RecyclerView.ViewHolder { public void onViewClicks() { new XPopup.Builder(itemView.getContext()) .enableDrag(false) - .asCustom(new CodexDialog(itemView.getContext(), mStream, mLiveUid,true)) + .asCustom(new CodexDialog(itemView.getContext(), mStream, mLiveUid,toUid,true)) .show(); } });