6.5.4礼物冠名
This commit is contained in:
parent
54a4c0b590
commit
43f95260e6
@ -5,7 +5,7 @@ ext {
|
||||
minSdkVersion : 21,
|
||||
targetSdkVersion : 31,
|
||||
versionCode : 436,
|
||||
versionName : "6.5.3"
|
||||
versionName : "6.5.4"
|
||||
]
|
||||
manifestPlaceholders = [
|
||||
//正式、
|
||||
|
@ -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, mLiveUid,isLive))
|
||||
.asCustom(new CodexDialog(GiftWallActivity.this, mStream, mLiveUid, mLiveUid,isLive,false))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
|
@ -16,7 +16,7 @@ import java.util.List;
|
||||
|
||||
public class CodexAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftGuideModel> giftGuideModels = new ArrayList<>();
|
||||
private boolean history;
|
||||
private boolean history,sbWy;
|
||||
private String mStream, mLiveUid,toUid;
|
||||
@NonNull
|
||||
@Override
|
||||
@ -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,toUid);
|
||||
codexViewHolder.showData(giftGuideModels.get(position), history,mStream,mLiveUid,toUid,sbWy);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -36,11 +36,12 @@ public class CodexAdapter extends RecyclerView.Adapter {
|
||||
return giftGuideModels.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<GiftGuideModel> mGiftWall, boolean history, String mStream, String mLiveUid, String toUid) {
|
||||
public void addAllData(List<GiftGuideModel> mGiftWall, boolean history, String mStream, String mLiveUid, String toUid, boolean sbWy) {
|
||||
this.history = history;
|
||||
this.mStream = mStream;
|
||||
this.mLiveUid = mLiveUid;
|
||||
this.toUid = toUid;
|
||||
this.sbWy = sbWy;
|
||||
giftGuideModels.clear();
|
||||
giftGuideModels.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
|
@ -16,6 +16,8 @@ import java.util.List;
|
||||
|
||||
public class CodexItemAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftWallModel> giftData = new ArrayList<>();
|
||||
private String toUid, mLiveUid;
|
||||
private boolean sbWy;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
@ -27,7 +29,7 @@ public class CodexItemAdapter extends RecyclerView.Adapter {
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
CodexItemViewHolder codexItemViewHolder = (CodexItemViewHolder) holder;
|
||||
codexItemViewHolder.showData(giftData.get(position));
|
||||
codexItemViewHolder.showData(giftData.get(position), toUid, mLiveUid, sbWy);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -35,7 +37,10 @@ public class CodexItemAdapter extends RecyclerView.Adapter {
|
||||
return giftData.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<GiftWallModel> mGiftWall) {
|
||||
public void addAllData(List<GiftWallModel> mGiftWall, String toUid, String mLiveUid, boolean sbWy) {
|
||||
this.toUid = toUid;
|
||||
this.mLiveUid = mLiveUid;
|
||||
this.sbWy = sbWy;
|
||||
giftData.clear();
|
||||
giftData.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
|
@ -27,14 +27,15 @@ public class CodexDialog extends BottomPopupView {
|
||||
private String mStream, mLiveUid, toUid;
|
||||
private RecyclerView liveCodex;
|
||||
private CodexAdapter codexAdapter;
|
||||
private boolean history;
|
||||
private boolean history,sbWy;
|
||||
|
||||
public CodexDialog(@NonNull Context context, String mStream, String mLiveUid, String toUid, boolean history) {
|
||||
public CodexDialog(@NonNull Context context, String mStream, String mLiveUid, String toUid, boolean history,boolean sbWy) {
|
||||
super(context);
|
||||
this.mLiveUid = mLiveUid;
|
||||
this.mStream = mStream;
|
||||
this.history = history;
|
||||
this.toUid = toUid;
|
||||
this.sbWy = sbWy;
|
||||
}
|
||||
|
||||
// 返回自定义弹窗的布局
|
||||
@ -58,7 +59,7 @@ public class CodexDialog extends BottomPopupView {
|
||||
getGiftGuideHistory(toUid,mLiveUid, new HttpCallback<List<GiftGuideModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<GiftGuideModel> data) {
|
||||
codexAdapter.addAllData(data,history,mStream,mLiveUid,toUid);
|
||||
codexAdapter.addAllData(data,history,mStream,mLiveUid,toUid,sbWy);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -71,7 +72,7 @@ public class CodexDialog extends BottomPopupView {
|
||||
getGiftGuide(mLiveUid, toUid,new HttpCallback<List<GiftGuideModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<GiftGuideModel> data) {
|
||||
codexAdapter.addAllData(data,history,mStream,mLiveUid,toUid);
|
||||
codexAdapter.addAllData(data,history,mStream,mLiveUid,toUid,sbWy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,7 +78,7 @@ public class GiftWallDialog extends AbsDialogFragment {
|
||||
ViewClicksAntiShake.clicksAntiShake(layoutLitIcon, () -> {
|
||||
selectTab(textLitIcon, viewLitIcon);
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, toUid, isLive,sbWy));
|
||||
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, toUid, isLive, sbWy));
|
||||
transaction.commit();
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(layoutUnlitIcon, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@ -115,7 +115,7 @@ public class GiftWallDialog extends AbsDialogFragment {
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.asCustom(new CodexDialog(getContext(), mStream, mLiveUid, toUid,false))
|
||||
.asCustom(new CodexDialog(getContext(), mStream, mLiveUid, toUid, false, sbWy))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
@ -161,7 +161,7 @@ public class GiftWallDialog extends AbsDialogFragment {
|
||||
isLive = bundle.getBoolean("isLive");
|
||||
sbWy = bundle.getBoolean("SBW");
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, toUid, isLive,sbWy));
|
||||
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, toUid, isLive, sbWy));
|
||||
transaction.commit();
|
||||
ImgLoader.display(getContext(), mAvatarUrl, avatar);
|
||||
anchorName.setText(mAnchorName);
|
||||
|
@ -13,10 +13,14 @@ import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallModel;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class CodexItemViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView giftImg;
|
||||
private TextView giftName, giftWall;
|
||||
@ -28,7 +32,7 @@ public class CodexItemViewHolder extends RecyclerView.ViewHolder {
|
||||
giftWall = itemView.findViewById(R.id.gift_wall);
|
||||
}
|
||||
|
||||
public void showData(GiftWallModel giftWallModel) {
|
||||
public void showData(GiftWallModel giftWallModel, String toUid, String mLiveUid, boolean sbWy) {
|
||||
ImgLoader.display(itemView.getContext(), giftWallModel.getGifticon(), giftImg);
|
||||
giftName.setText(giftWallModel.getGiftname());
|
||||
giftName.setTextColor(Color.parseColor(giftWallModel.getFontColor()));
|
||||
@ -39,12 +43,21 @@ public class CodexItemViewHolder extends RecyclerView.ViewHolder {
|
||||
ViewClicksAntiShake.clicksAntiShake(giftWall, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Bus.get().post(new LiveGiftDialogEvent());
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP)
|
||||
.setmWishGiftId(giftWallModel.getId())
|
||||
.setmLiveUid("")
|
||||
.setmStream(""));
|
||||
if (sbWy && TextUtils.equals(mLiveUid, toUid)) {
|
||||
Bus.get().post(new LiveGiftDialogEvent());
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP)
|
||||
.setmWishGiftId(giftWallModel.getId())
|
||||
.setmLiveUid("")
|
||||
.setmStream(""));
|
||||
} else {
|
||||
if (IMLoginManager.get(itemView.getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("當前用戶未開播時無法點亮哦~");
|
||||
} else {
|
||||
ToastUtil.show("It cannot be lit when the current user is not broadcasting~~");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -37,7 +37,7 @@ public class CodexViewHolder extends RecyclerView.ViewHolder {
|
||||
giftList.setAdapter(codexItemAdapter);
|
||||
}
|
||||
|
||||
public void showData(GiftGuideModel giftGuideModel, boolean history, String mStream, String mLiveUid, String toUid) {
|
||||
public void showData(GiftGuideModel giftGuideModel, boolean history, String mStream, String mLiveUid, String toUid, boolean sbWy) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(giftGuideModel.getIlluminateCount())
|
||||
.append("/")
|
||||
@ -54,13 +54,13 @@ public class CodexViewHolder extends RecyclerView.ViewHolder {
|
||||
weekNumber2.setVisibility(TextUtils.isEmpty(giftGuideModel.getWeekNumber()) ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
codexItemAdapter.addAllData(giftGuideModel.getGiftData());
|
||||
codexItemAdapter.addAllData(giftGuideModel.getGiftData(), toUid, mLiveUid, sbWy);
|
||||
ViewClicksAntiShake.clicksAntiShake(weekNumber2, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(itemView.getContext())
|
||||
.enableDrag(false)
|
||||
.asCustom(new CodexDialog(itemView.getContext(), mStream, mLiveUid,toUid,true))
|
||||
.asCustom(new CodexDialog(itemView.getContext(), mStream, mLiveUid, toUid, true, sbWy))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user