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