修复问题

This commit is contained in:
18401019693 2023-07-05 16:19:30 +08:00
parent 9089e96856
commit 003c7f9e12
6 changed files with 38 additions and 36 deletions

View File

@ -27,12 +27,14 @@ import com.yunbao.common.custom.MyRadioButton;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.GiftCacheUtil; import com.yunbao.common.utils.GiftCacheUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.custom.GiftMarkView; import com.yunbao.live.custom.GiftMarkView;
import com.yunbao.live.dialog.SendRendPacketPopup; import com.yunbao.live.dialog.SendRendPacketPopup;
import com.yunbao.live.event.LiveGiftDialogEvent;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
@ -244,8 +246,9 @@ public class LiveGiftAdapter extends RecyclerView.Adapter<LiveGiftAdapter.Vh> {
ViewClicksAntiShake.clicksAntiShake(mRadioButton, new ViewClicksAntiShake.ViewClicksCallBack() { ViewClicksAntiShake.clicksAntiShake(mRadioButton, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
public void onViewClicks() { public void onViewClicks() {
Bus.get().post(new LiveGiftDialogEvent());
new XPopup.Builder(mContext) new XPopup.Builder(mContext)
.asCustom(new SendRendPacketPopup(mContext,mLiveUid )) .asCustom(new SendRendPacketPopup(mContext, mLiveUid))
.show(); .show();
} }
}); });

View File

@ -41,7 +41,6 @@ import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.lxj.xpopup.XPopup;
import com.opensource.svgaplayer.SVGACallback; import com.opensource.svgaplayer.SVGACallback;
import com.opensource.svgaplayer.SVGADrawable; import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView; import com.opensource.svgaplayer.SVGAImageView;
@ -81,6 +80,7 @@ import com.yunbao.live.bean.GiftTopBean;
import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.custom.GiftViewPager; import com.yunbao.live.custom.GiftViewPager;
import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.event.LiveGiftDialogEvent;
import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpConsts;
import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.utils.ToolsButton; import com.yunbao.live.utils.ToolsButton;
@ -532,7 +532,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
} }
} }
mGiftList = list; mGiftList = list;
mLiveGiftPagerAdapter = new LiveGiftPagerAdapter(mContext, list,mLiveUid); mLiveGiftPagerAdapter = new LiveGiftPagerAdapter(mContext, list, mLiveUid);
mLiveGiftPagerAdapter.setActionListener(this); mLiveGiftPagerAdapter.setActionListener(this);
mViewPager.setAdapter(mLiveGiftPagerAdapter); mViewPager.setAdapter(mLiveGiftPagerAdapter);
@ -570,7 +570,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
private void showWrapList(List<LiveGiftBean> list) { private void showWrapList(List<LiveGiftBean> list) {
mWrapList = list; mWrapList = list;
mLiveWrapPagerAdapter = new LiveGiftPagerAdapter(mContext, list,mLiveUid); mLiveWrapPagerAdapter = new LiveGiftPagerAdapter(mContext, list, mLiveUid);
mLiveWrapPagerAdapter.setActionListener(this); mLiveWrapPagerAdapter.setActionListener(this);
mVPWrapList.setAdapter(mLiveWrapPagerAdapter); mVPWrapList.setAdapter(mLiveWrapPagerAdapter);
LayoutInflater inflater = LayoutInflater.from(mContext); LayoutInflater inflater = LayoutInflater.from(mContext);
@ -1110,6 +1110,11 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
} }
@Subscribe(threadMode = ThreadMode.MAIN)
public void onLiveGiftDialogEvent(LiveGiftDialogEvent event) {
dismiss();
}
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onSendBlindGiftEvent(SendBlindGiftEvent event) { public void onSendBlindGiftEvent(SendBlindGiftEvent event) {
if (!TextUtils.equals(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()), event.getUid())) if (!TextUtils.equals(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()), event.getUid()))

View File

