2025-08-26 19:34:44 +08:00
|
|
|
|
package com.xscm.moduleutil.adapter;
|
|
|
|
|
|
|
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
|
import android.view.View;
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.blankj.utilcode.util.ToastUtils;
|
|
|
|
|
|
import com.xscm.moduleutil.R;
|
|
|
|
|
|
import com.xscm.moduleutil.base.BaseMvpFragment;
|
|
|
|
|
|
import com.xscm.moduleutil.bean.GiftLabelBean;
|
|
|
|
|
|
import com.xscm.moduleutil.bean.GiftPackBean;
|
2025-09-16 00:56:58 +08:00
|
|
|
|
import com.xscm.moduleutil.bean.GiftPackListCount;
|
2025-08-26 19:34:44 +08:00
|
|
|
|
import com.xscm.moduleutil.bean.RewardUserBean;
|
|
|
|
|
|
import com.xscm.moduleutil.bean.RoonGiftModel;
|
|
|
|
|
|
import com.xscm.moduleutil.bean.WalletBean;
|
|
|
|
|
|
import com.xscm.moduleutil.bean.room.RoomAuction;
|
|
|
|
|
|
import com.xscm.moduleutil.databinding.RoomVpGiftBinding;
|
|
|
|
|
|
import com.xscm.moduleutil.event.GiftDoubleClickEvent;
|
|
|
|
|
|
import com.xscm.moduleutil.event.GiftUserRefreshEvent;
|
|
|
|
|
|
import com.xscm.moduleutil.event.RoomGiftClickEvent;
|
|
|
|
|
|
import com.xscm.moduleutil.event.RoomGiftClickToEvent;
|
|
|
|
|
|
import com.xscm.moduleutil.event.RoomGiftPackToEvent;
|
|
|
|
|
|
import com.xscm.moduleutil.presenter.RewardGiftContacts;
|
|
|
|
|
|
import com.xscm.moduleutil.presenter.RewardGiftPresenter;
|
|
|
|
|
|
|
|
|
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
|
|
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
|
|
|
|
import org.greenrobot.eventbus.ThreadMode;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter, RoomVpGiftBinding> implements RewardGiftContacts.View {
|
|
|
|
|
|
private String id;
|
|
|
|
|
|
private GiftTwoAdapter mAdapter;
|
|
|
|
|
|
private GiftRoomAdapter roomAdapter;
|
|
|
|
|
|
private GiftPackAdapter packAdapter;
|
|
|
|
|
|
private String tag;
|
|
|
|
|
|
private int pageSize = 100;//一页显示的礼物个数
|
|
|
|
|
|
private int pageCount;//页数
|
|
|
|
|
|
private int type;//1:房间点击进入的;2:打赏进入的
|
2025-09-06 14:19:23 +08:00
|
|
|
|
private List<RoonGiftModel> giftList = new ArrayList<>();
|
|
|
|
|
|
private List<GiftPackBean> giftPackList = new ArrayList<>();
|
2025-08-29 19:42:03 +08:00
|
|
|
|
private String roomId;
|
2025-09-09 19:18:06 +08:00
|
|
|
|
private String bdgiftId;
|
2025-08-26 19:34:44 +08:00
|
|
|
|
|
2025-09-06 14:19:23 +08:00
|
|
|
|
public static GiftTwoDetailsFragment newInstance(String id, int type, String roomId) {
|
2025-08-26 19:34:44 +08:00
|
|
|
|
|
|
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
|
|
args.putString("id", id);
|
|
|
|
|
|
args.putInt("type", type);
|
2025-08-29 19:42:03 +08:00
|
|
|
|
args.putString("roomId", roomId);
|
2025-08-26 19:34:44 +08:00
|
|
|
|
GiftTwoDetailsFragment fragment = new GiftTwoDetailsFragment();
|
|
|
|
|
|
fragment.setArguments(args);
|
|
|
|
|
|
return fragment;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void initArgs(Bundle arguments) {
|
|
|
|
|
|
super.initArgs(arguments);
|
|
|
|
|
|
id = arguments.getString("id");
|
|
|
|
|
|
type = arguments.getInt("type");
|
2025-08-29 19:42:03 +08:00
|
|
|
|
roomId = arguments.getString("roomId");
|
2025-08-26 19:34:44 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
2025-09-06 14:19:23 +08:00
|
|
|
|
|
2025-08-26 19:34:44 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
|
|
|
|
|
super.onViewCreated(view, savedInstanceState);
|
|
|
|
|
|
EventBus.getDefault().register(this);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected RewardGiftPresenter bindPresenter() {
|
|
|
|
|
|
return new RewardGiftPresenter(this, getActivity());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-06 14:19:23 +08:00
|
|
|
|
public void loadDataIfNeeded(String id, int type, String roomId) {
|
|
|
|
|
|
if (id.equals("0")) {
|
|
|
|
|
|
MvpPre.giftPack();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (type == 0) {
|
|
|
|
|
|
MvpPre.getGiftList("0", type, roomId);
|
|
|
|
|
|
} else {
|
2025-09-16 00:56:58 +08:00
|
|
|
|
if (id == null) {
|
|
|
|
|
|
id = "0";
|
2025-09-06 14:19:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
MvpPre.getGiftList(id, type, roomId);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-09 19:18:06 +08:00
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
2025-09-16 00:56:58 +08:00
|
|
|
|
public void onString(String giftId) {
|
|
|
|
|
|
bdgiftId = giftId;
|
2025-09-09 19:18:06 +08:00
|
|
|
|
MvpPre.giftPack();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-26 19:34:44 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
protected void initData() {
|
2025-09-16 00:56:58 +08:00
|
|
|
|
// if (id.equals("0")) {
|
|
|
|
|
|
// MvpPre.giftPack();
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// if (type == 0) {
|
|
|
|
|
|
// MvpPre.getGiftList("0", type, roomId);
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// MvpPre.getGiftList(id, type, roomId);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// }
|
2025-08-26 19:34:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected void initView() {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected int getLayoutId() {
|
|
|
|
|
|
return R.layout.room_vp_gift;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public RoonGiftModel getGiftList() {
|
|
|
|
|
|
if (giftList != null) {
|
|
|
|
|
|
for (RoonGiftModel item : giftList) {
|
|
|
|
|
|
if (item.isChecked()) {
|
|
|
|
|
|
return item;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public GiftPackBean mGiftList() {
|
|
|
|
|
|
if (giftPackList != null) {
|
|
|
|
|
|
for (GiftPackBean item : giftPackList) {
|
|
|
|
|
|
if (item.isChecked()) {
|
|
|
|
|
|
return item;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
2025-09-06 14:19:23 +08:00
|
|
|
|
|
2025-08-26 19:34:44 +08:00
|
|
|
|
@Override
|
2025-09-06 14:19:23 +08:00
|
|
|
|
public void setGiftList(List<RoonGiftModel> data, int type) {
|
|
|
|
|
|
giftList = new ArrayList<>();
|
|
|
|
|
|
giftList.addAll(data);
|
|
|
|
|
|
pageCount = (int) Math.ceil(data.size() * 1.0 / pageSize);
|
|
|
|
|
|
|
|
|
|
|
|
// 只需要创建一次Adapter并设置,循环设置没有意义
|
|
|
|
|
|
if (pageCount > 0) {
|
|
|
|
|
|
roomAdapter = new GiftRoomAdapter(getActivity(), data, 0, "0");
|
|
|
|
|
|
mBinding.rvGift.setAdapter(roomAdapter);
|
2025-08-26 19:34:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-06 14:19:23 +08:00
|
|
|
|
|
2025-08-26 19:34:44 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public void giveGift() {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void wallet(WalletBean walletBean) {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void reward_zone() {
|
|
|
|
|
|
ToastUtils.showShort("打赏成功");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void roomAuctionJoin(RoomAuction.AuctionListBean auctionListBean) {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void giftPack(List<GiftPackBean> giftPackBean) {
|
2025-09-06 14:19:23 +08:00
|
|
|
|
giftPackList = new ArrayList<>();
|
2025-09-09 19:18:06 +08:00
|
|
|
|
|
2025-09-16 00:56:58 +08:00
|
|
|
|
if (giftPackBean != null && giftPackBean.size() > 0) {
|
2025-09-09 19:18:06 +08:00
|
|
|
|
|
2025-09-16 00:56:58 +08:00
|
|
|
|
if (bdgiftId != null) {
|
|
|
|
|
|
for (GiftPackBean item : giftPackBean) {
|
|
|
|
|
|
if (item.getGift_id().equals(bdgiftId)) {
|
|
|
|
|
|
item.setChecked(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
giftPackList.addAll(giftPackBean);
|
|
|
|
|
|
pageCount = (int) Math.ceil(giftPackBean.size() * 1.0 / pageSize);
|
|
|
|
|
|
for (int j = 0; j < pageCount; j++) {
|
2025-08-26 19:34:44 +08:00
|
|
|
|
// mAdapter = new GiftTwoAdapter(getActivity(), data, j, "0");
|
|
|
|
|
|
// mBinding.rvGift.setAdapter(mAdapter);
|
2025-09-16 00:56:58 +08:00
|
|
|
|
packAdapter = new GiftPackAdapter(getActivity(), giftPackBean, j, "0");
|
|
|
|
|
|
mBinding.rvGift.setAdapter(packAdapter);
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
giftPackBean = new ArrayList<>();
|
|
|
|
|
|
pageCount = (int) Math.ceil(giftPackBean.size() * 1.0 / pageSize);
|
|
|
|
|
|
packAdapter = new GiftPackAdapter(getActivity(), giftPackBean, 0, "0");
|
2025-08-26 19:34:44 +08:00
|
|
|
|
mBinding.rvGift.setAdapter(packAdapter);
|
|
|
|
|
|
}
|
2025-09-16 00:56:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-08-26 19:34:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-09 19:18:06 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public void getGiftPack(String s) {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-16 00:56:58 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public void getGiftPackListCount(GiftPackListCount giftPackListCount) {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-26 19:34:44 +08:00
|
|
|
|
@Override
|
|
|
|
|
|
public void getRewardList(List<RewardUserBean> rewardUserBeanList) {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void getGiftLabel(List<GiftLabelBean> giftLabelBeans) {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
|
|
|
|
public void onGiftClicRoomkEvent(RoomGiftClickEvent event) {
|
2025-09-06 14:19:23 +08:00
|
|
|
|
if (giftList == null) {
|
2025-08-26 19:34:44 +08:00
|
|
|
|
giftList = new ArrayList<>();
|
|
|
|
|
|
giftList.add(event.gift);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (event.type == 1) {
|
|
|
|
|
|
String id = event.gift.getGift_id();
|
|
|
|
|
|
for (int i = 0; i < giftList.size(); i++) {
|
|
|
|
|
|
RoonGiftModel giftModel = giftList.get(i);
|
|
|
|
|
|
if (giftModel.getGift_id().equals(id)) {
|
|
|
|
|
|
if (!giftModel.isChecked()) {
|
2025-09-06 14:19:23 +08:00
|
|
|
|
EventBus.getDefault().post(new GiftUserRefreshEvent(giftModel.isCan_send_self(), event.type, event.gift));
|
2025-08-26 19:34:44 +08:00
|
|
|
|
giftModel.setChecked(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
giftModel.setChecked(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (event.adapter != null && event.adapter.get() != null) {
|
|
|
|
|
|
event.adapter.get().notifyDataSetChanged();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (event.type == 2) {
|
|
|
|
|
|
String id = event.gift.getGift_id();
|
|
|
|
|
|
RoonGiftModel selGift = null;
|
|
|
|
|
|
for (int i = 0; i < giftList.size(); i++) {
|
|
|
|
|
|
RoonGiftModel giftModel = giftList.get(i);
|
|
|
|
|
|
if (giftModel.getGift_id().equals(id)) {
|
|
|
|
|
|
selGift = giftModel;
|
|
|
|
|
|
if (!giftModel.isChecked()) {
|
2025-09-06 14:19:23 +08:00
|
|
|
|
EventBus.getDefault().post(new GiftUserRefreshEvent(giftModel.isCan_send_self(), event.type, event.gift));
|
2025-08-26 19:34:44 +08:00
|
|
|
|
giftModel.setChecked(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
giftModel.setChecked(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (event.adapter != null && event.adapter.get() != null) {
|
|
|
|
|
|
event.adapter.get().notifyDataSetChanged();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (selGift != null) {
|
|
|
|
|
|
EventBus.getDefault().post(new GiftDoubleClickEvent());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
|
|
|
|
public void onGiftClicPackEvent(RoomGiftPackToEvent event) {
|
|
|
|
|
|
if (giftPackList == null) {
|
|
|
|
|
|
giftPackList = new ArrayList<>();
|
|
|
|
|
|
giftPackList.add(event.gift);
|
|
|
|
|
|
}
|
2025-09-06 14:19:23 +08:00
|
|
|
|
if (event.type == 1) {
|
2025-08-26 19:34:44 +08:00
|
|
|
|
String id = event.gift.getGift_id();
|
|
|
|
|
|
for (int i = 0; i < giftPackList.size(); i++) {
|
|
|
|
|
|
GiftPackBean giftModel = giftPackList.get(i);
|
|
|
|
|
|
RoonGiftModel roonGiftModel = new RoonGiftModel();
|
|
|
|
|
|
roonGiftModel.setGift_id(giftModel.getGift_id());
|
|
|
|
|
|
roonGiftModel.setGift_name(giftModel.getGift_name());
|
|
|
|
|
|
roonGiftModel.setGift_price(giftModel.getGift_price());
|
|
|
|
|
|
roonGiftModel.setBase_image(giftModel.getBase_image());
|
|
|
|
|
|
roonGiftModel.setNum(Integer.parseInt(giftModel.getNum()));
|
|
|
|
|
|
if (giftModel.getGift_id().equals(id)) {
|
|
|
|
|
|
if (!giftModel.isChecked()) {
|
2025-09-06 14:19:23 +08:00
|
|
|
|
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type, roonGiftModel));
|
2025-08-26 19:34:44 +08:00
|
|
|
|
giftModel.setChecked(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
giftModel.setChecked(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (event.adapter != null && event.adapter.get() != null) {
|
|
|
|
|
|
event.adapter.get().notifyDataSetChanged();
|
|
|
|
|
|
}
|
2025-09-06 14:19:23 +08:00
|
|
|
|
} else {
|
2025-08-26 19:34:44 +08:00
|
|
|
|
String id = event.gift.getGift_id();
|
|
|
|
|
|
GiftPackBean selGift = null;
|
|
|
|
|
|
for (int i = 0; i < giftPackList.size(); i++) {
|
|
|
|
|
|
GiftPackBean giftModel = giftPackList.get(i);
|
|
|
|
|
|
RoonGiftModel roonGiftModel = new RoonGiftModel();
|
|
|
|
|
|
roonGiftModel.setGift_id(giftModel.getGift_id());
|
|
|
|
|
|
roonGiftModel.setGift_name(giftModel.getGift_name());
|
|
|
|
|
|
roonGiftModel.setGift_price(giftModel.getGift_price());
|
|
|
|
|
|
roonGiftModel.setBase_image(giftModel.getBase_image());
|
|
|
|
|
|
roonGiftModel.setNum(Integer.parseInt(giftModel.getNum()));
|
|
|
|
|
|
if (giftModel.getGift_id().equals(id)) {
|
|
|
|
|
|
selGift = giftModel;
|
|
|
|
|
|
if (!giftModel.isChecked()) {
|
2025-09-06 14:19:23 +08:00
|
|
|
|
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type, roonGiftModel));
|
2025-08-26 19:34:44 +08:00
|
|
|
|
giftModel.setChecked(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
giftModel.setChecked(false);
|
2025-09-06 14:19:23 +08:00
|
|
|
|
EventBus.getDefault().post(new GiftUserRefreshEvent(false, event.type, null));
|
2025-08-26 19:34:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (event.adapter != null && event.adapter.get() != null) {
|
|
|
|
|
|
event.adapter.get().notifyDataSetChanged();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (selGift != null) {
|
|
|
|
|
|
EventBus.getDefault().post(new GiftDoubleClickEvent());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
|
|
|
|
public void onGiftClicRoomkTEvent(RoomGiftClickToEvent event) {
|
2025-09-06 14:19:23 +08:00
|
|
|
|
if (giftList == null) {
|
2025-08-26 19:34:44 +08:00
|
|
|
|
giftList = new ArrayList<>();
|
|
|
|
|
|
giftList.add(event.gift);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (event.type == 1) {
|
|
|
|
|
|
String id = event.gift.getGift_id();
|
|
|
|
|
|
for (int i = 0; i < giftList.size(); i++) {
|
|
|
|
|
|
RoonGiftModel giftModel = giftList.get(i);
|
|
|
|
|
|
if (giftModel.getGift_id().equals(id)) {
|
|
|
|
|
|
if (giftModel.isChecked()) {
|
|
|
|
|
|
giftModel.setChecked(false);
|
2025-09-06 14:19:23 +08:00
|
|
|
|
EventBus.getDefault().post(new GiftUserRefreshEvent(false, event.type, null));
|
|
|
|
|
|
} else {
|
2025-08-26 19:34:44 +08:00
|
|
|
|
giftModel.setChecked(true);
|
2025-09-06 14:19:23 +08:00
|
|
|
|
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type, event.gift));
|
2025-08-26 19:34:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
giftModel.setChecked(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (event.adapter != null && event.adapter.get() != null) {
|
|
|
|
|
|
event.adapter.get().notifyDataSetChanged();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (event.type == 2) {
|
|
|
|
|
|
String id = event.gift.getGift_id();
|
|
|
|
|
|
RoonGiftModel selGift = null;
|
|
|
|
|
|
for (int i = 0; i < giftList.size(); i++) {
|
|
|
|
|
|
RoonGiftModel giftModel = giftList.get(i);
|
|
|
|
|
|
if (giftModel.getGift_id().equals(id)) {
|
|
|
|
|
|
selGift = giftModel;
|
|
|
|
|
|
if (giftModel.isChecked()) {
|
|
|
|
|
|
giftModel.setChecked(false);
|
2025-09-06 14:19:23 +08:00
|
|
|
|
EventBus.getDefault().post(new GiftUserRefreshEvent(false, event.type, null));
|
|
|
|
|
|
} else {
|
2025-08-26 19:34:44 +08:00
|
|
|
|
giftModel.setChecked(true);
|
2025-09-06 14:19:23 +08:00
|
|
|
|
EventBus.getDefault().post(new GiftUserRefreshEvent(giftModel.isCan_send_self(), event.type, event.gift));
|
2025-08-26 19:34:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
giftModel.setChecked(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (event.adapter != null && event.adapter.get() != null) {
|
|
|
|
|
|
event.adapter.get().notifyDataSetChanged();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (selGift != null) {
|
|
|
|
|
|
EventBus.getDefault().post(new GiftDoubleClickEvent());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|