1.添加幸运榜单

2.显示跳过动画
This commit is contained in:
2025-09-26 21:03:14 +08:00
parent 888c04ce11
commit e5a7b480c3
25 changed files with 810 additions and 108 deletions

View File

@@ -12,6 +12,7 @@ import lombok.Data;
public class GiftBean {
private String gift_id;
private String periods;
private String gift_name;
private String gift_price;
private int file_type;

View File

@@ -0,0 +1,130 @@
package com.xscm.moduleutil.dialog;
import android.os.Bundle;
import android.view.Choreographer;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
import com.xscm.moduleutil.R;
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
import com.xscm.moduleutil.bean.GiftBean;
import com.xscm.moduleutil.bean.WalletBean;
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
import com.xscm.moduleutil.databinding.DialogNewRankingXlhFragmentBinding;
import com.xscm.moduleutil.databinding.FframentDataBinding;
import com.xscm.moduleutil.dialog.giftLottery.GiftLotteryContacts;
import com.xscm.moduleutil.dialog.giftLottery.GiftLotteryPresenter;
import com.xscm.moduleutil.dialog.giftLottery.GiftRecordAdapte;
import com.xscm.moduleutil.dialog.giftLottery.NewGiftRecordAdapte;
import java.util.List;
public class LotteryFragment extends BaseMvpDialogFragment<GiftLotteryPresenter, FframentDataBinding> implements GiftLotteryContacts.View {
private int page=1;
private String roomId;
private int type=-1;
private GiftRecordAdapte giftRecordAdapte;
@Override
protected GiftLotteryPresenter bindPresenter() {
return new GiftLotteryPresenter(this,getSelfActivity());
}
public static LotteryFragment newInstance(String giftBagId,int type) {
Bundle args = new Bundle();
LotteryFragment fragment = new LotteryFragment();
args.putString("roomId", giftBagId);
args.putInt("type",type);
fragment.setArguments(args);
return fragment;
}
@Override
protected void initData() {
roomId = getArguments().getString("roomId");
type = getArguments().getInt("type");
MvpPre.xlhAllRecord(roomId, "1", "20",type);
}
@Override
protected void initView() {
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
@Override
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
page = 1;
MvpPre.xlhAllRecord(roomId, page+"", "20",type);
}
@Override
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
page++;
MvpPre.xlhAllRecord(roomId, page+"", "20",type);
}
});
giftRecordAdapte=new GiftRecordAdapte();
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
mBinding.recyclerView.setAdapter(giftRecordAdapte);
}
@Override
protected int getLayoutId() {
return R.layout.fframent_data;
}
@Override
public void getGiftListSuccess(BlindBoxBean blindBoxBean) {
}
@Override
public void drawGiftListSuccess(BlindReslutBean blindReslutBean) {
}
@Override
public void getMyRecordSuccess(List<GiftBean> data) {
}
@Override
public void getAllRecordSuccess(List<GiftBean> data) {
if (data != null){
if (page==1){
giftRecordAdapte.setNewData(data);
}else {
giftRecordAdapte.addData(data);
}
}else {
if (page == 1) {
giftRecordAdapte.setNewData(null);
}
}
}
@Override
public void finishRefreshLoadMore() {
mBinding.smartRefreshLayout.finishRefresh();
mBinding.smartRefreshLayout.finishLoadMore();
}
@Override
public void wallet(WalletBean walletBean) {
}
@Override
public void xlhChouSuccess(List<XlhDrawBean> data) {
}
}

View File

@@ -42,7 +42,7 @@ public class GiftLotteryContacts {
void xlhChou(String room_id,String num);
void xlhAllRecord(String room_id,String page,String pageSize);
void xlhAllRecord(String room_id,String page,String pageSize,int type);
void xlhMyRecord(String room_id,String page,String pageSize);
}

View File

