6.5.4礼物冠名

This commit is contained in:
18401019693 2023-08-10 10:03:01 +08:00
parent dffa71e346
commit aa809ebaf4
8 changed files with 25 additions and 19 deletions

View File

@ -913,12 +913,14 @@ public interface PDLiveApi {
*/
@GET("/api/public/?service=Gift.getGiftGuide")
Observable<ResponseModel<List<GiftGuideModel>>> getGiftGuide(
@Query("liveuid") String liveUid
@Query("liveuid") String liveUid,
@Query("to_uid") String toUid
);
@GET("/api/public/?service=Gift.getGiftGuideHistory")
Observable<ResponseModel<List<GiftGuideModel>>> getGiftGuideHistory(
@Query("liveuid") String liveUid
@Query("liveuid") String liveUid,
@Query("to_uid") String toUid
);
@GET("/api/public/?service=Gift.getUserMedalList")

View File

@ -1984,9 +1984,9 @@ public class LiveNetManager {
}).isDisposed();
}
public void getGiftGuide(String liveUid, HttpCallback<List<GiftGuideModel>> callback) {
public void getGiftGuide(String liveUid,String toUid ,HttpCallback<List<GiftGuideModel>> callback) {
API.get().pdLiveApi(mContext)
.getGiftGuide(liveUid)
.getGiftGuide(liveUid,toUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<GiftGuideModel>>>() {
@ -2006,9 +2006,9 @@ public class LiveNetManager {
}).isDisposed();
}
public void getGiftGuideHistory(String liveUid, HttpCallback<List<GiftGuideModel>> callback) {
public void getGiftGuideHistory(String toUid,String liveUid, HttpCallback<List<GiftGuideModel>> callback) {
API.get().pdLiveApi(mContext)
.getGiftGuideHistory(liveUid)
.getGiftGuideHistory(liveUid,toUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<GiftGuideModel>>>() {

View File

@ -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();
}
});

View File

@ -17,7 +17,7 @@ import java.util.List;
public class CodexAdapter extends RecyclerView.Adapter {
private List<GiftGuideModel> 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<GiftGuideModel> mGiftWall, boolean history, String mStream, String mLiveUid) {
public void addAllData(List<GiftGuideModel> 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();

View File

@ -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<List<GiftGuideModel>>() {
getGiftGuideHistory(toUid,mLiveUid, new HttpCallback<List<GiftGuideModel>>() {
@Override
public void onSuccess(List<GiftGuideModel> 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<List<GiftGuideModel>>() {
getGiftGuide(mLiveUid, toUid,new HttpCallback<List<GiftGuideModel>>() {
@Override
public void onSuccess(List<GiftGuideModel> data) {
codexAdapter.addAllData(data,history,mStream,mLiveUid);
codexAdapter.addAllData(data,history,mStream,mLiveUid,toUid);
}
@Override

View File

@ -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();
}
});

View File

@ -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);

View File

@ -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();
}
});