巡乐会添加榜单和记录
剩余转盘,屏幕适配器
4
.idea/deploymentTargetSelector.xml
generated
@@ -4,10 +4,10 @@
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2025-09-03T02:25:58.699909400Z">
|
||||
<DropdownSelection timestamp="2025-09-04T03:41:21.667755Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="Default" identifier="serial=emulator-5554;connection=da0b71f9" />
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=6705124a" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
|
||||
@@ -124,18 +124,19 @@
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:resizeableActivity="false"
|
||||
android:icon="@mipmap/ic_launcher_app"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:roundIcon="@mipmap/ic_launcher_round_app"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:theme="@style/AppTheme_MAIN"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:targetApi="tiramisu"
|
||||
tools:ignore="SelectedPhotoAccess"
|
||||
tools:replace="android:theme,android:allowBackup"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:requestRawExternalStorageAccess="true"
|
||||
tools:targetApi="tiramisu"
|
||||
>
|
||||
<activity
|
||||
android:name=".LaunchPageActivity"
|
||||
|
||||
@@ -30,7 +30,7 @@ isBuildModule=false
|
||||
android.injected.testOnly=false
|
||||
|
||||
APP_VERSION_NAME=1.0.0
|
||||
APP_VERSION_CODE=110
|
||||
APP_VERSION_CODE=111
|
||||
|
||||
org.gradle.jvm.toolchain.useLegacyAdapters=false
|
||||
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15
|
||||
|
||||
@@ -156,6 +156,9 @@ dependencies {
|
||||
api(libs.zcw.togglebutton.library)
|
||||
//图片模糊
|
||||
api(libs.com.github.mmin18.realtimeblurview)
|
||||
|
||||
api 'com.baoyz.actionsheet:library:1.1.7'
|
||||
|
||||
//播放器
|
||||
//腾讯直播sdk
|
||||
api('com.tencent.liteav:LiteAVSDK_Professional:10.9.0.13102')
|
||||
|
||||
@@ -23,4 +23,5 @@ public class GiftBean {
|
||||
private String nickname;
|
||||
private int count;
|
||||
private String user_id;
|
||||
private int num;
|
||||
}
|
||||
|
||||
@@ -91,6 +91,9 @@ public class RoomMessageEvent {
|
||||
private BlindBoxBean.XlhData xlh_data;
|
||||
private String from_pit_number;
|
||||
private String to_pit_number;
|
||||
|
||||
private String gift_num;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
@@ -137,6 +137,7 @@ public class BlindBoxBean {
|
||||
private String gift_name;
|
||||
private String base_image;
|
||||
private String gift_num;
|
||||
private String gift_price;
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.xscm.moduleutil.bean.blindboxwheel;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/4
|
||||
*@description: 巡乐会抽奖
|
||||
*/
|
||||
@Data
|
||||
public class XlhDrawBean {
|
||||
private int gift_id;
|
||||
private String gift_name;
|
||||
private String gift_base_image;
|
||||
private String gift_price;
|
||||
private int count ;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class EMMessageInfo implements MultiItemEntity {
|
||||
///巡乐会
|
||||
public static final int QXRoomMessageTypeXlh = 1057;
|
||||
|
||||
///
|
||||
///房间内换麦
|
||||
public static final int QXRoomMessageTypehm = 1039;
|
||||
private RoomMessageEvent emMessage;
|
||||
|
||||
|
||||
@@ -86,6 +86,9 @@ public class WebViewDialog extends BaseDialog<WebViewDialogBinding> {
|
||||
}else if (type==12){
|
||||
mBinding.gzCl.setBackgroundResource(R.mipmap.skzj);
|
||||
mBinding.imGz.setImageResource(R.mipmap.skzj_gz);
|
||||
}else if (type==13){
|
||||
mBinding.gzCl.setBackgroundResource(R.mipmap.xlh);
|
||||
mBinding.imGz.setImageResource(R.mipmap.xlh_gz);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ 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 java.util.List;
|
||||
|
||||
@@ -22,6 +23,8 @@ public class GiftLotteryContacts {
|
||||
|
||||
void finishRefreshLoadMore();
|
||||
void wallet(WalletBean walletBean);
|
||||
|
||||
void xlhChouSuccess(List<XlhDrawBean> data);
|
||||
}
|
||||
|
||||
public interface IRoomPre extends IPresenter {
|
||||
@@ -36,5 +39,11 @@ public class GiftLotteryContacts {
|
||||
void wallet();
|
||||
|
||||
void xlh(String room_id);
|
||||
|
||||
void xlhChou(String room_id,String num);
|
||||
|
||||
void xlhAllRecord(String room_id,String page,String pageSize);
|
||||
|
||||
void xlhMyRecord(String room_id,String page,String pageSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import android.widget.GridView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
@@ -30,6 +31,7 @@ import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||
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.DialogGiftLotteryBinding;
|
||||
import com.xscm.moduleutil.dialog.WebViewDialog;
|
||||
import com.xscm.moduleutil.event.LotteryEvent;
|
||||
@@ -91,6 +93,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
private int type;//10:对应天空之境 11:对应岁月之城 12:对应时空之巅
|
||||
private GiftLotteryDialogFragment giftLotteryDialogFragment;
|
||||
private String blind_box_turntable_id = "";//本次抽奖标识id
|
||||
private BlindBoxBean.XlhData xlhData;
|
||||
|
||||
@Override
|
||||
protected GiftLotteryPresenter bindPresenter() {
|
||||
@@ -361,7 +364,17 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
giftLotteryDialogFragment = GiftLotteryDialogFragment.newInstance(giftBagId);
|
||||
giftLotteryDialogFragment.show(getChildFragmentManager(), "GiftLotteryDialogFragment");
|
||||
}else if (id == R.id.tv_start){
|
||||
|
||||
if (xlhData!=null){
|
||||
if (xlhData.getStatus()==1){
|
||||
FragmentManager fm = getParentFragmentManager();
|
||||
if (fm != null && !fm.isDestroyed()) {
|
||||
TourClubDialogFragment newDialog = TourClubDialogFragment.newInstance(
|
||||
roomId);
|
||||
newDialog.show(fm, "TourClubDialogFragment");
|
||||
}
|
||||
this.dismissAllowingStateLoss();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -651,7 +664,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
|
||||
private void UpView(BlindBoxBean.XlhData xlhData) {
|
||||
if (xlhData != null) {
|
||||
|
||||
this.xlhData = xlhData;
|
||||
int currentNum = xlhData.getCurrent_num();
|
||||
int startNum = Integer.parseInt(xlhData.getStart_num());
|
||||
int waitingStartNum = Integer.parseInt(xlhData.getWaiting_start_num());
|
||||
@@ -689,8 +702,8 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
mBinding.pinnacleTime.tvStart.setBackgroundResource(R.mipmap.zhensgh);
|
||||
} else if (xlhData.getStatus() == 2) {
|
||||
mBinding.mirroeSky.tvStart.setBackgroundResource(R.mipmap.jijang);
|
||||
mBinding.cityTime.tvStart.setBackgroundResource(R.mipmap.zhensgh);
|
||||
mBinding.pinnacleTime.tvStart.setBackgroundResource(R.mipmap.zhensgh);
|
||||
mBinding.cityTime.tvStart.setBackgroundResource(R.mipmap.jijang);
|
||||
mBinding.pinnacleTime.tvStart.setBackgroundResource(R.mipmap.jijang);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -768,6 +781,11 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void xlhChouSuccess(List<XlhDrawBean> data) {
|
||||
|
||||
}
|
||||
|
||||
// TODO: 2025/8/29 接收im推送过来的消息
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMusicPlay(RoomMessageEvent message) {
|
||||
|
||||
@@ -23,6 +23,7 @@ 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.DialogGiftLotteryFragmentBinding;
|
||||
import com.xscm.moduleutil.widget.pagerecyclerview.PagerGridSnapHelper;
|
||||
|
||||
@@ -134,20 +135,6 @@ public class GiftLotteryDialogFragment extends BaseMvpDialogFragment<GiftLottery
|
||||
mBinding.textView1.setOnClickListener(this::onClick);
|
||||
mBinding.textView2.setOnClickListener(this::onClick);
|
||||
|
||||
// 根据屏幕密度调整行数和列数
|
||||
int rows, columns;
|
||||
float density = this.getResources().getDisplayMetrics().density;
|
||||
|
||||
if (density <= 2.0) { // 低密度屏幕(如mdpi, hdpi)
|
||||
rows = 3;
|
||||
columns = 3;
|
||||
} else if (density <= 3.0) { // 中密度屏幕(如xhdpi)
|
||||
rows = 4;
|
||||
columns = 3;
|
||||
} else { // 高密度屏幕(如xxhdpi, xxxhdpi)
|
||||
rows = 5;
|
||||
columns = 3;
|
||||
}
|
||||
adapter=new GiftLotteryAdapter();
|
||||
giftRecordAdapte=new GiftRecordAdapte();
|
||||
|
||||
@@ -258,4 +245,9 @@ public class GiftLotteryDialogFragment extends BaseMvpDialogFragment<GiftLottery
|
||||
public void wallet(WalletBean walletBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void xlhChouSuccess(List<XlhDrawBean> data) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ 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.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
@@ -124,10 +125,82 @@ public class GiftLotteryPresenter extends BasePresenter<GiftLotteryContacts.View
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
///巡乐会
|
||||
@Override
|
||||
public void xlh(String room_id) {
|
||||
// api.xlh(room_id, new BaseObserver<String>() {)
|
||||
|
||||
api.getBoxGiftListXLH(room_id, new BaseObserver<BlindBoxBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable( d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BlindBoxBean blindBoxBeans) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().getGiftListSuccess(blindBoxBeans);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void xlhChou(String room_id, String num) {
|
||||
api.xlhChou(room_id,num, new BaseObserver<List<XlhDrawBean>>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<XlhDrawBean> xlhDrawBeans) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().xlhChouSuccess(xlhDrawBeans);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<GiftBean> giftBean) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().getAllRecordSuccess(giftBean);
|
||||
MvpRef.get().finishRefreshLoadMore();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void xlhMyRecord(String room_id, String page, String pageSize) {
|
||||
api.xlhMyRecord(room_id,page,pageSize,new BaseObserver<List<GiftBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<GiftBean> giftBeans) {
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().getMyRecordSuccess(giftBeans);
|
||||
MvpRef.get().finishRefreshLoadMore();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.xscm.moduleutil.dialog.giftLottery;
|
||||
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.widget.TextView;
|
||||
|
||||
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 GiftRecordAdapter extends BaseQuickAdapter<GiftBean, BaseViewHolder> {
|
||||
|
||||
|
||||
public GiftRecordAdapter() {
|
||||
super(R.layout.item_my_record);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, GiftBean item) {
|
||||
helper.setText(R.id.tv_gift_time, item.getCreatetime());
|
||||
ImageUtils.loadHeadCC(item.getBase_image(),helper.getView(R.id.iv_gift_image));
|
||||
// 使用 SpannableString 给 "x4" 设置不同颜色
|
||||
TextView giftNameTextView = helper.getView(R.id.tv_gift_name);
|
||||
if (giftNameTextView != null) {
|
||||
String baseName = item.getGift_name();
|
||||
String countText = "x"+item.getCount();
|
||||
String fullText = baseName + countText;
|
||||
|
||||
SpannableStringBuilder spannable = new SpannableStringBuilder(fullText);
|
||||
|
||||
// 给 "x4" 部分设置颜色
|
||||
spannable.setSpan(
|
||||
new ForegroundColorSpan(mContext.getResources().getColor(R.color.color_C7BF62)), // 替换为实际颜色
|
||||
baseName.length(),
|
||||
fullText.length(),
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
);
|
||||
|
||||
giftNameTextView.setText(spannable);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
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 GiftXlhChouAdapter extends BaseQuickAdapter<GiftBean, BaseViewHolder> {
|
||||
public GiftXlhChouAdapter() {
|
||||
super(R.layout.item_xlh);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, GiftBean item) {
|
||||
helper.setText(R.id.tv_gift_name, item.getGift_name());
|
||||
helper.setText(R.id.tv_gift_pic, item.getGift_price());
|
||||
ImageUtils.loadHeadCC(item.getBase_image(),helper.getView(R.id.iv_gift_image));
|
||||
}
|
||||
}
|
||||
@@ -21,10 +21,11 @@ import com.xscm.moduleutil.utils.ImageUtils;
|
||||
*/
|
||||
public class PrizePoolAdapter extends BaseQuickAdapter<GiftBean, BaseViewHolder> {
|
||||
private Context context;
|
||||
private int type;
|
||||
|
||||
public PrizePoolAdapter() {
|
||||
public PrizePoolAdapter(int type) {
|
||||
super(R.layout.item_prize_pool);
|
||||
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +33,13 @@ public class PrizePoolAdapter extends BaseQuickAdapter<GiftBean, BaseViewHolder>
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, GiftBean item) {
|
||||
|
||||
if (type == 10 || type == 12){
|
||||
helper.setImageResource(R.id.iv_prize_pool,R.mipmap.tkzj_z);
|
||||
}else {
|
||||
helper.setImageResource(R.id.iv_prize_pool,R.mipmap.xlh_hd);
|
||||
}
|
||||
|
||||
helper.setText(R.id.tv_gift_name, item.getGift_name());
|
||||
helper.setText(R.id.tv_gift_pic, item.getGift_price());
|
||||
ImageUtils.loadHeadCC(item.getBase_image(),helper.getView(R.id.iv_gift_image));
|
||||
|
||||
@@ -88,6 +88,9 @@ public class PrizePoolDialog extends BaseDialog<DialogPrizePoolBinding> {
|
||||
} else if (type == 12) {
|
||||
mBinding.clPrize.setBackgroundResource(R.mipmap.skzj);
|
||||
mBinding.imJc.setImageResource(R.mipmap.skzl_jc);
|
||||
}else if (type == 13){
|
||||
mBinding.clPrize.setBackgroundResource(R.mipmap.xlh);
|
||||
mBinding.imJc.setImageResource(R.mipmap.xlh_jc);
|
||||
}
|
||||
|
||||
// 根据屏幕密度调整行数和列数
|
||||
@@ -108,7 +111,7 @@ public class PrizePoolDialog extends BaseDialog<DialogPrizePoolBinding> {
|
||||
if (newData != null && !newData.isEmpty()) {
|
||||
this.gift_list = newData;
|
||||
if (mBinding != null && mContext != null) {
|
||||
PrizePoolAdapter prizePoolAdapter = new PrizePoolAdapter();
|
||||
PrizePoolAdapter prizePoolAdapter = new PrizePoolAdapter(type);
|
||||
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 3);
|
||||
// PagerGridLayoutManager layoutManager = new PagerGridLayoutManager(rows, columns, PagerGridLayoutManager.VERTICAL);
|
||||
mBinding.gvGift.setLayoutManager(layoutManager);
|
||||
|
||||
@@ -1,29 +1,87 @@
|
||||
package com.xscm.moduleutil.dialog.giftLottery;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.blankj.utilcode.util.TimeUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
import com.xscm.moduleutil.bean.GiftBean;
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||
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.FragmentTourClubDialogBinding;
|
||||
import com.xscm.moduleutil.dialog.WebViewDialog;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.widget.InfintLinearLayoutManager;
|
||||
import com.xscm.moduleutil.widget.pagerecyclerview.PagerGridSnapHelper;
|
||||
|
||||
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 TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPresenter, FragmentTourClubDialogBinding> implements GiftLotteryContacts.View {
|
||||
private String roomId;
|
||||
private List<GiftBean> giftLists = new ArrayList<>();
|
||||
private String getRule_url;
|
||||
private CountDownTimer mCountDownTimer;
|
||||
private long endTime; // 服务器返回的结束时间戳
|
||||
private String num;
|
||||
private XlhRankingDialog xlhRankingDialog;
|
||||
private XlhRecordDialog xlhRecordDialog;
|
||||
|
||||
private GiftXlhChouAdapter giftXlhChouAdapter;
|
||||
|
||||
@Override
|
||||
protected GiftLotteryPresenter bindPresenter() {
|
||||
return new GiftLotteryPresenter(this, getActivity());
|
||||
}
|
||||
|
||||
public static TourClubDialogFragment newInstance(String roomId) {
|
||||
TourClubDialogFragment dialog = new TourClubDialogFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString("roomId", roomId);
|
||||
dialog.setArguments(args);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
Dialog dialog = super.onCreateDialog(savedInstanceState);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setCancelable(true);
|
||||
if (!EventBus.getDefault().isRegistered(this))
|
||||
EventBus.getDefault().register(this);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
roomId = getArguments().getString("roomId");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
MvpPre.xlh(roomId);
|
||||
MvpPre.wallet();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -31,6 +89,7 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
super.initDialogStyle(window);
|
||||
window.setGravity(Gravity.BOTTOM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
@@ -50,21 +109,73 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
window.setWindowAnimations(R.style.CommonShowDialogBottom);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.tvJc.setOnClickListener(this::onClick);
|
||||
mBinding.llOne.setOnClickListener(this::onClick);
|
||||
mBinding.llTen.setOnClickListener(this::onClick);
|
||||
mBinding.llHundred.setOnClickListener(this::onClick);
|
||||
mBinding.tvGz.setOnClickListener(this::onClick);
|
||||
mBinding.tvBd.setOnClickListener(this::onClick);
|
||||
mBinding.tvJl.setOnClickListener(this::onClick);
|
||||
|
||||
giftXlhChouAdapter=new GiftXlhChouAdapter();
|
||||
GridLayoutManager layoutManager = new GridLayoutManager(getActivity(), 3);
|
||||
|
||||
mBinding.recycleView.setLayoutManager(new InfintLinearLayoutManager(mBinding.recycleView));
|
||||
mBinding.recycleView.setOnFlingListener(null);
|
||||
// 设置滚动辅助工具
|
||||
PagerGridSnapHelper pageSnapHelper = new PagerGridSnapHelper();
|
||||
pageSnapHelper.attachToRecyclerView(mBinding.recycleView);
|
||||
mBinding.recycleView.setAdapter(giftXlhChouAdapter);
|
||||
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id==R.id.tv_jc){
|
||||
// if (giftLists != null && !giftLists.isEmpty()) {
|
||||
// PrizePoolDialog prizePoolDialog = new PrizePoolDialog(getActivity());
|
||||
// prizePoolDialog.updateData(giftLists, type);
|
||||
// prizePoolDialog.show();
|
||||
// } else {
|
||||
// com.hjq.toast.ToastUtils.show("奖池数据加载中,请稍后再试");
|
||||
// }
|
||||
if (id == R.id.tv_jc) {
|
||||
if (giftLists != null && !giftLists.isEmpty()) {
|
||||
PrizePoolDialog prizePoolDialog = new PrizePoolDialog(getActivity());
|
||||
prizePoolDialog.updateData(giftLists, 13);
|
||||
prizePoolDialog.show();
|
||||
} else {
|
||||
com.hjq.toast.ToastUtils.show("奖池数据加载中,请稍后再试");
|
||||
}
|
||||
} else if (id == R.id.ll_one) {
|
||||
num="1";
|
||||
MvpPre.xlhChou(roomId,num);
|
||||
|
||||
} else if (id == R.id.ll_ten) {
|
||||
num="10";
|
||||
MvpPre.xlhChou(roomId,num);
|
||||
|
||||
} else if (id == R.id.ll_hundred) {
|
||||
num="100";
|
||||
MvpPre.xlhChou(roomId,num);
|
||||
|
||||
}else if (id == R.id.tv_gz){
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("url", getRule_url);
|
||||
bundle.putInt("type", 13);
|
||||
WebViewDialog dialog = new WebViewDialog(getActivity(), bundle);
|
||||
dialog.show();
|
||||
}else if (id == R.id.tv_bd){
|
||||
// 如果当前dialog存在且正在显示,先关闭
|
||||
if (xlhRankingDialog != null && xlhRankingDialog.isVisible()) {
|
||||
xlhRankingDialog.dismiss();
|
||||
}
|
||||
|
||||
xlhRankingDialog = XlhRankingDialog.newInstance(roomId);
|
||||
xlhRankingDialog.show(getChildFragmentManager(), "XlhRankingDialog");
|
||||
}else if (id == R.id.tv_jl){
|
||||
// 如果当前dialog存在且正在显示,先关闭
|
||||
if (xlhRecordDialog != null && xlhRecordDialog.isVisible()) {
|
||||
xlhRecordDialog.dismiss();
|
||||
}
|
||||
|
||||
xlhRecordDialog = XlhRecordDialog.newInstance(roomId);
|
||||
xlhRecordDialog.show(getChildFragmentManager(), "XlhRecordDialog");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,9 +186,147 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
|
||||
@Override
|
||||
public void getGiftListSuccess(BlindBoxBean blindBoxBean) {
|
||||
if (blindBoxBean != null) {
|
||||
getRule_url=blindBoxBean.getRule_url();
|
||||
upTitle(blindBoxBean.getBox_price());
|
||||
giftLists = blindBoxBean.getGift_list();
|
||||
|
||||
// 获取结束时间并启动倒计时
|
||||
if (blindBoxBean.getXlh_end_time() != null && !blindBoxBean.getXlh_end_time().isEmpty()) {
|
||||
try {
|
||||
// 假设 end_time 是时间戳字符串
|
||||
endTime = Long.parseLong(blindBoxBean.getXlh_end_time());
|
||||
startCountdown();
|
||||
} catch (NumberFormatException e) {
|
||||
// 如果不是时间戳,可能是日期字符串,需要相应解析
|
||||
// 例如:2025-08-26 19:10:47
|
||||
// 可以使用 SimpleDateFormat 解析
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (blindBoxBean.getGive_homeowner_gift() != null) {
|
||||
ImageUtils.loadHeadCC(blindBoxBean.getGive_homeowner_gift().getBase_image(), mBinding.giveIm);
|
||||
}
|
||||
if (blindBoxBean.getLocking_gift()!=null){
|
||||
ImageUtils.loadHeadCC(blindBoxBean.getLocking_gift().getBase_image(), mBinding.giftImg);
|
||||
mBinding.tvGiftName.setText(blindBoxBean.getLocking_gift().getGift_name());
|
||||
mBinding.tvGiftPrice.setText(blindBoxBean.getLocking_gift().getGift_price());
|
||||
mBinding.tvGiftCount.setText(blindBoxBean.getLocking_gift().getGift_num());
|
||||
}
|
||||
|
||||
if (blindBoxBean.getXlh_user()!=null){
|
||||
ImageUtils.loadHeadCC(blindBoxBean.getXlh_user().getAvatar(), mBinding.userPic);
|
||||
mBinding.userName.setText(blindBoxBean.getXlh_user().getNickname());
|
||||
}
|
||||
|
||||
giftXlhChouAdapter.setNewData(giftLists);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: 2025/9/4 设置底部按钮文字
|
||||
private void upTitle(int boxPrice){
|
||||
mBinding.tvOne.setText(boxPrice+"币一次");
|
||||
mBinding.tvTen.setText((boxPrice*10)+"币十次");
|
||||
mBinding.tvHundred.setText((boxPrice*100)+"币十次");
|
||||
}
|
||||
|
||||
// TODO: 2025/8/29 接收im推送过来的消息
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMusicPlay(RoomMessageEvent message) {
|
||||
if (message.getMsgType() == 1057){
|
||||
// UpView(message.getText().getXlh_data());
|
||||
endTime=Long.parseLong(message.getText().getEnd_time());
|
||||
startCountdown();
|
||||
mBinding.tvGiftCount.setText(message.getText().getGift_num());
|
||||
mBinding.userName.setText(message.getText().getFromUserInfo().getNickname());
|
||||
ImageUtils.loadHeadCC(message.getText().getFromUserInfo().getAvatar(), mBinding.userPic);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 启动倒计时
|
||||
*/
|
||||
private void startCountdown() {
|
||||
// 先释放之前的倒计时器
|
||||
releaseCountDownTimer();
|
||||
|
||||
// 获取当前时间
|
||||
long currentTime = System.currentTimeMillis() / 1000; // 转换为秒
|
||||
long countdownTime = endTime - currentTime; // 计算剩余时间(秒)
|
||||
|
||||
// 如果倒计时时间已经结束,显示00:00
|
||||
if (countdownTime <= 0) {
|
||||
updateCountdownDisplay(0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// 确保不超过最大时间59:59 (3599秒)
|
||||
countdownTime = Math.min(countdownTime, 3599);
|
||||
|
||||
mCountDownTimer = new CountDownTimer(countdownTime * 1000, 1000) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
long seconds = millisUntilFinished / 1000;
|
||||
long minutes = seconds / 60;
|
||||
long remainingSeconds = seconds % 60;
|
||||
updateCountdownDisplay((int) minutes, (int) remainingSeconds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
updateCountdownDisplay(0, 0);
|
||||
}
|
||||
};
|
||||
|
||||
mCountDownTimer.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新倒计时显示
|
||||
* @param minutes 分钟数
|
||||
* @param seconds 秒数
|
||||
*/
|
||||
private void updateCountdownDisplay(int minutes, int seconds) {
|
||||
// 假设布局中有以下TextView:
|
||||
// mBinding.tvMinutes 十位分钟
|
||||
// mBinding.tvMinutesUnit 个位分钟
|
||||
// mBinding.tvSeconds 十位秒数
|
||||
// mBinding.tvSecondsUnit 个位秒数
|
||||
|
||||
// 分解分钟数
|
||||
int minutesTens = minutes / 10; // 十位分钟
|
||||
int minutesUnits = minutes % 10; // 个位分钟
|
||||
|
||||
// 分解秒数
|
||||
int secondsTens = seconds / 10; // 十位秒数
|
||||
int secondsUnits = seconds % 10; // 个位秒数
|
||||
|
||||
// 更新UI显示(根据你的实际布局调整)
|
||||
mBinding.tvTime1.setText(String.valueOf(minutesTens));
|
||||
mBinding.tvTime2.setText(String.valueOf(minutesUnits));
|
||||
mBinding.tvTime3.setText(String.valueOf(secondsTens));
|
||||
mBinding.tvTime4.setText(String.valueOf(secondsUnits));
|
||||
|
||||
// 或者如果是一个整体的显示:
|
||||
// mBinding.tvCountdown.setText(String.format("%02d:%02d", minutes, seconds));
|
||||
}
|
||||
/**
|
||||
* 释放倒计时器资源
|
||||
*/
|
||||
private void releaseCountDownTimer() {
|
||||
if (mCountDownTimer != null) {
|
||||
mCountDownTimer.cancel();
|
||||
mCountDownTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
releaseCountDownTimer();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void drawGiftListSuccess(BlindReslutBean blindReslutBean) {
|
||||
|
||||
@@ -100,6 +349,35 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
|
||||
@Override
|
||||
public void wallet(WalletBean walletBean) {
|
||||
if (walletBean != null) {
|
||||
mBinding.tvIcon.setText(walletBean.getCoin());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void xlhChouSuccess(List<XlhDrawBean> data) {
|
||||
if (data != null){
|
||||
// 创建并显示对话框
|
||||
XlhObtainDialog dialog = new XlhObtainDialog(getActivity());
|
||||
dialog.setOnGiftItemClickListener(new XlhObtainDialog.OnGiftItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onPlayAgainClick() {
|
||||
// 处理再玩一次点击事件
|
||||
MvpPre.xlhChou(roomId,num);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCloseClick() {
|
||||
// 处理关闭点击事件
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
dialog.show();
|
||||
dialog.setGiftList(data);
|
||||
|
||||
}
|
||||
MvpPre.wallet();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,20 +5,42 @@ import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
|
||||
import com.xscm.moduleutil.databinding.DialogHeavenGiftBinding;
|
||||
import com.xscm.moduleutil.databinding.DialogXlhObtainBinding;
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/2
|
||||
*@description: 巡乐会恭喜或得礼弹窗
|
||||
* @author qx
|
||||
* @data 2025/9/2
|
||||
* @description: 巡乐会恭喜或得礼弹窗
|
||||
*/
|
||||
public class XlhObtainDialog extends BaseDialog<DialogXlhObtainBinding> {
|
||||
|
||||
public interface OnGiftItemClickListener {
|
||||
|
||||
void onPlayAgainClick();
|
||||
|
||||
void onCloseClick();
|
||||
}
|
||||
|
||||
private GiftItemAdapter mAdapter;
|
||||
private OnGiftItemClickListener mListener;
|
||||
private List<XlhDrawBean> mGiftList;
|
||||
|
||||
public XlhObtainDialog(@NonNull Context context) {
|
||||
super(context,R.style.BaseDialogStyleH);
|
||||
super(context, R.style.BaseDialogStyleH);
|
||||
}
|
||||
|
||||
public XlhObtainDialog(@NonNull Context context, List<XlhDrawBean> giftList) {
|
||||
super(context, R.style.BaseDialogStyleH);
|
||||
this.mGiftList = giftList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -32,8 +54,44 @@ public class XlhObtainDialog extends BaseDialog<DialogXlhObtainBinding> {
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = getWindow();
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 375.f / 375), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
mBinding.xlhClose.setOnClickListener(v -> dismiss());
|
||||
mBinding.ivAgain.setOnClickListener(v -> dismiss());///在玩一次
|
||||
// 设置点击事件
|
||||
mBinding.xlhClose.setOnClickListener(v -> {
|
||||
if (mListener != null) {
|
||||
mListener.onCloseClick();
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
|
||||
mBinding.ivAgain.setOnClickListener(v -> {
|
||||
if (mListener != null) {
|
||||
mListener.onPlayAgainClick();
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
initRecyclerView();
|
||||
}
|
||||
private void initRecyclerView() {
|
||||
mAdapter = new GiftItemAdapter();
|
||||
mBinding.rvHead.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||
mBinding.rvHead.setAdapter(mAdapter);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置礼物数据
|
||||
*/
|
||||
public void setGiftList(List<XlhDrawBean> giftList) {
|
||||
this.mGiftList = giftList;
|
||||
if (mAdapter != null) {
|
||||
mAdapter.setNewData(giftList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置点击回调监听器
|
||||
*/
|
||||
public void setOnGiftItemClickListener(OnGiftItemClickListener listener) {
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
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.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
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.DialogGiftLotteryFragmentBinding;
|
||||
import com.xscm.moduleutil.databinding.DialogRankingXlhFragmentBinding;
|
||||
import com.xscm.moduleutil.widget.pagerecyclerview.PagerGridSnapHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/4
|
||||
*@description:巡乐会榜单
|
||||
*/
|
||||
public class XlhRankingDialog extends BaseMvpDialogFragment<GiftLotteryPresenter, DialogRankingXlhFragmentBinding> implements GiftLotteryContacts.View{
|
||||
private int page=1;
|
||||
private String roomId;
|
||||
private GiftRecordAdapte giftRecordAdapte;
|
||||
|
||||
@Override
|
||||
protected GiftLotteryPresenter bindPresenter() {
|
||||
return new GiftLotteryPresenter(this,getSelfActivity());
|
||||
}
|
||||
|
||||
public static XlhRankingDialog newInstance(String giftBagId) {
|
||||
Bundle args = new Bundle();
|
||||
XlhRankingDialog fragment = new XlhRankingDialog();
|
||||
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);
|
||||
roomId = getArguments().getString("roomId");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
MvpPre.xlhAllRecord(roomId, "1", "20");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
page = 1;
|
||||
MvpPre.xlhAllRecord(roomId, page+"", "20");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
MvpPre.xlhAllRecord(roomId, page+"", "20");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
giftRecordAdapte=new GiftRecordAdapte();
|
||||
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
|
||||
mBinding.recyclerView.setAdapter(giftRecordAdapte);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.dialog_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) {
|
||||
|
||||
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) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
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.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
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.DialogGiftLotteryFragmentBinding;
|
||||
import com.xscm.moduleutil.databinding.DialogXlhRecordFragmentBinding;
|
||||
import com.xscm.moduleutil.widget.pagerecyclerview.PagerGridSnapHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/4
|
||||
*@description:巡乐会记录
|
||||
*/
|
||||
public class XlhRecordDialog extends BaseMvpDialogFragment<GiftLotteryPresenter, DialogXlhRecordFragmentBinding> implements GiftLotteryContacts.View{
|
||||
|
||||
private int page=1;
|
||||
private String roomId;
|
||||
private GiftRecordAdapter adapter;
|
||||
|
||||
@Override
|
||||
protected GiftLotteryPresenter bindPresenter() {
|
||||
return new GiftLotteryPresenter(this,getSelfActivity());
|
||||
}
|
||||
|
||||
public static XlhRecordDialog newInstance(String roomId) {
|
||||
Bundle args = new Bundle();
|
||||
XlhRecordDialog fragment = new XlhRecordDialog();
|
||||
args.putString("roomId", roomId);
|
||||
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);
|
||||
roomId = getArguments().getString("roomId");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
MvpPre.xlhMyRecord(roomId, "1", "20");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
page = 1;
|
||||
MvpPre.xlhMyRecord(roomId, page+"", "20");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
MvpPre.xlhMyRecord(roomId, page+"", "20");
|
||||
}
|
||||
});
|
||||
adapter=new GiftRecordAdapter();
|
||||
GridLayoutManager layoutManager = new GridLayoutManager(getActivity(), 3);
|
||||
|
||||
mBinding.recyclerView.setLayoutManager(layoutManager);
|
||||
mBinding.recyclerView.setOnFlingListener(null);
|
||||
// 设置滚动辅助工具
|
||||
PagerGridSnapHelper pageSnapHelper = new PagerGridSnapHelper();
|
||||
pageSnapHelper.attachToRecyclerView(mBinding.recyclerView);
|
||||
mBinding.recyclerView.setAdapter(adapter);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.dialog_xlh_record_fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getGiftListSuccess(BlindBoxBean blindBoxBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawGiftListSuccess(BlindReslutBean blindReslutBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getMyRecordSuccess(List<GiftBean> data) {
|
||||
if (data != null){
|
||||
if (page==1){
|
||||
adapter.setNewData(data);
|
||||
}else {
|
||||
adapter.addData(data);
|
||||
}
|
||||
}else {
|
||||
if (page == 1) {
|
||||
adapter.setNewData(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAllRecordSuccess(List<GiftBean> data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefreshLoadMore() {
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
mBinding.smartRefreshLayout.finishLoadMore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wallet(WalletBean walletBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void xlhChouSuccess(List<XlhDrawBean> data) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,7 @@ import com.xscm.moduleutil.bean.WalletConfig;
|
||||
import com.xscm.moduleutil.bean.WithdrawalBean;
|
||||
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.bean.room.AuctionBean;
|
||||
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomApplyListBean;
|
||||
@@ -725,7 +726,7 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_ROOM_AUCTION_JOIN)
|
||||
Observable<BaseModel<RoomAuction.AuctionListBean>> roomAuctionJoin(@Field("auction_id") String auction_id, @Field("user_id") String user_id, @Field("gift_id") String gift_id, @Field("num") String num, @Field("type") String type);
|
||||
Call<BaseModel<RoomAuction.AuctionListBean>> roomAuctionJoin(@Field("auction_id") String auction_id, @Field("user_id") String user_id, @Field("gift_id") String gift_id, @Field("num") String num, @Field("type") String type);
|
||||
|
||||
|
||||
@FormUrlEncoded
|
||||
@@ -748,4 +749,18 @@ public interface ApiServer {
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.GIFT_SEND)
|
||||
Call<BaseModel<String>> giftSend(@Field("send_id")String send_id);
|
||||
|
||||
@GET(Constants.GET_BOX_GIFT_LIST_XLH)
|
||||
Call<BaseModel<BlindBoxBean>> getBoxGiftListXLH( @Query("room_id") String room_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_DRAW_GIFT_LIST_XLH)
|
||||
Call<BaseModel<List<XlhDrawBean>>> xlhChou(@Field("room_id") String room_id, @Field("num") String num);
|
||||
|
||||
@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);
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ import com.xscm.moduleutil.bean.WalletConfig;
|
||||
import com.xscm.moduleutil.bean.WithdrawalBean;
|
||||
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.bean.room.AuctionBean;
|
||||
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomApplyListBean;
|
||||
@@ -1121,7 +1122,21 @@ public class RetrofitClient {
|
||||
}
|
||||
|
||||
public void roomAuctionJoin(String auctionId, String userId, String giftId, String num, String type, BaseObserver<RoomAuction.AuctionListBean> observer) {
|
||||
sApiServer.roomAuctionJoin(auctionId, userId, giftId, num, type).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||
sApiServer.roomAuctionJoin(auctionId, userId, giftId, num, type).enqueue(new Callback<BaseModel<RoomAuction.AuctionListBean>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<RoomAuction.AuctionListBean>> call, Response<BaseModel<RoomAuction.AuctionListBean>> response) {
|
||||
if (response.code() == 200){
|
||||
BaseModel<RoomAuction.AuctionListBean> baseModel = response.body();
|
||||
observer.onNext(baseModel.getData());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<RoomAuction.AuctionListBean>> call, Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void auctionDelay(String auctionId, BaseObserver<String> observer) {
|
||||
@@ -2225,6 +2240,43 @@ public class RetrofitClient {
|
||||
}
|
||||
});
|
||||
}
|
||||
///巡乐会
|
||||
public void getBoxGiftListXLH( String roomId, BaseObserver<BlindBoxBean> observer){
|
||||
sApiServer.getBoxGiftListXLH(roomId).enqueue(new Callback<BaseModel<BlindBoxBean>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<BlindBoxBean>> call, Response<BaseModel<BlindBoxBean>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<BlindBoxBean> baseModel = response.body();
|
||||
observer.onNext(baseModel.getData());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<BlindBoxBean>> call, Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
///巡乐会抽奖
|
||||
public void xlhChou(String roomId, String num,BaseObserver<List<XlhDrawBean>> observer){
|
||||
sApiServer.xlhChou(roomId,num).enqueue(new Callback<BaseModel<List<XlhDrawBean>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<XlhDrawBean>>> call, Response<BaseModel<List<XlhDrawBean>>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<List<XlhDrawBean>> baseModel = response.body();
|
||||
observer.onNext(baseModel.getData());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<List<XlhDrawBean>>> call, Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
///盲盒转盘抽奖
|
||||
public void drawGiftList(String giftBagId, String gift_user_ids, String roomId, String num,BaseObserver<BlindReslutBean> observer){
|
||||
sApiServer.drawGiftList(giftBagId, gift_user_ids, roomId, num).enqueue(new Callback<BaseModel<BlindReslutBean>>() {
|
||||
@@ -2261,6 +2313,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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@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){
|
||||
sApiServer.xlhMyRecord(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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getAllRecord(String giftBagId,String page,String pageSize,BaseObserver<List<GiftBean>> observer){
|
||||
sApiServer.getAllRecord(giftBagId,page,pageSize).enqueue(new Callback<BaseModel<List<GiftBean>>>() {
|
||||
@Override
|
||||
|
||||
@@ -32,6 +32,9 @@ public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View>
|
||||
|
||||
@Override
|
||||
public void onNext(List<RewardUserBean> rewardUserBeans) {
|
||||
if (MvpRef==null){
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().getRewardList(rewardUserBeans);
|
||||
}
|
||||
});
|
||||
@@ -48,6 +51,9 @@ public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View>
|
||||
|
||||
@Override
|
||||
public void onNext(List<GiftLabelBean> giftLabelBeans) {
|
||||
if (MvpRef==null){
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().getGiftLabel(giftLabelBeans);
|
||||
}
|
||||
});
|
||||
@@ -65,6 +71,9 @@ public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View>
|
||||
|
||||
@Override
|
||||
public void onNext(List<RoonGiftModel> roonGiftModels) {
|
||||
if (MvpRef==null){
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().setGiftList(roonGiftModels, type);
|
||||
}
|
||||
});
|
||||
@@ -81,6 +90,9 @@ public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View>
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
if (MvpRef==null){
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().giveGift();
|
||||
}
|
||||
});
|
||||
@@ -115,6 +127,9 @@ public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View>
|
||||
|
||||
@Override
|
||||
public void onNext(WalletBean walletBean) {
|
||||
if (MvpRef==null){
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().wallet(walletBean);
|
||||
}
|
||||
});
|
||||
@@ -131,6 +146,9 @@ public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View>
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
if (MvpRef==null){
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().reward_zone();
|
||||
}
|
||||
});
|
||||
@@ -146,6 +164,9 @@ public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View>
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
if (MvpRef==null){
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().reward_zone();
|
||||
}
|
||||
});
|
||||
@@ -161,6 +182,9 @@ public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View>
|
||||
|
||||
@Override
|
||||
public void onNext(RoomAuction.AuctionListBean auctionListBean) {
|
||||
if (MvpRef==null){
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().roomAuctionJoin(auctionListBean);
|
||||
}
|
||||
});
|
||||
@@ -177,6 +201,9 @@ public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View>
|
||||
|
||||
@Override
|
||||
public void onNext(List<GiftPackBean> giftPackBeans) {
|
||||
if (MvpRef==null){
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().giftPack(giftPackBeans);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -380,6 +380,11 @@ public class Constants {
|
||||
public static final String GET_ALL_RECORD = "/api/BlindBoxTurntable/get_all_record";//获取全服抽奖记录
|
||||
public static final String GIFT_SEND = "/api/BlindBoxTurntable/gift_send";//礼物发放
|
||||
|
||||
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_XLH_MY_RECORD = "/api/BlindBoxTurntable/get_xlh_my_record";///巡乐会记录
|
||||
|
||||
|
||||
|
||||
public static final String MODIFY_MOBILE = "/api/UserData/modify_mobile";//手机换绑
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
package com.xscm.moduleutil.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.room.RoomPitBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class RoomSingWheatView extends LinearLayout {
|
||||
|
||||
public ImageView mRiv;
|
||||
public ImageView mIvGift;
|
||||
public WheatCharmView mCharmView;
|
||||
public TextView mTvName;
|
||||
public ImageView mIvSex;
|
||||
public AvatarFrameView mIvFrame;
|
||||
public AvatarFrameView mIvRipple;
|
||||
public ExpressionImgView mIvFace;
|
||||
public ImageView mIvShutup;
|
||||
public TextView tvTime;
|
||||
public TextView mTvNo;
|
||||
|
||||
public TextView tv_time_pk;
|
||||
|
||||
public RoomPitBean pitBean;//麦位数据
|
||||
public String roomId;//房间id
|
||||
|
||||
public static final String WHEAT_BOSS = "8";//老板位
|
||||
public static final String WHEAT_HOST = "9";//主持位
|
||||
|
||||
public float oX;
|
||||
public float oY;
|
||||
|
||||
boolean closePhone = false;//自己麦位关闭话筒,用于判断声纹显示
|
||||
|
||||
public String pitNumber;
|
||||
public int pitImageVId;
|
||||
|
||||
public ImageView iv_on_line;
|
||||
private boolean showGiftAnim = true;//显示麦位动画
|
||||
private ImageView iv_tag_type;
|
||||
|
||||
private TextView tv_zhul;
|
||||
|
||||
public RoomSingWheatView(@NonNull Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public RoomSingWheatView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public RoomSingWheatView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
private void initView(Context context) {
|
||||
// 确保布局被正确加载
|
||||
inflate(context, getLayoutId(), this);
|
||||
|
||||
// 初始化所有视图组件
|
||||
mRiv = findViewById(R.id.riv);
|
||||
mIvGift = findViewById(R.id.iv_gift);
|
||||
mCharmView = findViewById(R.id.charm_view);
|
||||
mTvName = findViewById(R.id.tv_name);
|
||||
mIvSex = findViewById(R.id.iv_sex);
|
||||
mIvFrame = findViewById(R.id.iv_frame);
|
||||
mIvRipple = findViewById(R.id.iv_ripple);
|
||||
mIvFace = findViewById(R.id.iv_face);
|
||||
mIvShutup = findViewById(R.id.iv_shutup);
|
||||
tvTime = findViewById(R.id.tv_time);
|
||||
tv_time_pk = findViewById(R.id.tv_time_pk);
|
||||
mTvNo = findViewById(R.id.tv_no);
|
||||
iv_on_line = findViewById(R.id.iv_online);
|
||||
iv_tag_type = findViewById(R.id.iv_tag_type);
|
||||
tv_zhul = findViewById(R.id.tv_zhul);
|
||||
|
||||
// 设置初始位置
|
||||
if (mIvGift != null) {
|
||||
oX = mIvGift.getX();
|
||||
oY = mIvGift.getY();
|
||||
}
|
||||
}
|
||||
|
||||
protected int getLayoutId() {
|
||||
return R.layout.room_view_sing_wheat;
|
||||
}
|
||||
|
||||
public void setData(RoomPitBean bean) {
|
||||
this.pitBean = bean;
|
||||
if (bean == null) return;
|
||||
|
||||
// 添加空值检查,防止NPE
|
||||
if (mTvName == null) {
|
||||
// 可能布局未正确加载,尝试重新初始化
|
||||
initView(getContext());
|
||||
if (mTvName == null) {
|
||||
// 如果仍然为null,记录日志并返回
|
||||
android.util.Log.e("RoomSingWheatView", "mTvName is still null after re-initialization");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (isOn()) {
|
||||
//开启声浪
|
||||
mIvRipple.startLoopingSvga("ripple3695.svga");
|
||||
mIvRipple.setVisibility(VISIBLE);
|
||||
mTvName.setText(bean.getNickname());
|
||||
ImageUtils.loadHeadCC(bean.getAvatar(), mRiv);
|
||||
|
||||
if (TextUtils.isEmpty(pitBean.getDress())) {
|
||||
if (mIvFrame != null) mIvFrame.setVisibility(INVISIBLE);
|
||||
} else {
|
||||
if (mIvFrame != null) {
|
||||
mIvFrame.setVisibility(VISIBLE);
|
||||
mIvFrame.setSource(pitBean.getDress(), 1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
String pitText = "-1".equals(pitNumber) ? "" :
|
||||
"9".equals(pitNumber) ? "主持位" :
|
||||
"10".equals(pitNumber) ? "嘉宾位" :
|
||||
pitNumber + "号麦位";
|
||||
mTvName.setText(pitText);
|
||||
|
||||
if (mIvFrame != null) mIvFrame.setVisibility(INVISIBLE);
|
||||
if (mIvFace != null) mIvFace.remove();
|
||||
//停止声浪
|
||||
mIvRipple.stopSvga();
|
||||
mIvRipple.setVisibility(GONE);
|
||||
}
|
||||
|
||||
// 更新魅力值视图
|
||||
if (mCharmView != null) {
|
||||
if (pitBean.getNickname() == null || pitBean.getNickname().isEmpty()) {
|
||||
mCharmView.setVisibility(GONE);
|
||||
} else {
|
||||
mCharmView.setVisibility(VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
// 更新PK状态
|
||||
if (tv_time_pk != null) {
|
||||
if (pitBean.is_pk() && pitBean.getUser_id() != null &&
|
||||
!pitBean.getUser_id().equals("0") && !pitBean.getUser_id().isEmpty()) {
|
||||
tv_time_pk.setVisibility(VISIBLE);
|
||||
if (mCharmView != null) mCharmView.setVisibility(GONE);
|
||||
} else {
|
||||
tv_time_pk.setVisibility(GONE);
|
||||
if (mCharmView != null) mCharmView.setVisibility(VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isOn() {
|
||||
return pitBean != null && !TextUtils.isEmpty(pitBean.getUser_id()) && !"0".equals(pitBean.getUser_id());
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_yx"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
@@ -152,10 +152,11 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@+id/lottery_buttons_layout"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift7"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ll_tx"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
@@ -191,7 +192,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@+id/lottery_buttons_layout"
|
||||
app:layout_constraintTop_toTopOf="@+id/ll_yx"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/ll_yx">
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_yx"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
@@ -153,9 +153,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@+id/lottery_buttons_layout"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift9"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ll_tx"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
@@ -191,7 +192,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@+id/lottery_buttons_layout"
|
||||
app:layout_constraintTop_toTopOf="@+id/ll_yx"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/ll_yx">
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_yx"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
@@ -153,9 +153,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@+id/lottery_buttons_layout"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift7"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ll_tx"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
@@ -191,7 +192,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@+id/lottery_buttons_layout"
|
||||
app:layout_constraintTop_toTopOf="@+id/ll_yx"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/ll_yx">
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_gift"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_195"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
@@ -179,7 +180,8 @@
|
||||
tools:text="请选择礼物" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_count"
|
||||
|
||||
android:id="@+id/tv_gift_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@mipmap/jinb"
|
||||
@@ -189,7 +191,7 @@
|
||||
tools:text="999" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_price"
|
||||
android:id="@+id/tv_gift_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
@@ -212,6 +214,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/give_im"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
app:layout_constraintStart_toStartOf="@+id/gift_l2"
|
||||
@@ -271,6 +274,14 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycle_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_gift"
|
||||
app:layout_constraintBottom_toTopOf="@+id/exchange_layout"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_option"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -363,12 +374,13 @@
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_one"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:drawableLeft="@mipmap/jinb"
|
||||
android:gravity="center"
|
||||
android:text="10币一次"
|
||||
tools:text="10币一次"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -393,12 +405,13 @@
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_ten"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:drawableLeft="@mipmap/jinb"
|
||||
android:gravity="center"
|
||||
android:text="100币一次"
|
||||
tools:text="100币一次"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -421,12 +434,13 @@
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hundred"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:drawableLeft="@mipmap/jinb"
|
||||
android:gravity="center"
|
||||
android:text="1000币一次"
|
||||
tools:text="1000币一次"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
56
moduleUtil/src/main/res/layout/item_my_record.xml
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:id="@+id/iv_prize_pool"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/xlh_xz"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_gift_image"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_prize_pool"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_prize_pool"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_prize_pool"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_prize_pool"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
tools:text="中奖名单"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_prize_pool"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_prize_pool"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_prize_pool"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="2025-8-28 18:41:53"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:textColor="#5B5B5B"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_gift_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_gift_name"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_gift_name"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
48
moduleUtil/src/main/res/layout/item_xlh.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_154"
|
||||
android:background="@mipmap/xlh_cj_item"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_gift_image"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_35"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_11"
|
||||
tools:text="中奖名单"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_gift_image"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_gift_image"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_gift_image"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_pic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="中奖名单"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:drawableLeft="@mipmap/jinb"
|
||||
android:drawablePadding="@dimen/dp_2"
|
||||
android:textColor="#C7BF62"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_gift_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_gift_name"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_gift_name"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
42
moduleUtil/src/main/res/layout/item_xlh_gift.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/gift_l"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/xlh_hd"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gift_img"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift_l"
|
||||
app:layout_constraintStart_toStartOf="@+id/gift_l"
|
||||
app:layout_constraintEnd_toEndOf="@+id/gift_l"
|
||||
tools:text="请选择礼物" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
BIN
moduleUtil/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 16 KiB |
BIN
moduleUtil/src/main/res/mipmap-hdpi/ic_launcher_app.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
moduleUtil/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
BIN
moduleUtil/src/main/res/mipmap-hdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
BIN
moduleUtil/src/main/res/mipmap-hdpi/ic_launcher_round_app.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
moduleUtil/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
BIN
moduleUtil/src/main/res/mipmap-mdpi/ic_launcher_app.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
moduleUtil/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
BIN
moduleUtil/src/main/res/mipmap-mdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
BIN
moduleUtil/src/main/res/mipmap-mdpi/ic_launcher_round_app.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
moduleUtil/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 22 KiB |
BIN
moduleUtil/src/main/res/mipmap-xhdpi/ic_launcher_app.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
moduleUtil/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 8.4 KiB |
BIN
moduleUtil/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
BIN
moduleUtil/src/main/res/mipmap-xhdpi/ic_launcher_round_app.png
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 42 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/ic_launcher_app.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 14 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 12 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/ic_launcher_round_app.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 62 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/ic_launcher_app.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 22 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 16 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/ic_launcher_round_app.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xlh.png
Normal file
|
After Width: | Height: | Size: 2.6 MiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xlh_bd.png
Normal file
|
After Width: | Height: | Size: 325 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xlh_cj_item.png
Normal file
|
After Width: | Height: | Size: 367 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xlh_gz.png
Normal file
|
After Width: | Height: | Size: 301 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xlh_hd.png
Normal file
|
After Width: | Height: | Size: 299 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xlh_jc.png
Normal file
|
After Width: | Height: | Size: 231 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xlh_jl.png
Normal file
|
After Width: | Height: | Size: 296 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xlh_xz.png
Normal file
|
After Width: | Height: | Size: 335 KiB |
25
moduleUtil/src/main/res/values-v23/themes.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="WarpLinearLayoutDefault">
|
||||
<!-- <item name="grivate">left</item>-->
|
||||
<!-- <item name="horizontal_Space">20dp</item>-->
|
||||
<!-- <item name="vertical_Space">20dp</item>-->
|
||||
<!-- <item name="isFull">false</item>-->
|
||||
</style>
|
||||
|
||||
<style name="AppTheme_MAIN" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimary</item>
|
||||
<item name="colorAccent">@color/colorPrimary</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- 给status栏设置透明颜色 -->
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<!-- true: status栏的图标和文字为黑色;false: sstatus栏的图标和文字为白色 -->
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
<item name="android:windowTranslucentStatus">false</item>
|
||||
|
||||
<item name="actionSheetStyle">@style/ActionSheetStyleiOS7</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -13,4 +13,19 @@
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
|
||||
<style name="AppTheme_MAIN" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimary</item>
|
||||
<item name="colorAccent">@color/colorPrimary</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!-- 给status栏设置透明颜色 -->
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<!-- true: status栏的图标和文字为黑色;false: sstatus栏的图标和文字为白色 -->
|
||||
<item name="android:windowTranslucentStatus">false</item>
|
||||
|
||||
<item name="actionSheetStyle">@style/ActionSheetStyleiOS7</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:icon="@mipmap/ic_launcher_app"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:roundIcon="@mipmap/ic_launcher_round_app"
|
||||
android:supportsRtl="true">
|
||||
<activity
|
||||
android:name=".activity.DynamicDetailActivity"
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:icon="@mipmap/ic_launcher_app"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:roundIcon="@mipmap/ic_launcher_round_app"
|
||||
android:supportsRtl="true"
|
||||
>
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:icon="@mipmap/ic_launcher_app"
|
||||
android:roundIcon="@mipmap/ic_launcher_round_app"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.QxLive">
|
||||
|
||||
|
||||
@@ -467,39 +467,68 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
if (giftGiveEvent == null || giftGiveEvent.roonGiftModel == null) {
|
||||
return;
|
||||
}
|
||||
// if (giftCountTimer != null) {
|
||||
// giftCountTimer.cancel();
|
||||
// giftCountTimer = null;
|
||||
// }
|
||||
RetrofitClient.getInstance().roomGift(giftGiveEvent.getRoom_id(), giftGiveEvent.getRoonGiftModel().getGift_id(), giftGiveEvent.getNum(), giftGiveEvent.getUserId(), "1", giftGiveEvent.getPit(), giftGiveEvent.heart_id, new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
if (giftGiveEvent.auction_id!=null && !giftGiveEvent.auction_id.isEmpty()){
|
||||
RetrofitClient.getInstance().roomAuctionJoin(giftGiveEvent.getAuction_id(), giftGiveEvent.getUserId(),giftGiveEvent.getRoonGiftModel().getGift_id(), giftGiveEvent.getNum(), "1", new BaseObserver<RoomAuction.AuctionListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
// showGiftGiveProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(RoomAuction.AuctionListBean auctionListBean) {
|
||||
showGiftGiveProgress();
|
||||
}
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
String msg = e.getMessage();
|
||||
if (!TextUtils.isEmpty(msg) && msg.contains("当前余额不足")) {
|
||||
com.hjq.toast.ToastUtils.show("当前余额不足,请充值");
|
||||
ThreadUtils.runOnUiThreadDelayed(() -> {
|
||||
RechargeDialogFragment fragment = RechargeDialogFragment.show(roomId, null, getSupportFragmentManager());
|
||||
if (fragment != null) {
|
||||
addActiveDialogFragment(fragment); // 添加到管理列表
|
||||
}
|
||||
}, 1400);
|
||||
}
|
||||
hideGiftGiveProgress();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}else {
|
||||
|
||||
RetrofitClient.getInstance().roomGift(giftGiveEvent.getRoom_id(), giftGiveEvent.getRoonGiftModel().getGift_id(), giftGiveEvent.getNum(), giftGiveEvent.getUserId(), "1", giftGiveEvent.getPit(), giftGiveEvent.heart_id, new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
// showGiftGiveProgress();
|
||||
// LogUtils.e("xj", "onSubscribe");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
showGiftGiveProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
String msg = e.getMessage();
|
||||
if (!TextUtils.isEmpty(msg) && msg.contains("当前余额不足")) {
|
||||
com.hjq.toast.ToastUtils.show("当前余额不足,请充值");
|
||||
ThreadUtils.runOnUiThreadDelayed(() -> {
|
||||
RechargeDialogFragment fragment = RechargeDialogFragment.show(roomId, null, getSupportFragmentManager());
|
||||
if (fragment != null) {
|
||||
addActiveDialogFragment(fragment); // 添加到管理列表
|
||||
}
|
||||
}, 1400);
|
||||
}
|
||||
hideGiftGiveProgress();
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
showGiftGiveProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
String msg = e.getMessage();
|
||||
if (!TextUtils.isEmpty(msg) && msg.contains("当前余额不足")) {
|
||||
com.hjq.toast.ToastUtils.show("当前余额不足,请充值");
|
||||
ThreadUtils.runOnUiThreadDelayed(() -> {
|
||||
RechargeDialogFragment fragment = RechargeDialogFragment.show(roomId, null, getSupportFragmentManager());
|
||||
if (fragment != null) {
|
||||
addActiveDialogFragment(fragment); // 添加到管理列表
|
||||
}
|
||||
}, 1400);
|
||||
}
|
||||
hideGiftGiveProgress();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private RoomGiftGiveEvent giftGiveEvent;
|
||||
@@ -1091,8 +1120,8 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
customMusicFloatingView.destroy();
|
||||
AgoraManager.getInstance(RoomActivity.this).desMusic();
|
||||
isMusic = false;
|
||||
mBinding.roomTop.rl.setVisibility(GONE);
|
||||
}
|
||||
mBinding.roomTop.rl.setVisibility(GONE);
|
||||
}
|
||||
|
||||
String typeId = mRoomInfoResp.getRoom_info().getType_id();
|
||||
@@ -2229,6 +2258,12 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
publicScreenFragment.getUpRoomInfo(resp);
|
||||
}
|
||||
instView();
|
||||
|
||||
if (mRoomInfoResp.getUser_info().getPit_number() == 9 && mRoomInfoResp.getUser_info().getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||
mBinding.roomTop.rl.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mBinding.roomTop.rl.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void instView() {//隐藏视图
|
||||
@@ -2722,9 +2757,10 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
/// 小黑屋退出房间后调用这个加入房间
|
||||
public void jiaR() {
|
||||
LogUtils.e("@@@", "上一个房间的roonid" + AgoraManager.getInstance(context).getLastRoomId());
|
||||
MvpPre.getRoomIn(AgoraManager.getInstance(context).getLastRoomId(), "");
|
||||
// MvpPre.getRoomIn(AgoraManager.getInstance(context).getLastRoomId(), "");
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "电影房").withString("roomId", AgoraManager.getInstance(context).getLastRoomId()).navigation();
|
||||
AgoraManager.getInstance(context).setLastRoomId("");
|
||||
setviewyc(true);
|
||||
// setviewyc(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -66,13 +66,7 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
|
||||
List currData = new ArrayList();
|
||||
if (type == SHOW_TYPE_ALL) {
|
||||
currData.addAll(allMsgList);
|
||||
// if (allMsgList.size() > 20) {
|
||||
// // 只添加最近的20条消息
|
||||
// int startIndex = Math.max(0, allMsgList.size() - 20);
|
||||
// currData.addAll(allMsgList.subList(startIndex, allMsgList.size()));
|
||||
// }else {
|
||||
// currData.addAll(allMsgList);
|
||||
// }
|
||||
|
||||
} else if (type == SHOW_TYPE_USER) {
|
||||
currData.addAll(userMsgList);
|
||||
} else if (type == SHOW_TYPE_SYSTEM) {
|
||||
@@ -455,26 +449,81 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
|
||||
|
||||
@Override
|
||||
public void addData(@NonNull EMMessageInfo data) {
|
||||
// super.addData(data);
|
||||
if (data.getItemType()==1) {
|
||||
allMsgList.add(data);
|
||||
}else if (data.getItemType() == 2) {
|
||||
userMsgList.add(data);
|
||||
allMsgList.add(data);
|
||||
} else if (data.getItemType() == 3) {
|
||||
systemMsgList.add(data);
|
||||
|
||||
// 添加到对应的存储列表
|
||||
addToStorageLists(data);
|
||||
|
||||
// 维护数据量限制
|
||||
maintainDataLimits();
|
||||
|
||||
// 根据显示类型决定是否添加到适配器
|
||||
if (shouldAddToAdapter(data)) {
|
||||
super.addData(data);
|
||||
// 确保适配器数据量也不超过限制
|
||||
if (mData.size() > 20) {
|
||||
int removeCount = mData.size() - 20;
|
||||
mData.subList(0, removeCount).clear();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
// 根据当前显示类型决定是否添加到适配器中
|
||||
boolean shouldAdd = (listShowType == SHOW_TYPE_ALL && (data.getItemType() == 1 || data.getItemType() == 2)) ||
|
||||
(listShowType == SHOW_TYPE_USER && data.getItemType() == 2) ||
|
||||
(listShowType == SHOW_TYPE_SYSTEM && data.getItemType() == 3);
|
||||
|
||||
if (shouldAdd) {
|
||||
super.addData(data);
|
||||
// if (data.getItemType()==1) {
|
||||
// allMsgList.add(data);
|
||||
// }else if (data.getItemType() == 2) {
|
||||
// userMsgList.add(data);
|
||||
// allMsgList.add(data);
|
||||
// } else if (data.getItemType() == 3) {
|
||||
// systemMsgList.add(data);
|
||||
// }
|
||||
// if (allMsgList.size() > 20) {
|
||||
// // 只添加最近的20条消息
|
||||
// int startIndex = Math.max(0, allMsgList.size() - 20);
|
||||
// allMsgList.subList(startIndex, allMsgList.size());
|
||||
// }
|
||||
// // 根据当前显示类型决定是否添加到适配器中
|
||||
// boolean shouldAdd = (listShowType == SHOW_TYPE_ALL && (data.getItemType() == 1 || data.getItemType() == 2)) ||
|
||||
// (listShowType == SHOW_TYPE_USER && data.getItemType() == 2) ||
|
||||
// (listShowType == SHOW_TYPE_SYSTEM && data.getItemType() == 3);
|
||||
//
|
||||
// if (shouldAdd) {
|
||||
// super.addData(data);
|
||||
// }
|
||||
}
|
||||
private void addToStorageLists(EMMessageInfo data) {
|
||||
switch (data.getItemType()) {
|
||||
case 1: // 系统消息
|
||||
allMsgList.add(data);
|
||||
break;
|
||||
case 2: // 用户消息
|
||||
userMsgList.add(data);
|
||||
allMsgList.add(data);
|
||||
break;
|
||||
case 3: // 系统消息类型3
|
||||
systemMsgList.add(data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void maintainDataLimits() {
|
||||
// 确保所有存储列表都不超过最大限制
|
||||
trimListToMaxSize(allMsgList);
|
||||
// trimListToMaxSize(userMsgList);
|
||||
// trimListToMaxSize(systemMsgList);
|
||||
}
|
||||
|
||||
private void trimListToMaxSize(List<EMMessageInfo> list) {
|
||||
if (list.size() > 20) {
|
||||
int removeCount = list.size() - 20;
|
||||
list.subList(0, removeCount).clear();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean shouldAddToAdapter(EMMessageInfo data) {
|
||||
return (listShowType == SHOW_TYPE_ALL && (data.getItemType() == 1 || data.getItemType() == 2)) ||
|
||||
(listShowType == SHOW_TYPE_USER && data.getItemType() == 2) ||
|
||||
(listShowType == SHOW_TYPE_SYSTEM && data.getItemType() == 3);
|
||||
}
|
||||
@Override
|
||||
public void addData(@NonNull Collection<? extends EMMessageInfo> newData) {
|
||||
// super.addData(newData);
|
||||
|
||||
@@ -29,15 +29,35 @@ public class ExitRoomBottomSheet extends BottomSheetDialogFragment {
|
||||
}
|
||||
|
||||
private OnOptionSelectedListener listener;
|
||||
private TextView tv_minimize;
|
||||
private static final String ARG_SHOW_MINIMIZE = "show_minimize";
|
||||
private static final String ARG_SHOW_EXIT = "show_exit";
|
||||
private static final String ARG_SHOW_CANCEL = "show_cancel";
|
||||
|
||||
public static ExitRoomBottomSheet newInstance() {
|
||||
return new ExitRoomBottomSheet();
|
||||
private boolean showMinimize = true;
|
||||
private boolean showExit = true;
|
||||
private boolean showCancel = true;
|
||||
|
||||
public static ExitRoomBottomSheet newInstance(boolean showMinimize, boolean showExit, boolean showCancel) {
|
||||
ExitRoomBottomSheet fragment = new ExitRoomBottomSheet();
|
||||
Bundle args = new Bundle();
|
||||
args.putBoolean(ARG_SHOW_MINIMIZE, showMinimize);
|
||||
args.putBoolean(ARG_SHOW_EXIT, showExit);
|
||||
args.putBoolean(ARG_SHOW_CANCEL, showCancel);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
public static ExitRoomBottomSheet newInstance() {
|
||||
return newInstance(true, true, true);
|
||||
}
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
showMinimize = getArguments().getBoolean(ARG_SHOW_MINIMIZE, true);
|
||||
showExit = getArguments().getBoolean(ARG_SHOW_EXIT, true);
|
||||
showCancel = getArguments().getBoolean(ARG_SHOW_CANCEL, true);
|
||||
}
|
||||
setStyle(STYLE_NORMAL, com.xscm.moduleutil.R.style.AppBottomSheetDialogTheme); // 自定义样式(可选)
|
||||
setCancelable(true); // 点击外部可关闭
|
||||
}
|
||||
@@ -47,18 +67,31 @@ public class ExitRoomBottomSheet extends BottomSheetDialogFragment {
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.dialog_exit_room_bottom_sheet, container, false);
|
||||
tv_minimize = view.findViewById(R.id.tv_minimize);
|
||||
view.findViewById(R.id.tv_minimize).setOnClickListener(v -> {
|
||||
TextView tv_minimize = view.findViewById(R.id.tv_minimize);
|
||||
TextView tv_exit_room = view.findViewById(R.id.tv_exit_room);
|
||||
TextView tv_cancel = view.findViewById(R.id.tv_cancel);
|
||||
|
||||
// 根据参数设置按钮可见性
|
||||
if (tv_minimize != null) {
|
||||
tv_minimize.setVisibility(showMinimize ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
if (tv_exit_room != null) {
|
||||
tv_exit_room.setVisibility(showExit ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
if (tv_cancel != null) {
|
||||
tv_cancel.setVisibility(showCancel ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
tv_minimize.setOnClickListener(v -> {
|
||||
if (listener != null) listener.onMinimize();
|
||||
dismiss();
|
||||
});
|
||||
|
||||
view.findViewById(R.id.tv_exit_room).setOnClickListener(v -> {
|
||||
tv_exit_room.setOnClickListener(v -> {
|
||||
if (listener != null) listener.onExitRoom();
|
||||
dismiss();
|
||||
});
|
||||
|
||||
view.findViewById(R.id.tv_cancel).setOnClickListener(v -> {
|
||||
tv_cancel.setOnClickListener(v -> {
|
||||
if (listener != null) listener.onCancel();
|
||||
dismiss();
|
||||
});
|
||||
@@ -66,9 +99,6 @@ public class ExitRoomBottomSheet extends BottomSheetDialogFragment {
|
||||
return view;
|
||||
}
|
||||
|
||||
public void setViewUp(boolean isUp) {
|
||||
tv_minimize.setVisibility(isUp ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
public void setOnOptionSelectedListener(OnOptionSelectedListener listener) {
|
||||
this.listener = listener;
|
||||
|
||||
@@ -292,17 +292,34 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
contentView.findViewById(R.id.action_report).setOnClickListener(listener);
|
||||
contentView.findViewById(R.id.action_blacklist).setOnClickListener(listener);
|
||||
|
||||
if (type != 1) {
|
||||
if (type==1){
|
||||
contentView.findViewById(R.id.action_set_manager).setVisibility(VISIBLE);
|
||||
contentView.findViewById(R.id.action_kick_out).setVisibility(VISIBLE);
|
||||
contentView.findViewById(R.id.action_set_host).setVisibility(VISIBLE);
|
||||
}else if (type==2){
|
||||
contentView.findViewById(R.id.action_set_manager).setVisibility(GONE);
|
||||
contentView.findViewById(R.id.action_kick_out).setVisibility(VISIBLE);
|
||||
contentView.findViewById(R.id.action_set_host).setVisibility(VISIBLE);
|
||||
}else if (type==3){
|
||||
contentView.findViewById(R.id.action_set_manager).setVisibility(GONE);
|
||||
}
|
||||
if (type != 1 && type != 2) {
|
||||
contentView.findViewById(R.id.action_set_host).setVisibility(GONE);
|
||||
}
|
||||
if (paim==1){
|
||||
contentView.findViewById(R.id.action_kick_out).setVisibility(GONE);
|
||||
}else {
|
||||
contentView.findViewById(R.id.action_kick_out).setVisibility(VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
// if (type != 1) {
|
||||
// contentView.findViewById(R.id.action_set_manager).setVisibility(GONE);
|
||||
// contentView.findViewById(R.id.action_kick_out).setVisibility(GONE);
|
||||
// }
|
||||
// if (type != 1 && type != 2) {
|
||||
// contentView.findViewById(R.id.action_set_host).setVisibility(GONE);
|
||||
// contentView.findViewById(R.id.action_kick_out).setVisibility(GONE);
|
||||
// }
|
||||
// if (paim==1){
|
||||
// contentView.findViewById(R.id.action_kick_out).setVisibility(GONE);
|
||||
// }else {
|
||||
// contentView.findViewById(R.id.action_kick_out).setVisibility(VISIBLE);
|
||||
// }
|
||||
}
|
||||
|
||||
private String getValue(int type, String key) {
|
||||
|
||||
@@ -330,8 +330,8 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
|
||||
if (view.getId() == R.id.iv_exit) {
|
||||
// EventBus.getDefault().post(new RoomOutEvent());
|
||||
// ARouter.getInstance().build(ARouteConstants.LIVE_ROOM).withString("form","首页热门列表").withString("roomId", item.getRoom_id()).navigation();
|
||||
ExitRoomBottomSheet bottomSheet = ExitRoomBottomSheet.newInstance();
|
||||
bottomSheet.setViewUp(false);
|
||||
ExitRoomBottomSheet bottomSheet = ExitRoomBottomSheet.newInstance(false,true,true);
|
||||
|
||||
bottomSheet.setOnOptionSelectedListener(new ExitRoomBottomSheet.OnOptionSelectedListener() {
|
||||
@Override
|
||||
public void onMinimize() {
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.6" />
|
||||
app:layout_constraintGuide_percent="0.66" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/vp_room_pager"
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
android:id="@+id/view_top2"
|
||||
android:layout_width="@dimen/dp_70"
|
||||
android:layout_height="@dimen/dp_70"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
app:layout_constraintEnd_toStartOf="@+id/view_top1"
|
||||
app:layout_constraintHorizontal_chainStyle="spread"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -101,16 +101,14 @@
|
||||
android:id="@+id/room_head_top2_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="34dp"
|
||||
android:drawableStart="@mipmap/rank_h"
|
||||
android:drawablePadding="@dimen/dp_4"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ll_vip2"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_vip2"
|
||||
app:layout_constraintEnd_toEndOf="@id/ll_vip2"
|
||||
app:layout_constraintStart_toStartOf="@id/ll_vip2"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top2"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top2"
|
||||
tools:text="00000" />
|
||||
|
||||
|
||||
|
||||
@@ -62,8 +62,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
android:textSize="@dimen/sp_10" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:icon="@mipmap/ic_launcher_app"
|
||||
android:roundIcon="@mipmap/ic_launcher_round_app"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/BaseAppTheme">
|
||||
<activity
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:icon="@mipmap/ic_launcher_app"
|
||||
android:roundIcon="@mipmap/ic_launcher_round_app"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/BaseAppTheme">
|
||||
<activity
|
||||
|
||||