@@ -173,22 +173,26 @@ public class GiftLotteryPresenter extends BasePresenter<GiftLotteryContacts.View
}
@Override
public void xlhAllRecord(String room_id, String page, String pageSize) {
api.xlhAllRecord(room_id,page,pageSize,new BaseObserver<List<GiftBean>>() {
@Override
public void onSubscribe(Disposable d) {
addDisposable(d);
}
public void xlhAllRecord(String room_id, String page, String pageSize,int type) {
@Override
public void onNext(List<GiftBean> giftBean) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
api.xlhAllRecord(room_id, page, pageSize,type, new BaseObserver<List<GiftBean>>() {
@Override
public void onSubscribe(Disposable d) {
addDisposable(d);
}
MvpRef.get().getAllRecordSuccess(giftBean);
MvpRef.get().finishRefreshLoadMore();
}
});
@Override
public void onNext(List<GiftBean> giftBean) {
if (MvpRef == null) {
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().getAllRecordSuccess(giftBean);
MvpRef.get().finishRefreshLoadMore();
}
});
}
@Override

View File

@@ -13,6 +13,7 @@ public class GiftRecordAdapte extends BaseQuickAdapter<GiftBean, BaseViewHolder>
@Override
protected void convert(BaseViewHolder helper, GiftBean item) {
helper.setText(R.id.tv_user_name, item.getNickname());
helper.setText(R.id.tv_gift_count_name,"x"+item.getCount()+" "+ item.getGift_name());
helper.setText(R.id.tv_time, item.getCreatetime());

View File

@@ -82,8 +82,11 @@ public class GiftXlhChouAdapter extends BaseQuickAdapter<GiftBean, BaseViewHolde
if (selectedIcon != null) {
// 检查当前item是否为选中位置
if (actualPosition == selectedPosition) {
selectedIcon.setVisibility(View.VISIBLE);
selectedIcon.setVisibility(View.GONE);
helper.setBackgroundRes(R.id.ll_bg,R.mipmap.ke_bg);
} else {
helper.setBackgroundRes(R.id.ll_bg,R.mipmap.xlh_cj_item);
selectedIcon.setVisibility(View.GONE);
}
}

View File

@@ -0,0 +1,124 @@
package com.xscm.moduleutil.dialog.giftLottery;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
import com.xscm.moduleutil.R;
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
import com.xscm.moduleutil.bean.GiftBean;
import com.xscm.moduleutil.bean.WalletBean;
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
import com.xscm.moduleutil.databinding.FframentDataBinding;
import java.util.List;
public class LuckyFragment extends BaseMvpDialogFragment<GiftLotteryPresenter, FframentDataBinding> implements GiftLotteryContacts.View {
private int page=1;
private String roomId;
private int type=-1;
private NewGiftRecordAdapte giftRecordAdapte;
@Override
protected GiftLotteryPresenter bindPresenter() {
return new GiftLotteryPresenter(this,getSelfActivity());
}
public static LuckyFragment newInstance(String giftBagId, int type) {
Bundle args = new Bundle();
LuckyFragment fragment = new LuckyFragment();
args.putString("roomId", giftBagId);
args.putInt("type",type);
fragment.setArguments(args);
return fragment;
}
@Override
protected void initData() {
roomId = getArguments().getString("roomId");
type = getArguments().getInt("type");
MvpPre.xlhAllRecord(roomId, "1", "20",type);
}
@Override
protected void initView() {
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
@Override
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
page = 1;
MvpPre.xlhAllRecord(roomId, page+"", "20",type);
}
@Override
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
page++;
MvpPre.xlhAllRecord(roomId, page+"", "20",type);
}
});
giftRecordAdapte=new NewGiftRecordAdapte();
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
mBinding.recyclerView.setAdapter(giftRecordAdapte);
}
@Override
protected int getLayoutId() {
return R.layout.fframent_data;
}
@Override
public void getGiftListSuccess(BlindBoxBean blindBoxBean) {
}
@Override
public void drawGiftListSuccess(BlindReslutBean blindReslutBean) {
}
@Override
public void getMyRecordSuccess(List<GiftBean> data) {
}
@Override
public void getAllRecordSuccess(List<GiftBean> data) {
if (data != null){
if (page==1){
giftRecordAdapte.setNewData(data);
}else {
giftRecordAdapte.addData(data);
}
}else {
if (page == 1) {
giftRecordAdapte.setNewData(null);
}
}
}
@Override
public void finishRefreshLoadMore() {
mBinding.smartRefreshLayout.finishRefresh();
mBinding.smartRefreshLayout.finishLoadMore();
}
@Override
public void wallet(WalletBean walletBean) {
}
@Override
public void xlhChouSuccess(List<XlhDrawBean> data) {
}
}