@ -24,6 +24,7 @@ import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.TimeUtils; import com.yunbao.common.utils.TimeUtils;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.CircleProgress; import com.yunbao.common.views.weight.CircleProgress;
import com.yunbao.common.views.weight.ClipPathCircleImage; import com.yunbao.common.views.weight.ClipPathCircleImage;
import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.common.views.weight.ViewClicksAntiShake;
@ -165,13 +166,8 @@ public class ReceiveRendPacketPopup extends CenterPopupView {
@Override @Override
public void onError(String error) { public void onError(String error) {
dismiss(); ToastUtil.show(error);
new XPopup.Builder(getContext())
.asCustom(new ResultRendPacketPopup(getContext(),
true,
null,
isSuperJackpot))
.show();
} }
}); });
} else { } else {
@ -193,7 +189,7 @@ public class ReceiveRendPacketPopup extends CenterPopupView {
new XPopup.Builder(getContext()) new XPopup.Builder(getContext())
.asCustom(new ResultRendPacketPopup(getContext(), .asCustom(new ResultRendPacketPopup(getContext(),
true, true,
null, data.setRedPacketId(redPacketId),
isSuperJackpot)) isSuperJackpot))
.show(); .show();
} }
@ -202,13 +198,7 @@ public class ReceiveRendPacketPopup extends CenterPopupView {
@Override @Override
public void onError(String error) { public void onError(String error) {
dismiss(); ToastUtil.show(error);
new XPopup.Builder(getContext())
.asCustom(new ResultRendPacketPopup(getContext(),
true,
null,
isSuperJackpot))
.show();
} }
}); });
} }

View File

@ -101,13 +101,13 @@ public class ResultRendPacketPopup extends CenterPopupView {
new HttpCallback<List<RedPacketGiftModel>>() { new HttpCallback<List<RedPacketGiftModel>>() {
@Override @Override
public void onSuccess(List<RedPacketGiftModel> data) { public void onSuccess(List<RedPacketGiftModel> data) {
if (data.size() > 0) { // if (data.size() > 0) {
new XPopup.Builder(getContext()) new XPopup.Builder(getContext())
.asCustom(new LuckUserRedPacketPopup(getContext(), data)) .asCustom(new LuckUserRedPacketPopup(getContext(), data))
.show(); .show();
} else { // } else {
ToastUtil.show(R.string.no_data); // ToastUtil.show(R.string.no_data);
} // }
} }
@ -122,13 +122,13 @@ public class ResultRendPacketPopup extends CenterPopupView {
new HttpCallback<List<RedPacketGiftModel>>() { new HttpCallback<List<RedPacketGiftModel>>() {
@Override @Override
public void onSuccess(List<RedPacketGiftModel> data) { public void onSuccess(List<RedPacketGiftModel> data) {
if (data.size()>0){ // if (data.size() > 0) {
new XPopup.Builder(getContext()) new XPopup.Builder(getContext())
.asCustom(new LuckUserRedPacketPopup(getContext(), data)) .asCustom(new LuckUserRedPacketPopup(getContext(), data))
.show(); .show();
}else { // } else {
ToastUtil.show(R.string.no_data); // ToastUtil.show(R.string.no_data);
} // }
} }
@ -139,6 +139,8 @@ public class ResultRendPacketPopup extends CenterPopupView {
}); });
} }
} else {
ToastUtil.show(R.string.no_data);
} }
} }
}); });

View File

@ -0,0 +1,4 @@
package com.yunbao.live.event;
public class LiveGiftDialogEvent {
}

View File

