广场 逻辑优化补全
This commit is contained in:
@@ -3,7 +3,6 @@ package com.xscm.moduleutil;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
public class BaseEvent {
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static com.blankj.utilcode.util.ActivityUtils.startActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextPaint;
|
||||
@@ -43,14 +44,15 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
super(R.layout.item_cirle_list);
|
||||
this.mPageType = pageType;
|
||||
}
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onDianzanClick(CircleListBean item);
|
||||
void onDianzanClick(int index,CircleListBean item);
|
||||
|
||||
void onHeadImageClick(CircleListBean item);
|
||||
|
||||
void onZsClick(CircleListBean item);
|
||||
void onZsClick(int idx,CircleListBean item);
|
||||
|
||||
void onDiandianClick(CircleListBean item);
|
||||
void onMoreClick(int idx,CircleListBean item);
|
||||
|
||||
void onPinglunClick(CircleListBean item);
|
||||
|
||||
@@ -65,6 +67,46 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
|
||||
public static final String PAYLOAD_LIKE = "like";
|
||||
|
||||
public void updateLikeStatusOnly(int position, int isLike) {
|
||||
notifyItemChanged(position, PAYLOAD_LIKE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void convertPayloads(@NonNull BaseViewHolder helper, CircleListBean item, @NonNull List<Object> payloads) {
|
||||
super.convertPayloads(helper, item, payloads);
|
||||
if (payloads.isEmpty()) {
|
||||
convert(helper, item);
|
||||
} else {
|
||||
Object payload = payloads.get(0);
|
||||
if (payload instanceof Bundle) {
|
||||
Bundle diff = (Bundle) payload;
|
||||
if (diff.containsKey("like_num")) {
|
||||
helper.setText(R.id.dy_fabulous, diff.getString("like_num"));
|
||||
if (diff.containsKey("is_like")){
|
||||
if (diff.getInt("is_like") == 1) {
|
||||
helper.setImageResource(R.id.dianzan_image, R.mipmap.dongtai_hudong_yidianzan);
|
||||
} else {
|
||||
helper.setImageResource(R.id.dianzan_image, com.xscm.moduleutil.R.mipmap.dongtai_hudong_dianzan);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (diff.containsKey("comment_num")) {
|
||||
helper.setText(R.id.dy_comment, diff.getString("comment_num"));
|
||||
}
|
||||
if (diff.containsKey("rewards_num")) {
|
||||
double rewardNum = diff.getString("rewards_num") != null ? Double.parseDouble(item.getRewards_num()) : 0;
|
||||
helper.setText(R.id.dy_zs, NumberFormatUtils.formatRewardNumber(rewardNum));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, CircleListBean item) {
|
||||
helper.addOnClickListener(com.xscm.moduleutil.R.id.dianzan)
|
||||
@@ -89,8 +131,8 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
|
||||
// 设置点击回调
|
||||
helper.getView(com.xscm.moduleutil.R.id.dianzan).setOnClickListener(v -> {
|
||||
if (mListener != null){
|
||||
mListener.onDianzanClick(item);
|
||||
if (mListener != null) {
|
||||
mListener.onDianzanClick(helper.getPosition(),item);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -99,11 +141,11 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
});
|
||||
|
||||
helper.getView(com.xscm.moduleutil.R.id.zs).setOnClickListener(v -> {
|
||||
if (mListener != null) mListener.onZsClick(item);
|
||||
if (mListener != null) mListener.onZsClick(helper.getPosition(),item);
|
||||
});
|
||||
|
||||
helper.getView(R.id.diandian).setOnClickListener(v -> {
|
||||
if (mListener != null) mListener.onDiandianClick(item);
|
||||
if (mListener != null) mListener.onMoreClick(helper.getPosition(),item);
|
||||
});
|
||||
|
||||
helper.getView(R.id.pinglun).setOnClickListener(v -> {
|
||||
@@ -163,7 +205,7 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
TextView view = helper.getView(R.id.dy_content_tv);
|
||||
view.setVisibility(VISIBLE);
|
||||
}
|
||||
// 创建 SpannableString 来拼接 title 并设置点击事件
|
||||
// 创建 SpannableString 来拼接 title 并设置点击事件
|
||||
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
|
||||
spannableStringBuilder.append(content).append(" "); // 添加原始内容
|
||||
if (item.getTitle() != null) {
|
||||
@@ -206,27 +248,25 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
|
||||
if (item.getIs_like() == 1) {
|
||||
helper.setImageResource(R.id.dianzan_image, R.mipmap.dongtai_hudong_yidianzan);
|
||||
// helper.setText(R.id.dy_fabulous, String.valueOf(Integer.parseInt(item.getLike_num()) + 1));
|
||||
} else {
|
||||
helper.setImageResource(R.id.dianzan_image, com.xscm.moduleutil.R.mipmap.dongtai_hudong_dianzan);
|
||||
// helper.setText(R.id.dy_fabulous, item.getLike_num());
|
||||
}
|
||||
|
||||
helper.setText(R.id.dy_fabulous, item.getLike_num());
|
||||
|
||||
if (mPageType==PAGE_SEARCH){
|
||||
if (mPageType == PAGE_SEARCH) {
|
||||
helper.setVisible(R.id.gensui, false);
|
||||
}else {
|
||||
if (item.getUser_id()==SpUtil.getUserId()){
|
||||
} else {
|
||||
if (item.getUser_id() == SpUtil.getUserId()) {
|
||||
helper.setVisible(R.id.gensui, false);
|
||||
}else {
|
||||
} else {
|
||||
helper.setVisible(R.id.gensui, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (item.getRoom_id() != null && !item.getRoom_id().equals("0")) {
|
||||
helper.setText(R.id.gensui, "跟随");
|
||||
} else if (item.getRoom_id() == null || item.getRoom_id().equals("0")){
|
||||
} else if (item.getRoom_id() == null || item.getRoom_id().equals("0")) {
|
||||
helper.setText(R.id.gensui, "私信");
|
||||
}
|
||||
//分享数
|
||||
@@ -251,7 +291,6 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
String[] arrIv = item.getImages().split(",");
|
||||
OneImageYuanJiaoAdapter oneImageYuanJiaoAdapter = new OneImageYuanJiaoAdapter(mContext);
|
||||
MyGridView recyclerView = helper.getView(R.id.dy_image_recyc);
|
||||
recyclerView.setNumColumns(3);
|
||||
recyclerView.setAdapter(oneImageYuanJiaoAdapter);
|
||||
oneImageYuanJiaoAdapter.getList_adapter().clear();
|
||||
|
||||
@@ -262,51 +301,25 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
|
||||
recyclerView.setOnItemClickListener((parent, view, position, id) -> {
|
||||
FullScreenUtil.showFullScreenDialog(mContext, position, oneImageYuanJiaoAdapter.getList_adapter());
|
||||
});
|
||||
}else {
|
||||
} else {
|
||||
helper.getView(R.id.dy_image_recyc).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (item.getLike_list() == null){
|
||||
if (item.getLike_list() == null) {
|
||||
helper.getView(R.id.rela).setVisibility(GONE);
|
||||
helper.getView(R.id.view).setVisibility(VISIBLE);
|
||||
}else {
|
||||
} else {
|
||||
helper.getView(R.id.rela).setVisibility(VISIBLE);
|
||||
helper.getView(R.id.view).setVisibility(GONE);
|
||||
RecyclerView recyclerView= helper.getView(R.id.recycle_view);
|
||||
RecyclerView recyclerView = helper.getView(R.id.recycle_view);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||
LikeUserAdapter<CircleListBean.LikeList> likeUserAdapter = new LikeUserAdapter<>();
|
||||
recyclerView.setAdapter(likeUserAdapter);
|
||||
likeUserAdapter.setNewData(item.getLike_list());
|
||||
helper.setText(R.id.pinglun_tv, item.getLike_num()+"人点赞");
|
||||
helper.setText(R.id.pinglun_tv, item.getLike_num() + "人点赞");
|
||||
}
|
||||
|
||||
}
|
||||
public static final String PAYLOAD_LIKE = "like";
|
||||
|
||||
public void updateLikeStatusOnly(int position, int isLike) {
|
||||
notifyItemChanged(position, PAYLOAD_LIKE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull BaseViewHolder holder, int position, @NonNull List<Object> payloads) {
|
||||
if (payloads.isEmpty()) {
|
||||
onBindViewHolder(holder, position); // 全量绑定
|
||||
} else {
|
||||
for (Object payload : payloads) {
|
||||
if (payload.equals(PAYLOAD_LIKE)) {
|
||||
CircleListBean item = getData().get(position);
|
||||
if (item.getIs_like() == 1) {
|
||||
holder.setImageResource(R.id.dianzan_image, R.mipmap.dongtai_hudong_yidianzan);
|
||||
holder.setText(R.id.dy_fabulous, String.valueOf(Integer.parseInt(item.getLike_num()) + 1));
|
||||
} else {
|
||||
holder.setImageResource(R.id.dianzan_image, com.xscm.moduleutil.R.mipmap.dongtai_hudong_dianzan);
|
||||
holder.setText(R.id.dy_fabulous, item.getLike_num());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -109,16 +109,6 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
||||
if (type==0){
|
||||
MvpPre.getGiftList("0", type, roomId);
|
||||
}
|
||||
// if (id.equals("0")) {
|
||||
// MvpPre.giftPack();
|
||||
// } else {
|
||||
// if (type == 0) {
|
||||
// MvpPre.getGiftList("0", type, roomId);
|
||||
// } else {
|
||||
// MvpPre.getGiftList(id, type, roomId);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -207,8 +197,6 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
||||
giftPackList.addAll(giftPackBean);
|
||||
pageCount = (int) Math.ceil(giftPackBean.size() * 1.0 / pageSize);
|
||||
for (int j = 0; j < pageCount; j++) {
|
||||
// mAdapter = new GiftTwoAdapter(getActivity(), data, j, "0");
|
||||
// mBinding.rvGift.setAdapter(mAdapter);
|
||||
packAdapter = new GiftPackAdapter(getActivity(), giftPackBean, j, "0");
|
||||
mBinding.rvGift.setAdapter(packAdapter);
|
||||
}
|
||||
|
||||
@@ -14,32 +14,10 @@ import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class OneImageYuanJiaoAdapter extends MyBaseAdapter<String> {
|
||||
private Context context;
|
||||
|
||||
// public OneImageYuanJiaoAdapter(Context context) {
|
||||
// this.context = context;
|
||||
// }
|
||||
|
||||
public OneImageYuanJiaoAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// protected void convert(BaseViewHolder helper, String item) {
|
||||
// helper.addOnClickListener(R.id.fiv);
|
||||
//
|
||||
// helper.setVisible(R.id.ll_del, false);
|
||||
// QMUIRadiusImageView image = helper.getView(R.id.fiv);
|
||||
// RequestOptions options = new RequestOptions()
|
||||
// .centerCrop()
|
||||
// .placeholder(R.color.white)
|
||||
// .diskCacheStrategy(DiskCacheStrategy.ALL);
|
||||
// Glide.with(mContext)
|
||||
// .load(item)
|
||||
// .apply(options)
|
||||
// .into(image);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ViewHolder VH;
|
||||
@@ -53,10 +31,8 @@ public class OneImageYuanJiaoAdapter extends MyBaseAdapter<String> {
|
||||
VH.iv_del.setVisibility(View.GONE);
|
||||
|
||||
if (!TextUtils.isEmpty(list_adapter.get(position))) {
|
||||
|
||||
ImageUtils.loadHeadCC(list_adapter.get(position),VH.tv_title);
|
||||
}
|
||||
//
|
||||
return convertView;
|
||||
}
|
||||
|
||||
@@ -64,27 +40,10 @@ public class OneImageYuanJiaoAdapter extends MyBaseAdapter<String> {
|
||||
public static class ViewHolder {
|
||||
RoundedImageView tv_title;
|
||||
ImageView iv_del;
|
||||
RelativeLayout layoutImg;
|
||||
|
||||
public ViewHolder(View convertView) {
|
||||
tv_title = convertView.findViewById(R.id.fiv);
|
||||
iv_del = convertView.findViewById(R.id.iv_del);
|
||||
// layoutImg = convertView.findViewById(R.id.layout_img);
|
||||
//
|
||||
// int screenWidth = QMUIDisplayHelper.getScreenWidth(BaseApplication.mApplication) - QMUIDisplayHelper.dp2px(BaseApplication.mApplication, 24);
|
||||
//
|
||||
// int imgWidth = screenWidth*1/3-QMUIDisplayHelper.dp2px(BaseApplication.mApplication, 10);
|
||||
//
|
||||
// RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) layoutImg.getLayoutParams();
|
||||
// params.width = imgWidth;
|
||||
// params.height = imgWidth;
|
||||
// layoutImg.setLayoutParams(params);
|
||||
//
|
||||
// params = (RelativeLayout.LayoutParams) tv_title.getLayoutParams();
|
||||
// params.width = imgWidth;
|
||||
// params.height = imgWidth;
|
||||
// tv_title.setLayoutParams(params);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -786,32 +786,6 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
}
|
||||
}
|
||||
|
||||
//static 代码段可以防止内存泄露
|
||||
static {
|
||||
//设置全局的Header构建器
|
||||
SmartRefreshLayout.setDefaultRefreshHeaderCreator(new DefaultRefreshHeaderCreator() {
|
||||
@Override
|
||||
public RefreshHeader createRefreshHeader(Context context, RefreshLayout layout) {
|
||||
ClassicsHeader header = new ClassicsHeader(context);
|
||||
header.setDrawableSize(20);
|
||||
header.setFinishDuration(0);
|
||||
return header;//.setTimeFormat(new DynamicTimeFormat("更新于 %s"));//指定为经典Header,默认是 贝塞尔雷达Header
|
||||
// return new CustomRefreshHeader(context);//.setTimeFormat(new DynamicTimeFormat("更新于 %s"));//指定为经典Header,默认是 贝塞尔雷达Header
|
||||
}
|
||||
});
|
||||
//设置全局的Footer构建器
|
||||
SmartRefreshLayout.setDefaultRefreshFooterCreator(new DefaultRefreshFooterCreator() {
|
||||
@Override
|
||||
public RefreshFooter createRefreshFooter(Context context, RefreshLayout layout) {
|
||||
ClassicsFooter classicsFooter = new ClassicsFooter(context);
|
||||
classicsFooter.setDrawableSize(20);
|
||||
classicsFooter.setFinishDuration(0);
|
||||
//指定为经典Footer,默认是 BallPulseFooter
|
||||
return classicsFooter;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
|
||||
@@ -11,28 +11,28 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class CircleListBean {
|
||||
private int id;//语圈ID
|
||||
private int user_id;//用户ID
|
||||
private String nickname;//用户昵称
|
||||
private String avatar;//用户头像
|
||||
private int is_like;//我是否点赞(0没有,1点赞)
|
||||
private int sex;//性别 1男2女
|
||||
private String content;//内容
|
||||
private String like_num;//点赞数
|
||||
private String rewards_num; //打赏金额
|
||||
private String is_room;//作者是否在房间中(1在,0不在)
|
||||
private String room_id;//作者所在房间ID (is_room =0 此值小于0 )
|
||||
private String comment_num;//评论数
|
||||
private int is_recommend;//1非推荐2推荐
|
||||
private String ip;//活跃地址
|
||||
private String images;////图片 JSON字符串 封面获取第一张
|
||||
private String createtime;//时间
|
||||
private String topic_id;
|
||||
private String share_url;
|
||||
private List<HeatedBean> title;//话题列表
|
||||
public int id;//语圈ID
|
||||
public int user_id;//用户ID
|
||||
public String nickname;//用户昵称
|
||||
public String avatar;//用户头像
|
||||
public int is_like;//我是否点赞(0没有,1点赞)
|
||||
public int sex;//性别 1男2女
|
||||
public String content;//内容
|
||||
public String like_num;//点赞数
|
||||
public String rewards_num; //打赏金额
|
||||
public String is_room;//作者是否在房间中(1在,0不在)
|
||||
public String room_id;//作者所在房间ID (is_room =0 此值小于0 )
|
||||
public String comment_num;//评论数
|
||||
public int is_recommend;//1非推荐2推荐
|
||||
public String ip;//活跃地址
|
||||
public String images;////图片 JSON字符串 封面获取第一张
|
||||
public String createtime;//时间
|
||||
public String topic_id;
|
||||
public String share_url;
|
||||
public List<HeatedBean> title;//话题列表
|
||||
|
||||
private String read_num;//阅读数
|
||||
private List<LikeList> like_list;
|
||||
public String read_num;//阅读数
|
||||
public List<LikeList> like_list;
|
||||
|
||||
|
||||
@Data
|
||||
|
||||
@@ -5,11 +5,14 @@ import com.xscm.moduleutil.BaseEvent;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/10
|
||||
*@description:发布头条需要的参数
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class HeadlineBean extends BaseEvent implements Serializable {
|
||||
private String countdown;
|
||||
|
||||
@@ -3,9 +3,11 @@ package com.xscm.moduleutil.bean;
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class MqttXlhEnd extends BaseEvent implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -4,7 +4,9 @@ package com.xscm.moduleutil.bean.room;
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class RoomUpPitBean extends BaseEvent {
|
||||
private String id;
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.xscm.moduleutil.diff
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import com.xscm.moduleutil.bean.CircleListBean
|
||||
|
||||
|
||||
class CircleListDiffCallback(
|
||||
private val oldList: List<CircleListBean>?,
|
||||
private val newList: List<CircleListBean>?
|
||||
) :
|
||||
DiffUtil.Callback() {
|
||||
override fun getOldListSize(): Int {
|
||||
return oldList?.size ?: 0
|
||||
}
|
||||
|
||||
override fun getNewListSize(): Int {
|
||||
return newList?.size ?: 0
|
||||
}
|
||||
|
||||
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
|
||||
return oldList!![oldItemPosition].id == newList!![newItemPosition].id
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
|
||||
val oldItem = oldList!![oldItemPosition]
|
||||
val newItem = newList!![newItemPosition]
|
||||
|
||||
// 判断核心数据是否一致(排除动态字段)
|
||||
if (!equalsStr(oldItem.nickname, newItem.nickname)) return false
|
||||
if (!equalsStr(oldItem.avatar, newItem.avatar)) return false
|
||||
if (!equalsStr(oldItem.content, newItem.content)) return false
|
||||
if (oldItem.is_like != newItem.is_like) return false
|
||||
if (oldItem.sex != newItem.sex) return false
|
||||
if (!equalsStr(oldItem.images, newItem.images)) return false
|
||||
|
||||
// 动态字段不参与整体比较(让 getChangePayload 控制)
|
||||
return equalsStr(oldItem.rewards_num, newItem.rewards_num)
|
||||
&& equalsStr(oldItem.like_num, newItem.like_num)
|
||||
&& equalsStr(oldItem.comment_num, newItem.comment_num)
|
||||
// && equalsStr(oldItem.read_num, newItem.read_num)
|
||||
}
|
||||
|
||||
override fun getChangePayload(oldItemPosition: Int, newItemPosition: Int): Any? {
|
||||
val oldItem = oldList!![oldItemPosition]
|
||||
val newItem = newList!![newItemPosition]
|
||||
|
||||
val diff = Bundle()
|
||||
|
||||
if (!equalsStr(oldItem.rewards_num, newItem.rewards_num)) {
|
||||
diff.putString("rewards_num", newItem.rewards_num)
|
||||
}
|
||||
if (!equalsStr(oldItem.like_num, newItem.like_num)) {
|
||||
diff.putString("like_num", newItem.like_num)
|
||||
diff.putInt("is_like",newItem.is_like)
|
||||
}
|
||||
if (!equalsStr(oldItem.comment_num, newItem.comment_num)) {
|
||||
diff.putString("comment_num", newItem.comment_num)
|
||||
}
|
||||
// if (!equalsStr(oldItem.read_num, newItem.read_num)) {
|
||||
// diff.putString("read_num", newItem.read_num)
|
||||
// }
|
||||
|
||||
return if (diff.size() == 0) null else diff
|
||||
}
|
||||
|
||||
private fun equalsStr(a: String?, b: String?): Boolean {
|
||||
if (a == null && b == null) return true
|
||||
if (a == null || b == null) return false
|
||||
return a == b
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,9 @@ package com.xscm.moduleutil.event;
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class CabinEvent extends BaseEvent {
|
||||
private boolean joined;
|
||||
|
||||
@@ -4,12 +4,14 @@ import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/23
|
||||
*@description: 特效设置
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
@@ -11,6 +12,7 @@ import lombok.NoArgsConstructor;
|
||||
*@data 2025/9/22
|
||||
*@description: 关闭飘屏
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -3,12 +3,14 @@ package com.xscm.moduleutil.event;
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time 2025年7月30日01:35:52$ $
|
||||
* @Description 打赏成功$
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class GiftRewardEvent extends BaseEvent {
|
||||
private int points;
|
||||
|
||||
@@ -3,12 +3,14 @@ package com.xscm.moduleutil.event;
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 小时榜飘屏
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class HourlyBean extends BaseEvent implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -13,12 +13,14 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time $ $
|
||||
* @Description 从声望获取到的参数$
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class MqttBean extends BaseEvent {
|
||||
private String room_id;
|
||||
|
||||
@@ -3,11 +3,14 @@ package com.xscm.moduleutil.event;
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/24
|
||||
*@description: 背景音乐
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class MusicEvent extends BaseEvent {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class PlazaEvent extends BaseEvent {
|
||||
public static final int DELETE_ZONE = 1009;
|
||||
public static final int MODIFY_ZONE = 1008;
|
||||
public static final int ADD_ZONE = 1007;
|
||||
private int msgId;
|
||||
private int type;//DELETE_ZONE : 删除 MODIFY_ZONE : 修改 ADD_ZONE : 新增
|
||||
}
|
||||
@@ -4,8 +4,10 @@ import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.xscm.moduleutil.BaseEvent;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class RoomGiftGiveEvent extends BaseEvent {
|
||||
public String userId;
|
||||
|
||||
@@ -5,12 +5,14 @@ import android.view.SurfaceView;
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time $ $
|
||||
* @Description 判断是否是电影房$
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class SurfaceEvent extends BaseEvent {
|
||||
|
||||
|
||||
@@ -3,11 +3,14 @@ package com.xscm.moduleutil.event;
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/15
|
||||
*@description: 这是im展示需要显示的未读消息数
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class UnreadCountEvent extends BaseEvent {
|
||||
private long aLong;
|
||||
|
||||
@@ -198,12 +198,6 @@ public class RewardGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPr
|
||||
|
||||
@Override
|
||||
public void getGiftLabel(List<GiftLabelBean> giftLabelBeans) {
|
||||
// giftLabelBeanList = new ArrayList<>();
|
||||
// giftLabelBeanList.addAll(giftLabelBeans);
|
||||
// GiftLabelBean giftLabelBean = new GiftLabelBean();
|
||||
// giftLabelBean.setId("0");
|
||||
// giftLabelBean.setName("背包");
|
||||
// giftLabelBeans.add(0, giftLabelBean);
|
||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getChildFragmentManager(), giftLabelBeans,fragmentList,""));
|
||||
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
|
||||
mBinding.slidingTabLayout.setCurrentTab(0);
|
||||
@@ -244,29 +238,8 @@ public class RewardGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPr
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private GiftPackBean giftModel = null;
|
||||
private int getSelectedGift() {
|
||||
int currentItem = mBinding.viewPager.getCurrentItem();
|
||||
// if (currentItem < 1) { //比2小是才是礼物
|
||||
// GiftTwoDetailsFragment fragment = (GiftTwoDetailsFragment) fragmentList.get(currentItem);
|
||||
// roonGiftModel = fragment.getGiftList();
|
||||
// }
|
||||
// else {
|
||||
// GiftFragment fragment = (GiftFragment) fragmentList.get(currentItem);
|
||||
// giftModel = fragment.getmData();
|
||||
// }
|
||||
|
||||
// if (currentItem < 1) { //比1小的是背包
|
||||
// GiftTwoDetailsFragment fragment = (GiftTwoDetailsFragment) fragmentList.get(currentItem);
|
||||
// if (fragment != null && giftModel == null) {
|
||||
// giftModel = fragment.mGiftList();
|
||||
// }
|
||||
// } else {
|
||||
// GiftTwoDetailsFragment fragment = (GiftTwoDetailsFragment) fragmentList.get(currentItem);
|
||||
// if (fragment != null && roonGiftModel == null) {
|
||||
// roonGiftModel = fragment.getGiftList();
|
||||
// }
|
||||
// }
|
||||
return currentItem;
|
||||
}
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@@ -278,24 +251,6 @@ public class RewardGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPr
|
||||
|
||||
private void giveGift(String num) {
|
||||
getSelectedGift();
|
||||
int currentItem = mBinding.viewPager.getCurrentItem();
|
||||
String userId = user_id;
|
||||
// if (currentItem < 1) {
|
||||
// if (roonGiftModel == null) {
|
||||
// ToastUtils.show("请选择礼物");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// if (TextUtils.isEmpty(num)) {
|
||||
// ToastUtils.show("请选择打赏礼物数量");
|
||||
// return;
|
||||
// }
|
||||
// if (Integer.valueOf(num) <= 0) {
|
||||
// ToastUtils.show("请选择打赏礼物数量");
|
||||
// return;
|
||||
// }
|
||||
// } else {
|
||||
if (roonGiftModel == null) {
|
||||
ToastUtils.show("请选择礼物");
|
||||
return;
|
||||
@@ -309,19 +264,10 @@ public class RewardGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPr
|
||||
ToastUtils.show("请选择打赏礼物数量");
|
||||
return;
|
||||
}
|
||||
// }
|
||||
|
||||
// if (currentItem == 0) {
|
||||
//礼物打赏
|
||||
giftNumber = num;
|
||||
MvpPre.reward_zone(circle_id, roonGiftModel.getGift_id(), num, "1");
|
||||
// } else {
|
||||
//背包礼物打赏
|
||||
// giftNumber = num;
|
||||
// roomGiftGiveEvent = new RoomGiftGiveEvent(userId, roomId, pit, num, 1, giftModel, null);
|
||||
//
|
||||
// MvpPre.giveBackGift(userId, giftModel.getGift_id(), roomId, pit, num, giftModel, 1);
|
||||
// }
|
||||
}
|
||||
@Override
|
||||
public void setGiftList(List<RoonGiftModel> roonGiftModels,int type) {
|
||||
|
||||
Reference in New Issue
Block a user