View File

@@ -0,0 +1,23 @@
package com.xscm.moduleutil.dialog.giftLottery;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xscm.moduleutil.R;
import com.xscm.moduleutil.bean.GiftBean;
import com.xscm.moduleutil.utils.ImageUtils;
public class NewGiftRecordAdapte extends BaseQuickAdapter<GiftBean, BaseViewHolder> {
public NewGiftRecordAdapte() {
super(R.layout.item_gift_record_new);
}
@Override
protected void convert(BaseViewHolder helper, GiftBean item) {
helper.setText(R.id.tv_issue,item.getPeriods());
helper.setText(R.id.tv_user_name, item.getNickname());
helper.setText(R.id.tv_gift_count_name, item.getGift_name());
helper.setText(R.id.tv_time, item.getCreatetime());
ImageUtils.loadHeadCC(item.getBase_image(),helper.getView(R.id.iv_gift_icon));
}
}

View File

@@ -0,0 +1,174 @@
package com.xscm.moduleutil.dialog.giftLottery;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.RadioGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import com.xscm.moduleutil.R;
import com.xscm.moduleutil.adapter.MyPagerAdapter;
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
import com.xscm.moduleutil.bean.GiftBean;
import com.xscm.moduleutil.bean.WalletBean;
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
import com.xscm.moduleutil.databinding.DialogNewRankingXlhFragmentBinding;
import com.xscm.moduleutil.dialog.LotteryFragment;
import java.util.ArrayList;
import java.util.List;
/**
*@author qx
*@data 2025/9/4
*@description:巡乐会榜单
*/
public class NewXlhRankingDialog extends BaseMvpDialogFragment<GiftLotteryPresenter, DialogNewRankingXlhFragmentBinding> implements GiftLotteryContacts.View{
private String roomId;
private MyPagerAdapter pagerAdapter;
private List<Fragment> fragmentList;
private List<String> titleList = new ArrayList();
@Override
protected GiftLotteryPresenter bindPresenter() {
return new GiftLotteryPresenter(this,getSelfActivity());
}
public static NewXlhRankingDialog newInstance(String giftBagId) {
Bundle args = new Bundle();
NewXlhRankingDialog fragment = new NewXlhRankingDialog();
args.putString("roomId", giftBagId);
fragment.setArguments(args);
return fragment;
}
@Nullable
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
Dialog dialog = super.onCreateDialog(savedInstanceState);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setCancelable(true);
return dialog;
}
@Override
public void onStart() {
super.onStart();
Window window = getDialog().getWindow();
if (window != null) {
// 获取屏幕高度
android.util.DisplayMetrics displayMetrics = new android.util.DisplayMetrics();
requireActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int screenHeight = displayMetrics.heightPixels;
// 设置高度为屏幕高度的100%(全屏)
int heightInPx = (int) (screenHeight * 0.8);;
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, heightInPx);
window.setBackgroundDrawableResource(android.R.color.transparent);
// 可选:设置动画样式(从底部弹出)
window.setWindowAnimations(R.style.CommonShowDialogBottom);
}
}
@Override
protected void initDialogStyle(Window window) {
super.initDialogStyle(window);
window.setGravity(Gravity.BOTTOM);
}
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
}
@Override
protected void initData() {
roomId = getArguments().getString("roomId");
// MvpPre.xlhAllRecord(roomId, "1", "20");
// 初始化Fragment列表
initFragments();
initViewPager();
}
// 初始化Fragment列表
private void initFragments() {
fragmentList = new ArrayList<>();
fragmentList.add(new LotteryFragment().newInstance(roomId,1)); // 第1页抽奖榜单
fragmentList.add(new LuckyFragment().newInstance(roomId,2)); // 第1页抽奖榜单
}
// 初始化ViewPager
private void initViewPager() {
titleList.add("");
titleList.add("");
FragmentManager childFragmentManager = getChildFragmentManager();
pagerAdapter = new MyPagerAdapter(childFragmentManager, fragmentList,titleList );
mBinding.ivViewPager.setAdapter(pagerAdapter);
mBinding.ivViewPager.setCurrentItem(0); // 默认显示第1页
}
@Override
protected void initView() {
mBinding.rbBtn.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
if (checkedId==R.id.radio_all){
mBinding.ivViewPager.setCurrentItem(0);
}else {
mBinding.ivViewPager.setCurrentItem(1);
}
}
});
}
@Override
protected int getLayoutId() {
return R.layout.dialog_new_ranking_xlh_fragment;
}
@Override
public void getGiftListSuccess(BlindBoxBean blindBoxBean) {
}
@Override
public void drawGiftListSuccess(BlindReslutBean blindReslutBean) {
}
@Override
public void getMyRecordSuccess(List<GiftBean> data) {
}
@Override
public void getAllRecordSuccess(List<GiftBean> data) {
}
@Override
public void finishRefreshLoadMore() {
}
@Override
public void wallet(WalletBean walletBean) {
}
@Override
public void xlhChouSuccess(List<XlhDrawBean> data) {
}
}