@ -1393,11 +1393,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} else { } else {
timeHandler.removeCallbacks(timeRunnable); timeHandler.removeCallbacks(timeRunnable);
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(mRedPacketModel.getRedPacketCount()) stringBuffer.append(mRedPacketModel.getRedPacketRemain())
.append("/") .append("/")
.append(mRedPacketModel.getRedPacketQuantity()); .append(mRedPacketModel.getRedPacketQuantity());
redSchedule.setText(stringBuffer.toString()); redSchedule.setText(stringBuffer.toString());
openRedPacket.setText(String.format(mContext.getString(R.string.open_red_packet), mRedPacketModel.getRedPacketRemain() + "")); openRedPacket.setText(String.format(mContext.getString(R.string.open_red_packet), mRedPacketModel.getRedPacketCount() + ""));
redPacketCountdown.setVisibility(View.GONE); redPacketCountdown.setVisibility(View.GONE);
redPacketQueue.setVisibility(View.VISIBLE); redPacketQueue.setVisibility(View.VISIBLE);
} }
@ -1414,7 +1414,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mCountdown = mCountdown - 1; mCountdown = mCountdown - 1;
anchorTimeHandler.postDelayed(anchorTimeRunnable, 1000); anchorTimeHandler.postDelayed(anchorTimeRunnable, 1000);
Log.e("主播倒计时", String.format(mContext.getString(R.string.red_packet_countdown), TimeUtils.getTime(mCountdown))); Log.e("主播倒计时", String.format(mContext.getString(R.string.red_packet_countdown), TimeUtils.getTime(mCountdown)));
} else { } else {
redPacket.setVisibility(View.GONE); redPacket.setVisibility(View.GONE);
anchorTimeHandler.removeCallbacks(anchorTimeRunnable); anchorTimeHandler.removeCallbacks(anchorTimeRunnable);
LiveNetManager.get(mContext). LiveNetManager.get(mContext).
@ -1450,14 +1450,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
redPacketCountdown.setText(String.format(mContext.getString(R.string.red_packet_countdown), TimeUtils.getTime(redTimeCountdown))); redPacketCountdown.setText(String.format(mContext.getString(R.string.red_packet_countdown), TimeUtils.getTime(redTimeCountdown)));
timeHandler.post(timeRunnable); timeHandler.post(timeRunnable);
} else { } else {
redTimeCountdown = 0;
redPacketQueue.setVisibility(View.VISIBLE); redPacketQueue.setVisibility(View.VISIBLE);
redPacketCountdown.setVisibility(View.GONE); redPacketCountdown.setVisibility(View.GONE);
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(mRedPacketModel.getRedPacketCount()) stringBuffer.append(mRedPacketModel.getRedPacketRemain())
.append("/") .append("/")
.append(mRedPacketModel.getRedPacketQuantity()); .append(mRedPacketModel.getRedPacketQuantity());
redSchedule.setText(stringBuffer.toString()); redSchedule.setText(stringBuffer.toString());
openRedPacket.setText(String.format(mContext.getString(R.string.open_red_packet), mRedPacketModel.getRedPacketRemain() + "")); openRedPacket.setText(String.format(mContext.getString(R.string.open_red_packet), mRedPacketModel.getRedPacketCount() + ""));
} }
if (IMLoginManager.get(mContext).getUserInfo().anchorUserType() && mContext instanceof LiveRyAnchorActivity) { if (IMLoginManager.get(mContext).getUserInfo().anchorUserType() && mContext instanceof LiveRyAnchorActivity) {
anchorTimeHandler.removeCallbacks(anchorTimeRunnable); anchorTimeHandler.removeCallbacks(anchorTimeRunnable);
@ -1482,7 +1483,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.show(); .show();
} else if (TextUtils.equals(data.getReceiveStatus(), "1")) { } else if (TextUtils.equals(data.getReceiveStatus(), "1")) {
new XPopup.Builder(mContext) new XPopup.Builder(mContext)
.asCustom(new ResultRendPacketPopup(mContext, true, null, false)) .asCustom(new ResultRendPacketPopup(mContext, true, data.setRedPacketId(redPacketModel.getRedPacketId()), false))
.show(); .show();
} else { } else {
new XPopup.Builder(mContext) new XPopup.Builder(mContext)
@ -1494,9 +1495,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
@Override @Override
public void onError(String error) { public void onError(String error) {
ToastUtil.show(error); ToastUtil.show(error);
new XPopup.Builder(mContext)
.asCustom(new ResultRendPacketPopup(mContext, true, null, false))
.show();
} }
}); });
} }