View File

@@ -2,7 +2,6 @@ package com.xscm.moduleutil.dialog.giftLottery;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
@@ -17,23 +16,18 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.LinearSnapHelper;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.GsonUtils;
import com.xscm.moduleutil.R;
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
import com.xscm.moduleutil.bean.GiftBean;
import com.xscm.moduleutil.bean.MqttXlhEnd;
import com.xscm.moduleutil.bean.RoomMessageEvent;
import com.xscm.moduleutil.bean.WalletBean;
import com.xscm.moduleutil.bean.XLHBean;
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
import com.xscm.moduleutil.databinding.FragmentTourClubDialogBinding;
import com.xscm.moduleutil.dialog.RechargeDialogFragment;
import com.xscm.moduleutil.dialog.WebViewDialog;
import com.xscm.moduleutil.event.MqttBean;
import com.xscm.moduleutil.utils.ARouteConstants;
import com.xscm.moduleutil.utils.ImageUtils;
import com.xscm.moduleutil.widget.CenterScrollHelper;
import com.xscm.moduleutil.widget.EqualSpaceItemDecoration;
@@ -57,7 +51,7 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
private CountDownTimer mCountDownTimer;
private long endTime; // 服务器返回的结束时间戳
private String num;
private XlhRankingDialog xlhRankingDialog;
private NewXlhRankingDialog newXlhRankingDialog;
private XlhRecordDialog xlhRecordDialog;
private XlhObtainDialog xlhObtainDialog;
@@ -298,12 +292,12 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
dialog.show();
} else if (id == R.id.tv_bd) {
// 如果当前dialog存在且正在显示先关闭
if (xlhRankingDialog != null && xlhRankingDialog.isVisible()) {
xlhRankingDialog.dismiss();
if (newXlhRankingDialog != null && newXlhRankingDialog.isVisible()) {
newXlhRankingDialog.dismiss();
}
xlhRankingDialog = XlhRankingDialog.newInstance(roomId);
xlhRankingDialog.show(getChildFragmentManager(), "XlhRankingDialog");
newXlhRankingDialog = NewXlhRankingDialog.newInstance(roomId);
newXlhRankingDialog.show(getChildFragmentManager(), "newXlhRankingDialog");
} else if (id == R.id.tv_jl) {
// 如果当前dialog存在且正在显示先关闭
if (xlhRecordDialog != null && xlhRecordDialog.isVisible()) {
@@ -517,8 +511,8 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
}
// 如果当前dialog存在且正在显示先关闭
if (xlhRankingDialog != null && xlhRankingDialog.isVisible()) {
xlhRankingDialog.dismiss();
if (newXlhRankingDialog != null && newXlhRankingDialog.isVisible()) {
newXlhRankingDialog.dismiss();
}
if (xlhObtainDialog != null && xlhObtainDialog.isShowing()) {

View File

@@ -44,7 +44,7 @@ public class XlhRankingDialog extends BaseMvpDialogFragment<GiftLotteryPresenter
return new GiftLotteryPresenter(this,getSelfActivity());
}
public static XlhRankingDialog newInstance(String giftBagId) {
public static XlhRankingDialog newInstance(String giftBagId,int type) {
Bundle args = new Bundle();
XlhRankingDialog fragment = new XlhRankingDialog();
args.putString("roomId", giftBagId);
@@ -93,7 +93,7 @@ public class XlhRankingDialog extends BaseMvpDialogFragment<GiftLotteryPresenter
@Override
protected void initData() {
MvpPre.xlhAllRecord(roomId, "1", "20");
MvpPre.xlhAllRecord(roomId, "1", "20",1);
}
@@ -105,14 +105,14 @@ public class XlhRankingDialog extends BaseMvpDialogFragment<GiftLotteryPresenter
@Override
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
page = 1;
MvpPre.xlhAllRecord(roomId, page+"", "20");
MvpPre.xlhAllRecord(roomId, page+"", "20",1);
}
@Override
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
page++;
MvpPre.xlhAllRecord(roomId, page+"", "20");
MvpPre.xlhAllRecord(roomId, page+"", "20",1);
}
});

View File

@@ -767,6 +767,9 @@ public interface ApiServer {
@FormUrlEncoded
@POST(Constants.POST_XLH_ALL_RECORD)
Call<BaseModel<List<GiftBean>>> xlhAllRecord(@Field("room_id") String room_id, @Field("page") String page, @Field("page_size") String page_size);
@FormUrlEncoded
@POST(Constants.Get_XH_RANking)
Call<BaseModel<List<GiftBean>>> xlXH_RANking(@Field("room_id") String room_id, @Field("page") String page, @Field("page_size") String page_size);
@GET(Constants.GET_XLH_MY_RECORD)
Call<BaseModel<List<GiftBean>>> xlhMyRecord(@Query("room_id") String room_id, @Query("page") String page, @Query("page_size") String page_size);

View File

@@ -3562,23 +3562,45 @@ public class RetrofitClient {
}
public void xlhAllRecord(String roomId, String page, String
pageSize, BaseObserver<List<GiftBean>> observer) {
sApiServer.xlhAllRecord(roomId, page, pageSize).enqueue(new Callback<BaseModel<List<GiftBean>>>() {
@Override
public void onResponse(Call<BaseModel<List<GiftBean>>> call, Response<BaseModel<List<GiftBean>>> response) {
if (response.code() == 200) {
BaseModel<List<GiftBean>> baseModel = response.body();
if (baseModel.getCode() == 1) {
observer.onNext(baseModel.getData());
pageSize,int type, BaseObserver<List<GiftBean>> observer) {
if (type==1) {
sApiServer.xlhAllRecord(roomId, page, pageSize).enqueue(new Callback<BaseModel<List<GiftBean>>>() {
@Override
public void onResponse(Call<BaseModel<List<GiftBean>>> call, Response<BaseModel<List<GiftBean>>> response) {
if (response.code() == 200) {
BaseModel<List<GiftBean>> baseModel = response.body();
if (baseModel.getCode() == 1) {
observer.onNext(baseModel.getData());
}
}
}
}
@Override
public void onFailure(Call<BaseModel<List<GiftBean>>> call, Throwable t) {
t.printStackTrace();
}
});
@Override
public void onFailure(Call<BaseModel<List<GiftBean>>> call, Throwable t) {
t.printStackTrace();
}
});
}else {
sApiServer.xlXH_RANking(roomId,page,pageSize).enqueue(new Callback<BaseModel<List<GiftBean>>>() {
@Override
public void onResponse(Call<BaseModel<List<GiftBean>>> call, Response<BaseModel<List<GiftBean>>> response) {
if (response.code() == 200) {
BaseModel<List<GiftBean>> baseModel = response.body();
if (baseModel.getCode() == 1) {
LogUtils.e("xlXH_RANking", response.body().toString());
observer.onNext(baseModel.getData());
}
}
}
@Override
public void onFailure(Call<BaseModel<List<GiftBean>>> call, Throwable t) {
t.printStackTrace();
}
});
}
}
public void xlhMyRecord(String roomId, String page, String pageSize, BaseObserver<List<GiftBean>> observer) {

View File

@@ -384,6 +384,7 @@ public class Constants {
public static final String GET_BOX_GIFT_LIST_XLH = "/api/BlindBoxTurntable/xlh";//巡乐会
public static final String POST_DRAW_GIFT_LIST_XLH = "/api/BlindBoxTurntable/xlh_draw_gift";//巡乐会抽奖
public static final String POST_XLH_ALL_RECORD = "/api/BlindBoxTurntable/get_xlh_all_record";//巡乐会榜单
public static final String Get_XH_RANking = "/api/BlindBoxTurntable/get_xlh_ranking";//巡乐会幸运
public static final String GET_XLH_MY_RECORD = "/api/BlindBoxTurntable/get_xlh_my_record";//巡乐会记录
public static final String POST_GIFT_ALL_CLEAR = "/api/Room/room_gift_all_clear";//背包礼物全清
public static final String POST_ROOM_USER_CHARM_LIST = "/api/Room/room_user_charm_list";//房间用户当前魅力值列表

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 选中状态:深色背景+白色文字背景通过shape绘制 -->
<item android:state_checked="true">
<shape android:shape="rectangle">
<padding
android:bottom="@dimen/dp_9"
android:top="@dimen/dp_9"
android:right="@dimen/dp_16"
android:left="@dimen/dp_16"/>
<!-- 圆角 -->
<corners android:radius="16dp" />
<!-- 选中背景色 -->
<solid android:color="#553BAE" />
</shape>
</item>
<!-- 未选中状态:浅色背景+深色文字 -->
<item android:state_checked="false">
<shape android:shape="rectangle">
<padding
android:bottom="@dimen/dp_9"
android:top="@dimen/dp_9"
android:right="@dimen/dp_16"
android:left="@dimen/dp_16">
</padding>
<corners android:radius="16dp" />
<!-- 未选中背景色 -->
<solid android:color="#A48DB1" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 选中时文字颜色 -->
<item android:state_checked="true" android:color="#E8E8E8" />
<!-- 未选中时文字颜色 -->
<item android:state_checked="false" android:color="#FFFFFF" />
</selector>

View File

@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/xlh"
android:orientation="vertical">
<ImageView
android:id="@+id/im_jc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_36"
android:src="@mipmap/xlh_bd"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/custom_tab_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_16"
android:background="#80000000"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/im_jc">
<RadioGroup
android:gravity="center"
android:id="@+id/rb_btn"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal">
<RadioButton
android:checked="true"
android:id="@+id/radio_all"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/bg_radio_selector"
android:button="@null"
android:gravity="center"
android:text="抽奖榜单"
android:textColor="@drawable/text_color_radio_selector"
android:textSize="@dimen/sp_14" />
<RadioButton
android:layout_marginLeft="@dimen/dp_16"
android:id="@+id/radio_electronics"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/bg_radio_selector"
android:button="@null"
android:gravity="center"
android:text="幸运榜单"
android:textColor="@drawable/text_color_radio_selector"
android:textSize="@dimen/sp_14" />
</RadioGroup>
<androidx.viewpager.widget.ViewPager
android:id="@+id/iv_view_Pager"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.viewpager.widget.ViewPager>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -34,48 +34,50 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/im_jc">
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
<!-- android:id="@+id/cl"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content">-->
<!-- <TextView-->
<!-- android:id="@+id/textView1"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="@dimen/dp_24"-->
<!-- android:layout_marginStart="@dimen/sp_12"-->
<!-- android:layout_marginTop="@dimen/dp_16"-->
<!-- android:background="@mipmap/tab_dy"-->
<!-- android:gravity="center"-->
<!-- android:text="我的记录"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="@dimen/sp_16"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:layout_constraintWidth_default="percent"-->
<!-- app:layout_constraintWidth_percent="0.2" />-->
<!-- <TextView-->
<!-- android:id="@+id/textView2"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="@dimen/dp_24"-->
<!-- android:layout_marginStart="@dimen/dp_16"-->
<!-- android:gravity="center"-->
<!-- android:text="全服记录"-->
<!-- android:textColor="#5B5B5B"-->
<!-- android:textSize="@dimen/sp_14"-->
<!-- app:layout_constraintStart_toEndOf="@+id/textView1"-->
<!-- app:layout_constraintTop_toTopOf="@+id/textView1"-->
<!-- app:layout_constraintWidth_default="percent"-->
<!-- app:layout_constraintWidth_percent="0.2" />-->
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
<!-- android:id="@+id/cl"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content">-->
<!-- <TextView-->
<!-- android:id="@+id/textView1"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="@dimen/dp_24"-->
<!-- android:layout_marginStart="@dimen/sp_12"-->
<!-- android:layout_marginTop="@dimen/dp_16"-->
<!-- android:background="@mipmap/tab_dy"-->
<!-- android:gravity="center"-->
<!-- android:text="我的记录"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="@dimen/sp_16"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:layout_constraintWidth_default="percent"-->
<!-- app:layout_constraintWidth_percent="0.2" />-->
<!-- <TextView-->
<!-- android:id="@+id/textView2"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="@dimen/dp_24"-->
<!-- android:layout_marginStart="@dimen/dp_16"-->
<!-- android:gravity="center"-->
<!-- android:text="全服记录"-->
<!-- android:textColor="#5B5B5B"-->
<!-- android:textSize="@dimen/sp_14"-->
<!-- app:layout_constraintStart_toEndOf="@+id/textView1"-->
<!-- app:layout_constraintTop_toTopOf="@+id/textView1"-->
<!-- app:layout_constraintWidth_default="percent"-->
<!-- app:layout_constraintWidth_percent="0.2" />-->
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/smart_refresh_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginTop="@dimen/dp_16"
android:layout_weight="1"
app:srlEnableLoadMore="true"
app:srlEnableRefresh="true">

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.scwang.smartrefresh.layout.SmartRefreshLayout
app:layout_constraintTop_toTopOf="parent"
android:id="@+id/smart_refresh_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
app:srlEnableLoadMore="true"
app:srlEnableRefresh="true">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_10"
android:nestedScrollingEnabled="false"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
tools:listitem="@layout/item_prize_pool" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -312,7 +312,6 @@
android:text="跳过动画"
android:textColor="#ABABAB"
android:textSize="@dimen/sp_10"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/exchange_layout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/exchange_layout" />
@@ -324,7 +323,6 @@
android:background="@drawable/selector_custom_checkbox"
android:clickable="true"
android:focusable="false"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/exchange_layout"
app:layout_constraintEnd_toStartOf="@+id/tv_option"
app:layout_constraintTop_toTopOf="@+id/exchange_layout" />

View File

@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<!-- 礼物数量 + 名称 -->
<TextView
app:layout_constraintTop_toTopOf="@+id/tv_user_name"
android:id="@+id/tv_gift_count_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="×1娃娃"
android:textColor="@color/white"
android:textSize="@dimen/sp_16"
app:layout_constraintBottom_toBottomOf="@+id/iv_gift_icon"
app:layout_constraintRight_toLeftOf="@+id/iv_gift_icon"
/>
<!-- 用户名 -->
<TextView
android:layout_marginTop="@dimen/dp_10"
android:id="@+id/tv_user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="夏沫"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
app:layout_constraintLeft_toLeftOf="@+id/tv_issue"
app:layout_constraintTop_toBottomOf="@+id/tv_issue"
/>
<TextView
android:id="@+id/tv_issue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_12"
android:text="第1期"
android:textColor="#A085FF"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!-- 时间 -->
<TextView
android:layout_marginRight="@dimen/dp_12"
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_12"
android:text="2024.12.14 11:21:45"
android:textColor="#5B5B5B"
android:textSize="@dimen/sp_12"
app:layout_constraintBottom_toBottomOf="@+id/tv_issue"
app:layout_constraintRight_toRightOf="parent" />
<!-- 礼物图标 -->
<ImageView
android:layout_marginRight="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_10"
android:id="@+id/iv_gift_icon"
android:layout_width="@dimen/dp_32"
android:layout_height="@dimen/dp_32"
android:scaleType="centerCrop"
android:src="@mipmap/ic_launcher"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_time"
/>
<!-- 底部分割线 -->
<View
android:id="@+id/divider"
android:layout_width="0dp"
android:layout_height="@dimen/dp_1"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginEnd="@dimen/dp_12"
android:background="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iv_gift_icon"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -3,6 +3,7 @@
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_154"
android:background="@mipmap/xlh_cj_item"
android:id="@+id/ll_bg"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 KiB

View File

@@ -470,28 +470,4 @@
<attr name="normalBackground" format="reference" />
</declare-styleable>
<declare-styleable name="QXMeetGiftView">
<!-- 背景图片配置 -->
<attr name="normalBg" format="reference" /> <!-- 正常状态背景 -->
<attr name="lockBg" format="reference" /> <!-- 锁定状态背景 -->
<attr name="giftLightBg" format="reference" /> <!-- 礼物光效背景 -->
<attr name="priceBg" format="reference" /> <!-- 价格背景 -->
<attr name="coinIcon" format="reference" /> <!-- 金币图标 -->
<!-- 文字样式配置 -->
<attr name="giftNameColor" format="color" /> <!-- 礼物名称颜色 -->
<attr name="coinTextColor" format="color" /> <!-- 金币文字颜色 -->
<attr name="giftNameSize" format="dimension" /> <!-- 礼物名称字号 -->
<attr name="coinTextSize" format="dimension" /> <!-- 金币文字字号 -->
<!-- 尺寸配置 -->
<attr name="bgBottomMargin" format="dimension" /> <!-- 背景底部边距 -->
<attr name="giftImageMargin" format="dimension" /> <!-- 礼物图片边距 -->
<attr name="priceBgHeight" format="dimension" /> <!-- 价格背景高度 -->
<attr name="priceBgBottomMargin" format="dimension" /> <!-- 价格背景底部边距 -->
<attr name="lockGiftSize" format="dimension" /> <!-- 锁定状态礼物图片尺寸 -->
<!-- 动画配置 -->
<attr name="rotateDuration" format="integer" /> <!-- 旋转动画时长(ms) -->
</declare-styleable>
</resources>

View File

@@ -332,6 +332,7 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
mBinding.ivGuanbi.setOnClickListener(this);
mBinding.riv.setOnClickListener(this);
mBinding.ivShouchl.setOnClickListener(this);
//requestGpsPermissions();
}
@Override
@@ -563,7 +564,7 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
// 请求GPS相关权限精确位置+可选的后台权限)
requestGpsPermissions();
//
}