2 Commits

Author SHA1 Message Date
837231f4f0 1:修改送礼中趣味的岁月之城和时空之巅,不需要选择人员就可以打开
2:优化用在房间点击用户,点击抱麦出现的错误
3: 在岁月之城和时空之巅中查看记录的时候,进行判断,当返回的nickname是null的时候,就直接不展示赠与
4:修改任务UI,
5:添加房间暴币功能
6:修改房间暴币飘屏
7:添加启动页动画
8:修改房间的设置
2025-12-22 09:02:42 +08:00
53b9f0f034 1:修改送礼中趣味的岁月之城和时空之巅,不需要选择人员就可以打开
2:优化用在房间点击用户,点击抱麦出现的错误
3: 在岁月之城和时空之巅中查看记录的时候,进行判断,当返回的nickname是null的时候,就直接不展示赠与
4:修改任务UI,
5:添加房间暴币功能
6:修改房间暴币飘屏
7:添加启动页动画
8:修改房间的设置
2025-12-22 09:02:22 +08:00
56 changed files with 1036 additions and 209 deletions

View File

@@ -7,6 +7,7 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.view.GestureDetector;
import android.view.LayoutInflater;
@@ -152,20 +153,25 @@ public class GiftRoomAdapter extends BaseAdapter {
} else {
viewHolder.iv_gift_select.setVisibility(VISIBLE);
}
if (giftModel.getIs_cp() == 0 && giftModel.getIs_teacher() == 0 ) {//这是cp礼物
if (TextUtils.isEmpty(giftModel.getIcon())) {
viewHolder.im_heart.setVisibility(GONE);
} else {
if (viewHolder.im_heart != null) {
viewHolder.im_heart.setVisibility(VISIBLE);
if (giftModel.getIs_cp() == 1) {
viewHolder.im_heart.setImageResource(R.mipmap.icon_heart);
}else if (giftModel.getIs_teacher() == 1) {
viewHolder.im_heart.setImageResource(R.mipmap.icon_teacher);
}
}
}else {
ImageUtils.loadHead(giftModel.getIcon(), viewHolder.im_heart);
}
// if (giftModel.getIs_cp() == 0 && giftModel.getIs_teacher() == 0 ) {//这是cp礼物
// viewHolder.im_heart.setVisibility(GONE);
// } else {
// if (viewHolder.im_heart != null) {
// viewHolder.im_heart.setVisibility(VISIBLE);
// if (giftModel.getIs_cp() == 1) {
// viewHolder.im_heart.setImageResource(R.mipmap.icon_heart);
// }else if (giftModel.getIs_teacher() == 1) {
// viewHolder.im_heart.setImageResource(R.mipmap.icon_teacher);
// }
// }
// }
/*
* 在给View绑定显示的数据时计算正确的position = position + curIndex * pageSize

View File

@@ -0,0 +1,20 @@
package com.xscm.moduleutil.bean
/**
* 项目名称:羽声语音
* 时间2025/12/21 11:37
* 用途:盲盒转盘状态
*/
class BlindBoxStatus {
var gift_bag_id: Int = 0
var name: String = ""
var status: Int = 0 //0关闭 1开启
var status_str: String = ""
var icon: String = ""
// "gift_bag_id": 11,
// "name": "岁月之城",
// "status": 1,
// "status_str": "开启中",
// "icon": null
}

View File

@@ -62,6 +62,7 @@ public class GiftBoxBean {
private int task_type_id;
private String task_type_name;
private int is_lock;//锁:0 不开启锁 1 开启锁
private int wait_reward_num;//待领取奖励数量
@Data
public static class DailyTasksBean {

View File

@@ -54,6 +54,7 @@ public class MyRoomBean {
private String come_count; //房间进入数
private Double today_income; //今日收益;
private int earnings_ratio;//房间收益比例
private String lucky_water="";//房间幸运流水
@Data
static class CpRoom {

View File

@@ -47,7 +47,7 @@ public class RoomMessageEvent extends BaseEvent {
private List<RoomAuction.AuctionListBean> auction_list; //拍卖列表
private long duration;//时间
private RoomAuction.AuctionListBean recipient;//是否成功,有值的是成功的,没有值的时候,是失败的
private int type;//拍卖者1上麦、2下麦
private int type;//拍卖者1上麦、2下麦 暴币的时候1是大奖 2是小奖
private String hot_value;
private String SendRoomId;//发起者所在的房间ID
private String AcceptRoomId;//接收者所在的房间id
@@ -114,6 +114,8 @@ public class RoomMessageEvent extends BaseEvent {
private String status = "";
private String from_id = "";
private String play_image;//暴币播放动画地址
}
@Data

View File

@@ -34,6 +34,7 @@ public class RoonGiftModel {
private int activities_id;//4盲盒 5天空之境
private int gift_bag;//10天空之境 11岁月之城 12时空之巅
private int is_lock;//爵位礼物 0不锁 1
private String icon="";//礼物标签图片
private int is_cp;//1:是 0不是 是不是cp心动礼物
private int is_teacher;//1:是 0不是 是不是师徒礼物

View File

@@ -158,6 +158,8 @@ public class EMMessageInfo implements MultiItemEntity {
/// 被签约者提示弹窗
public static final int QXRoomMessageTypeSignTipText = 1094;
/// 暴币展示动画列表
public static final int QXRoomMessageTypeSignChat = 1100;
private RoomMessageEvent emMessage;
private int custom = 0;
@@ -212,6 +214,7 @@ public class EMMessageInfo implements MultiItemEntity {
case QXRoomMessageTypeRoomFriendPartDidChanged:
case QXRoomMessageTypeSeatDidChanged:
case QXRoomMessageTypehm:
case QXRoomMessageTypeSignChat:
return 1;
case QXRoomMessageTypeRoomOMh:
case QXRoomMessageTypeGift:

View File

@@ -2,6 +2,8 @@ package com.xscm.moduleutil.bean.room;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import java.util.List;
import lombok.Data;
@Data
@@ -57,6 +59,10 @@ public class RoomSettingBean implements MultiItemEntity {
public static final int QXRoomSettingTypeRoomFloatingScreen = 29;//关闭飘屏
public static final int QXRoomSettingTypeRoomFloatingRed = 30;//红包
public static final int QXRoomSettingTypeRoomTheCityYears = 33;//岁月之城
public static final int QXRoomSettingTypeRoomTimeSpace = 34;//时空之巅
public static final int QXRoomSettingTypeRoomTimeRedSound = 35;//红包声音
public static final int ITEM_TYPE_DEFAULT = 0;
public static final int ITEM_TYPE_WITH_ICON = 1;
@@ -70,7 +76,7 @@ public class RoomSettingBean implements MultiItemEntity {
private boolean isSelected;//是否在麦位上
private boolean status;
private boolean select;//是否选中
private List<RoomSettingBean> children; // 新增子项列表
public RoomSettingBean(String name, String icon, String selectName, String selectIcon, int type, int read, boolean isSelected, boolean status, boolean select) {
this.name = name;
@@ -96,6 +102,7 @@ public class RoomSettingBean implements MultiItemEntity {
this.itemType = ITEM_TYPE_WITH_ICON;
}
}
// public void updateItemType() {
// switch (type) {
// case QXRoomSettingTypeRoomSubsidy:

View File

@@ -45,13 +45,13 @@ public class GiftLotteryAdapter extends BaseQuickAdapter<GiftBean, BaseViewHolde
@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));
ImageUtils.loadHeadCC(item.getBase_image(), helper.getView(R.id.iv_gift_image));
// 使用 SpannableString 给 "x4" 设置不同颜色
TextView giftNameTextView = helper.getView(R.id.gift_name);
TextView nickNameTextView = helper.getView(R.id.tv_user_name);
if (giftNameTextView != null) {
String baseName = item.getGift_name();
String countText = "x"+item.getCount();
String countText = "x" + item.getCount();
String fullText = baseName + countText;
SpannableStringBuilder spannable = new SpannableStringBuilder(fullText);
@@ -67,7 +67,7 @@ public class GiftLotteryAdapter extends BaseQuickAdapter<GiftBean, BaseViewHolde
giftNameTextView.setText(spannable);
}
if (nickNameTextView!=null){
if (nickNameTextView != null && item.getNickname() != null) {
nickNameTextView.setText(item.getNickname());
String nickName = "赠予";
String fullText = nickName + " " + item.getNickname();

View File

@@ -683,6 +683,9 @@ public interface ApiServer {
@POST(Constants.POST_AGREE_SONG)
Call<BaseModel<String>> agreeSong(@Field("room_id") String roomId, @Field("type") String type);
@GET(Constants.GET_BLIND_BOX_STATUS)
Call<BaseModel<List<BlindBoxStatus>>> blindBoxStatus();
@FormUrlEncoded
@POST(Constants.POST_END_SONG)
Call<BaseModel<String>> endSong(@Field("room_id") String roomId);

View File

@@ -209,6 +209,9 @@ public class RetrofitClient {
private <T> void handleNetworkUnavailable(BaseObserver<T> observer) {
ToastUtils.showShort("网络不可用,请检查网络设置");
observer.onError(new Throwable("网络不可用,请检查网络设置"));
if (joinRoomLoadListener != null) {
joinRoomLoadListener.onJoinRoomLoad("网络部可用");
}
}
public <T> T createApiClient(Class<T> apiClientClass) {
@@ -241,8 +244,8 @@ public class RetrofitClient {
});
}
public void mobileView(String mobile, String new_mobile, String sms_code,String new_sms_code, BaseObserver<String> observer) {
sApiServer.mobileView(mobile, new_mobile, sms_code,new_sms_code).enqueue(new Callback<BaseModel<String>>() {
public void mobileView(String mobile, String new_mobile, String sms_code, String new_sms_code, BaseObserver<String> observer) {
sApiServer.mobileView(mobile, new_mobile, sms_code, new_sms_code).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
if (response.code() == 200) {
@@ -2080,9 +2083,9 @@ public class RetrofitClient {
BaseModel<UserInfo> listBaseModel = response.body();
if (listBaseModel.getCode() == 1) {
observer.onNext(listBaseModel.getData());
}else if (listBaseModel.getCode() == 0){
} else if (listBaseModel.getCode() == 0) {
ToastUtils.showShort(listBaseModel.getMsg());
if (ActivityUtils.getTopActivity().getComponentName().getClassName().contains("UserHomepageActivity")){
if (ActivityUtils.getTopActivity().getComponentName().getClassName().contains("UserHomepageActivity")) {
ActivityUtils.getTopActivity().finish();
}
}
@@ -2312,6 +2315,9 @@ public class RetrofitClient {
MessageListenerSingleton.getInstance().quitGroup(roomId);
CommonAppContext.getInstance().isRoomJoininj = false;
observer.onError(t);
if (joinRoomLoadListener != null) {
joinRoomLoadListener.onJoinRoomLoad("网络异常");
}
}
});
}
@@ -3623,6 +3629,35 @@ public class RetrofitClient {
});
}
public void blindBoxStatus(BaseObserver<List<BlindBoxStatus>> observer) {
sApiServer.blindBoxStatus().enqueue(new Callback<BaseModel<List<BlindBoxStatus>>>() {
@Override
public void onResponse(Call<BaseModel<List<BlindBoxStatus>>> call, Response<BaseModel<List<BlindBoxStatus>>> response) {
if (response.code() == 200) {
BaseModel<List<BlindBoxStatus>> baseModel = response.body();
if (baseModel.getCode() == 1) {
observer.onNext(baseModel.getData());
} else if (baseModel.getCode() == 301) {
try {
ToastUtils.showShort(baseModel.getMsg());
CommonAppContext.getInstance().clearLoginInfo();
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
} else {
ToastUtils.showShort(baseModel.getMsg());
}
}
}
@Override
public void onFailure(Call<BaseModel<List<BlindBoxStatus>>> call, Throwable t) {
LogUtils.e("盲盒转盘", t.fillInStackTrace());
}
});
}
public void endSong(String room_id, BaseObserver<String> observer) {
sApiServer.endSong(room_id).enqueue(new Callback<BaseModel<String>>() {
@Override
@@ -3717,8 +3752,8 @@ public class RetrofitClient {
});
}
public void changeSong(String room_id, String now_did,String isAutoNext, BaseObserver<String> observer) {
sApiServer.changeSong(room_id, now_did,isAutoNext).enqueue(new Callback<BaseModel<String>>() {
public void changeSong(String room_id, String now_did, String isAutoNext, BaseObserver<String> observer) {
sApiServer.changeSong(room_id, now_did, isAutoNext).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
onNextRetu(response, observer);

View File

@@ -18,6 +18,7 @@ public class SPConstants {
public static final String VOLUME = "VOLUME"; //音量
public static final String CURRENT_MUSIC = "CURRENT_MUSIC"; //当前播放音乐
public static final String OPEN_EFFECT = "OPEN_EFFECT"; //开启特效
public static final String RED_SOUND = "RED_SOUND"; //开启红包声音
public static final String OPEN_AU_BACK = "OPEN_AU_BACK"; //开启耳返
public static final String ORDER_NEWS_COUNT = "orderNewsCount";
public static final String ORDER_LAST_MSG = "lastOrderMsg";

View File

@@ -370,6 +370,14 @@ public class SpUtil {
SPUtils.getInstance(SPConstants.PREFERENCE_NAME).put(SPConstants.OPEN_EFFECT, i);
}
public static void setRedSound(int i){
SPUtils.getInstance(SPConstants.PREFERENCE_NAME).put(SPConstants.RED_SOUND, i);
}
public static int getRedSound(){
return SPUtils.getInstance(SPConstants.PREFERENCE_NAME).getInt(SPConstants.RED_SOUND, 1);
}
//获取开启特效
public static int getOpenEffect() {
return SPUtils.getInstance(SPConstants.PREFERENCE_NAME).getInt(SPConstants.OPEN_EFFECT, 1);

View File

@@ -300,6 +300,7 @@ public class Constants {
public static final String HELP_APPLY = "/api/RoomPit/help_apply_pit";//上麦助力
public static final String POST_APPLY_SONG = "/api/RoomSong/apply_song";//申请点歌
public static final String POST_AGREE_SONG = "/api/RoomSong/agree_song";//同意、拒绝点歌
public static final String GET_BLIND_BOX_STATUS = "/api/BlindBoxTurntable/blind_box_status";//盲盒转盘状态
public static final String POST_SONG_LIST = "/api/RoomSong/song_list";//获取已点歌曲
public static final String POST_SONG = "/api/RoomSong/song";//点歌
public static final String POST_UP_SONG = "/api/RoomSong/up_song";//移动歌曲

View File

@@ -67,7 +67,8 @@
app:layout_constraintStart_toEndOf="@+id/textView1"
app:layout_constraintTop_toTopOf="@+id/textView1"
app:layout_constraintWidth_default="percent"
app:layout_constraintWidth_percent="0.2" />
app:layout_constraintWidth_percent="0.2"
android:visibility="gone" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.scwang.smartrefresh.layout.SmartRefreshLayout

View File

@@ -54,7 +54,8 @@
android:gravity="center"
android:text="抽奖榜单"
android:textColor="@drawable/text_color_radio_selector"
android:textSize="@dimen/sp_14" />
android:textSize="@dimen/sp_14"
android:visibility="gone"/>
<RadioButton

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -165,6 +165,7 @@
<color name="color_A9A9A9">#A9A9A9</color>
<color name="color_EDF2F8">#EDF2F8</color>
<color name="color_E24171">#E24171</color>
<color name="color_FFEA00">#FFEA00</color>
<color name="color_e2e2e2">#E2E2E2</color>
<color name="color_FFB8CD">#FFB8CD</color>
<color name="color_EDF2F8_6_percent">#F0EDF2F8</color>

View File

@@ -1,5 +1,7 @@
package com.xscm.modulemain;
import static android.view.View.GONE;
import static android.view.View.VISIBLE;
import static com.xscm.moduleutil.base.CommonAppContext.postDelayed;
import android.animation.Animator;
@@ -14,6 +16,7 @@ import android.media.MediaPlayer;
import android.os.Bundle;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.util.DisplayMetrics;
import android.view.Gravity;
@@ -528,8 +531,8 @@ public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewData
ivAvatar.setImageResource(com.xscm.moduleutil.R.mipmap.hourl_top3);
break;
default:
tvName.setVisibility(View.GONE);
ivAvatar.setVisibility(View.GONE);
tvName.setVisibility(GONE);
ivAvatar.setVisibility(GONE);
break;
}
@@ -710,7 +713,9 @@ public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewData
updateRedFloatingViewData(currentRedView, redBean);
// 播放红包音效
playRedPacketSound();
if (SpUtil.getRedSound() == 1) {
playRedPacketSound();
}
resetAndStartXlhAnimation(currentRedView, () -> {
// 清理当前视图
if (currentRedView != null && currentRedView.getParent() != null) {
@@ -1061,12 +1066,18 @@ public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewData
TextView tv_time = view.findViewById(com.xscm.moduleutil.R.id.tv_num);
if (mqttBean != null) {
textView2.setText("送给" + (mqttBean.getToUserName() != null ? mqttBean.getToUserName() : ""));
textView.setText(mqttBean.getFromUserName() != null ? mqttBean.getFromUserName() : "");
if (TextUtils.isEmpty(mqttBean.getToUserName())){
textView2.setVisibility(GONE);
textView.setText(mqttBean.getText());
}else {
textView2.setVisibility(VISIBLE);
textView2.setText("送给" + (mqttBean.getToUserName() != null ? mqttBean.getToUserName() : ""));
textView.setText(mqttBean.getFromUserName() != null ? mqttBean.getFromUserName() : "");
tv_time.setText("x" + (mqttBean.getNumber() != null ? mqttBean.getNumber() : "1"));
}
if (mqttBean.getGift_picture() != null) {
ImageUtils.loadHeadCC(mqttBean.getGift_picture(), view.findViewById(com.xscm.moduleutil.R.id.iv_piaoping));
}
tv_time.setText("x" + (mqttBean.getNumber() != null ? mqttBean.getNumber() : "1"));
} else {
textView2.setText("送给");
textView.setText("");

View File

@@ -1512,6 +1512,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
roomFragment?.handleRoomMessage(messageEvent)
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSignTipText) {
roomFragment?.handleRoomMessage(messageEvent)
}else if (msgType == EMMessageInfo.QXRoomMessageTypeSignChat) {//暴币展示
QXGiftPlayerManager.getInstance(this).displayFullEffectView(messageEvent.text.play_image)
}
}

View File

@@ -4,8 +4,11 @@ import android.app.Activity;
import com.xscm.moduleutil.activity.IPresenter;
import com.xscm.moduleutil.activity.IView;
import com.xscm.moduleutil.bean.BlindBoxStatus;
import com.xscm.moduleutil.bean.room.RoomSettingBean;
import java.util.List;
public class RoomSettingContacts {
public interface View extends IView<Activity> {
void changeRoomSuccess(String s,int position,RoomSettingBean bean);
@@ -13,6 +16,8 @@ public class RoomSettingContacts {
void changeRoomType(String s);
void agreeSong(String s);
void blindBoxStatus(List<BlindBoxStatus> blindBoxStatus);
}
public interface IRoomPre extends IPresenter {
@@ -22,5 +27,7 @@ public class RoomSettingContacts {
void changeRoomType(String roomId,String type);//修改房间类型 type1点唱、2拍卖、3男神、4女神
void agreeSong(String roomId, String type);
void blindBoxStatus();
}
}

View File

@@ -599,18 +599,16 @@ public class ChatRoomFragment extends BaseMvpFragment<ChatRoomPresenter, RoomFra
case 1033:
case 1032:
case 1039:
case 1049:
postAndAddMessage(message);
break;
case 1038:
addSingleMessage(message);
break;
case 1049:
postAndAddMessage(message);
break;
case 1005:
case 1100:
if (getActivity() instanceof RoomActivity) {
((RoomActivity) getActivity()).roomInfoEvent(message);
}
@@ -651,6 +649,7 @@ public class ChatRoomFragment extends BaseMvpFragment<ChatRoomPresenter, RoomFra
return new EMMessageInfo(message);
case 1005:
case 1100:
if (text.getText() != null) {
return new EMMessageInfo(message);
}
@@ -693,7 +692,7 @@ public class ChatRoomFragment extends BaseMvpFragment<ChatRoomPresenter, RoomFra
if (isBottom && easeChatAdapter != null) {
int itemCount = easeChatAdapter.getItemCount();
if (itemCount > 0) {
mBinding.recycleViewPublic.smoothScrollToPosition(itemCount - 1);
mBinding.recycleViewPublic.smoothScrollToPosition(itemCount - 1);
}
} else {
count++;

View File

@@ -3,12 +3,14 @@ package com.xscm.modulemain.activity.room.presenter;
import android.content.Context;
import com.xscm.modulemain.activity.room.contacts.RoomSettingContacts;
import com.xscm.moduleutil.bean.BlindBoxStatus;
import com.xscm.moduleutil.bean.room.RoomSettingBean;
import com.xscm.moduleutil.http.BaseObserver;
import com.xscm.moduleutil.http.RetrofitClient;
import com.xscm.moduleutil.presenter.BasePresenter;
import java.lang.ref.WeakReference;
import java.util.List;
import io.reactivex.disposables.Disposable;
@@ -92,4 +94,23 @@ public class RoomSettingPresenter extends BasePresenter<RoomSettingContacts.View
});
}
@Override
public void blindBoxStatus() {
api.blindBoxStatus(new BaseObserver<List<BlindBoxStatus>>() {
@Override
public void onSubscribe(Disposable d) {
addDisposable(d);
}
@Override
public void onNext(List<BlindBoxStatus> blindBoxStatus) {
if (MvpRef==null){
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().blindBoxStatus(blindBoxStatus);
}
});
}
}

View File

@@ -99,6 +99,7 @@ public class DailyTasksActivity extends BaseMvpActivity<DailyTasksPresenter, Act
protected void initView() {
super.initView();
mBinding.topBar.setTitle("每日任务");
mBinding.topBar.setColor(getResources().getColor(R.color.white));
mBinding.topBar.setRightTxtVisible(true);
mBinding.topBar.setRightText("礼盒记录");
mBinding.topBar.setRightColor(ColorManager.getInstance().getPrimaryColorInt());
@@ -168,7 +169,7 @@ public class DailyTasksActivity extends BaseMvpActivity<DailyTasksPresenter, Act
TextView textView = customView.findViewById(R.id.tabText);
ImageView iconView = customView.findViewById(R.id.tabIcon);
iconView.setImageResource(R.mipmap.icon_task_select_lock);
textView.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.black));
textView.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.white));
}
mBinding.viewPager2.setCurrentItem(tab.getPosition());
}
@@ -180,7 +181,7 @@ public class DailyTasksActivity extends BaseMvpActivity<DailyTasksPresenter, Act
TextView textView = customView.findViewById(R.id.tabText);
ImageView iconView = customView.findViewById(R.id.tabIcon);
iconView.setImageResource(R.mipmap.icon_task_select_unlock);
textView.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
textView.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorWhite45));
}
}
@@ -226,8 +227,14 @@ public class DailyTasksActivity extends BaseMvpActivity<DailyTasksPresenter, Act
TextView textView = customView.findViewById(R.id.tabText);
ImageView iconView = customView.findViewById(R.id.tabIcon);
TextView tabCount = customView.findViewById(R.id.tabCount);
textView.setText(taskItem.getTask_type_name());
if (taskItem.getWait_reward_num()>0){
tabCount.setVisibility(View.VISIBLE);
}else {
tabCount.setVisibility(View.GONE);
}
if (taskItem.getIs_lock() == 1) {
if (i == 0) {
iconView.setImageResource(R.mipmap.icon_task_select_lock);

View File

@@ -83,6 +83,10 @@ public class VocalRangeFragment extends BaseMvpFragment<MePresenter, FragmentVoc
if (!hidden) {
// MvpPre.getMyInfo();
// MvpPre.getMemberList(SpUtils.getUserId(), 1);
MvpPre.getMyInfo();
MvpPre.wallet();
MvpPre.getBanners("6");
MvpPre.getTasksMessage();
}
}

View File

@@ -18,6 +18,7 @@ import io.reactivex.disposables.Disposable;
public class MePresenter extends BasePresenter<MeConacts.View> implements MeConacts.IMePre {
MeConacts.View mView;
public MePresenter(MeConacts.View view, Context context) {
super(view, context);
mView = view;
@@ -33,6 +34,9 @@ public class MePresenter extends BasePresenter<MeConacts.View> implements MeCona
@Override
public void onNext(UserInfo userInfo) {
if (MvpRef == null) {
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().myInfoSuccess(userInfo);
}
});
@@ -182,6 +186,9 @@ public class MePresenter extends BasePresenter<MeConacts.View> implements MeCona
@Override
public void onNext(WalletBean walletBean) {
if (MvpRef == null) {
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().wallet(walletBean);
}
});
@@ -189,7 +196,7 @@ public class MePresenter extends BasePresenter<MeConacts.View> implements MeCona
@Override
public void getTasksMessage() {
api.getTasksMessage(new BaseObserver<TasksMessage> () {
api.getTasksMessage(new BaseObserver<TasksMessage>() {
@Override
public void onSubscribe(Disposable d) {
@@ -198,8 +205,8 @@ public class MePresenter extends BasePresenter<MeConacts.View> implements MeCona
@Override
public void onNext(TasksMessage s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
if (MvpRef == null) {
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().getTasksMessage(s);
}
@@ -210,7 +217,7 @@ public class MePresenter extends BasePresenter<MeConacts.View> implements MeCona
// Type listType = new TypeToken<List<BannerModel>>() {}.getType();
// List<BannerModel> restoredRoomModels = GsonUtils.getGSON().fromJson(SpUtils.getHomeBanner(), listType);
// MvpRef.get().setBanners(restoredRoomModels);
api.getBanners(s,new BaseObserver<List<BannerModel>>() {
api.getBanners(s, new BaseObserver<List<BannerModel>>() {
@Override
public void onSubscribe(Disposable d) {
addDisposable(d);
@@ -218,8 +225,8 @@ public class MePresenter extends BasePresenter<MeConacts.View> implements MeCona
@Override
public void onNext(List<BannerModel> bannerModels) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
if (MvpRef == null) {
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().setBanners(bannerModels);
}

View File

@@ -0,0 +1,147 @@
package com.xscm.modulemain.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.xscm.modulemain.R;
import com.xscm.moduleutil.bean.room.RoomSettingBean;
import java.util.List;
public class HorizontalListAdapter extends RecyclerView.Adapter<HorizontalListAdapter.ViewHolder> {
private List<RoomSettingBean> mData;
private OnItemClickListener mListener;
public interface OnItemClickListener {
void onItemClick(RoomSettingBean item);
}
public HorizontalListAdapter(List<RoomSettingBean> data) {
mData = data;
}
public void setOnItemClickListener(OnItemClickListener listener) {
mListener = listener;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.item_setting, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
RoomSettingBean item = mData.get(position);
if (item.isStatus()) {
holder.tvName.setText(getName(item.getType(), item.isSelect(), item.getName()));
holder.ivIcon.setImageResource(getIconResId(item.getType(), item.isSelect()));
}
holder.itemView.setOnClickListener(v -> {
if (mListener != null) {
mListener.onItemClick(item);
}
});
}
private String getName(int type, boolean isSelected, String name) {
boolean b = isSelected;
switch (type) {
case RoomSettingBean.QXRoomSettingTypeRoomOrderMic:
return b ? "排麦模式" : "自由模式";
case RoomSettingBean.QXRoomSettingTypeRoomCloseEffects:
return b ? "关闭特效" : "开启特效";
case RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen:
return b ? "关闭飘屏" : "开启飘屏";
case RoomSettingBean.QXRoomSettingTypeRoomTimeRedSound:
return b ? "关闭红包声音" : "开启红包声音";
default:
return name;
}
}
@Override
public int getItemCount() {
return mData.size();
}
static class ViewHolder extends RecyclerView.ViewHolder {
ImageView ivIcon;
TextView tvName;
ViewHolder(View view) {
super(view);
ivIcon = view.findViewById(R.id.iv_icon);
tvName = view.findViewById(R.id.tv_name);
}
}
// 根据 type 获取对应的图标资源 ID
private int getIconResId(int type, boolean isSelected) {
boolean b = isSelected;
switch (type) {
case RoomSettingBean.QXRoomSettingTypeRoomTypeSing:
return com.xscm.moduleutil.R.mipmap.ic_jiaoy;
case RoomSettingBean.QXRoomSettingTypeRoomTypeAuction:
return com.xscm.moduleutil.R.mipmap.ic_auction;
case RoomSettingBean.QXRoomSettingTypeRoomTypeBoy:
return com.xscm.moduleutil.R.mipmap.ic_boy;
case RoomSettingBean.QXRoomSettingTypeRoomTypeGirl:
return com.xscm.moduleutil.R.mipmap.ic_girl;
case RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy:
return com.xscm.moduleutil.R.mipmap.ic_sing;
case RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU:
return com.xscm.moduleutil.R.mipmap.huyu;
case RoomSettingBean.QXRoomSettingTypeRoomTypeLianG:
return com.xscm.moduleutil.R.mipmap.icon_liang;
case RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT:
return com.xscm.moduleutil.R.mipmap.icon_sign_contract;
// 常用工具
case RoomSettingBean.QXRoomSettingTypeRoomSubsidy:
return com.xscm.moduleutil.R.mipmap.ic_subsidy;
case RoomSettingBean.QXRoomSettingTypeRoomCompere:
return com.xscm.moduleutil.R.mipmap.ic_compere;
case RoomSettingBean.QXRoomSettingTypeRoomClearMessage:
return com.xscm.moduleutil.R.mipmap.ic_clear_message;
case RoomSettingBean.QXRoomSettingTypeRoomOrderMic:
return b ? com.xscm.moduleutil.R.mipmap.ic_order_mic : com.xscm.moduleutil.R.mipmap.ic_order_mic_selected;
case RoomSettingBean.QXRoomSettingTypeRoomBgMusic:
return com.xscm.moduleutil.R.mipmap.ic_bg_music;
case RoomSettingBean.QXRoomSettingTypeRoomBgImage:
return com.xscm.moduleutil.R.mipmap.ic_bg_image;
// 更多操作
case RoomSettingBean.QXRoomSettingTypeRoomShare:
return com.xscm.moduleutil.R.mipmap.ic_share;
case RoomSettingBean.QXRoomSettingTypeRoomMyDress:
return com.xscm.moduleutil.R.mipmap.tiaoyint;
case RoomSettingBean.QXRoomSettingTypeRoomSetting:
return com.xscm.moduleutil.R.mipmap.ic_room_setting;
case RoomSettingBean.QXRoomSettingTypeRoomWelcome:
return com.xscm.moduleutil.R.mipmap.ic_welcome;
case RoomSettingBean.QXRoomSettingTypeRoomCloseEffects:
return b ? com.xscm.moduleutil.R.mipmap.ic_close_effects : com.xscm.moduleutil.R.mipmap.ic_open_effects;
case RoomSettingBean.QXRoomSettingTypeRoomReport:
return com.xscm.moduleutil.R.mipmap.ic_report;
case RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen:
return b ? com.xscm.moduleutil.R.mipmap.ic_close_floating_screen : com.xscm.moduleutil.R.mipmap.ic_open_floating_screen;
case RoomSettingBean.QXRoomSettingTypeRoomFloatingRed:
return com.xscm.moduleutil.R.mipmap.red_tx;
case RoomSettingBean.QXRoomSettingTypeRoomTheCityYears:
return com.xscm.moduleutil.R.mipmap.the_city_years;
case RoomSettingBean.QXRoomSettingTypeRoomTimeSpace:
return com.xscm.moduleutil.R.mipmap.time_space;
case RoomSettingBean.QXRoomSettingTypeRoomTimeRedSound:
return b ? com.xscm.moduleutil.R.mipmap.room_voice_g : com.xscm.moduleutil.R.mipmap.y_won;
default:
return 0;
}
}
}

View File

@@ -253,7 +253,7 @@ public class MyCreateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
ImageView iv_play, im_sh;
TextView tv_name;
TextView tv_sy;
TextView tv_user_id, tv_gz, tv_zx, tv_fw, rl_mx, tv_room_bt;
TextView tv_user_id, tv_gz, tv_zx, tv_fw, rl_mx, tv_room_bt,tv_luck;
ConstraintLayout cl_my_room_list;
RelationViewHolder(View itemView) {
@@ -269,6 +269,7 @@ public class MyCreateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
rl_mx = itemView.findViewById(R.id.rl_mx);
tv_room_bt = itemView.findViewById(R.id.tv_room_bt);
im_sh = itemView.findViewById(R.id.im_sh);
tv_luck = itemView.findViewById(R.id.tv_luck);
cl_my_room_list = itemView.findViewById(R.id.cl_my_room_list);
}
@@ -347,8 +348,11 @@ public class MyCreateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
if (item.getApply_status().equals("2")) {
im_sh.setVisibility(View.GONE);
tv_luck.setVisibility(View.VISIBLE);
tv_luck.setText("幸运总流水:"+item.getLucky_water());
} else if (item.getApply_status().equals("1")) {
im_sh.setVisibility(View.VISIBLE);
tv_luck.setVisibility(View.GONE);
}
ThemeableDrawableUtils.setThemeableRoundedBackground(rl_mx, itemView.getContext().getColor(com.xscm.moduleutil.R.color.color6c49e25), 53);

View File

@@ -1,30 +1,68 @@
package com.xscm.modulemain.adapter;
import android.view.View;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xscm.modulemain.R;
import com.xscm.moduleutil.bean.room.RoomSettingBean;
import java.util.List;
public class RoomSettingAdapter extends BaseMultiItemQuickAdapter<RoomSettingBean, BaseViewHolder> {
public class RoomSettingAdapter extends BaseQuickAdapter<RoomSettingBean, BaseViewHolder> {
public RoomSettingAdapter(List<RoomSettingBean> data) {
super(data);
addItemType(RoomSettingBean.ITEM_TYPE_DEFAULT, R.layout.item_title);
addItemType(RoomSettingBean.ITEM_TYPE_WITH_ICON, R.layout.item_setting);
private OnItemClickListener mListener;
public interface OnItemClickListener {
void onItemClick(RoomSettingBean item,int position);
}
public void setOnItemClickListener(OnItemClickListener listener) {
mListener = listener;
}
public RoomSettingAdapter() {
super(R.layout.item_title);
}
// public RoomSettingAdapter(List<RoomSettingBean> data) {
// super(data);
// addItemType(RoomSettingBean.ITEM_TYPE_DEFAULT, R.layout.item_title);
// addItemType(RoomSettingBean.ITEM_TYPE_WITH_ICON, R.layout.item_setting);
// }
@Override
protected void convert(BaseViewHolder holder, RoomSettingBean item) {
if (item.getItemType() == RoomSettingBean.ITEM_TYPE_DEFAULT) {
holder.setVisible(R.id.tv_title, true);
if (item.isStatus() && item.getChildren()!=null && !item.getChildren().isEmpty()) {
holder.setVisible(R.id.tv_title, item.isStatus());
holder.setText(R.id.tv_title, item.getName());
} else {
holder.setText(R.id.tv_name, getName(item.getType(), item.isSelect(), item.getName()));
holder.setImageResource(R.id.iv_icon, getIconResId(item.getType(), item.isSelect()));
RecyclerView rvContent = holder.getView(R.id.rv_content);
rvContent.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
HorizontalListAdapter adapter = new HorizontalListAdapter(item.getChildren());
rvContent.setAdapter(adapter);
adapter.setOnItemClickListener(new HorizontalListAdapter.OnItemClickListener() {
@Override
public void onItemClick(RoomSettingBean item) {
if (mListener != null)
mListener.onItemClick(item, holder.getAdapterPosition());
}
});
}
// if (item.getItemType() == RoomSettingBean.ITEM_TYPE_DEFAULT) {
// holder.setVisible(R.id.tv_title, true);
// holder.setText(R.id.tv_title, item.getName());
// } else {
// holder.setText(R.id.tv_name, getName(item.getType(), item.isSelect(), item.getName()));
// holder.setImageResource(R.id.iv_icon, getIconResId(item.getType(), item.isSelect()));
// }
}
private String getName(int type, boolean isSelected, String name) {
@@ -59,7 +97,7 @@ public class RoomSettingAdapter extends BaseMultiItemQuickAdapter<RoomSettingBea
return com.xscm.moduleutil.R.mipmap.huyu;
case RoomSettingBean.QXRoomSettingTypeRoomTypeLianG:
return com.xscm.moduleutil.R.mipmap.icon_liang;
case RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT :
case RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT:
return com.xscm.moduleutil.R.mipmap.icon_sign_contract;
// 常用工具
case RoomSettingBean.QXRoomSettingTypeRoomSubsidy:
@@ -93,6 +131,10 @@ public class RoomSettingAdapter extends BaseMultiItemQuickAdapter<RoomSettingBea
return b ? com.xscm.moduleutil.R.mipmap.ic_close_floating_screen : com.xscm.moduleutil.R.mipmap.ic_open_floating_screen;
case RoomSettingBean.QXRoomSettingTypeRoomFloatingRed:
return com.xscm.moduleutil.R.mipmap.red_tx;
case RoomSettingBean.QXRoomSettingTypeRoomTheCityYears:
return com.xscm.moduleutil.R.mipmap.the_city_years;
case RoomSettingBean.QXRoomSettingTypeRoomTimeSpace:
return com.xscm.moduleutil.R.mipmap.time_space;
default:
return 0;
}

View File

@@ -42,16 +42,16 @@ public class TaskBoxAdapter extends BaseQuickAdapter<GiftBoxBean.GiftBean, BaseV
giftTitle.setText(item.getTitle());
if (position == 0) {
itemView.setBackgroundResource(R.drawable.shape_8);
itemView.setBackgroundTintList(ColorStateList.valueOf(Color.parseColor("#FFFCE4ED")));
giftName.setTextColor(mContext.getResources().getColor(com.xscm.moduleutil.R.color.color_E24171));
setSpannableText(giftTitle, "最高可获得%d金币", Integer.parseInt(item.getHighest_gain()),com.xscm.moduleutil.R.color.color_E24171);
itemView.setBackgroundTintList(ColorStateList.valueOf(Color.parseColor("#B766FC")));
giftName.setTextColor(mContext.getResources().getColor(com.xscm.moduleutil.R.color.white));
setSpannableText(giftTitle, "最高可获得%d金币", Integer.parseInt(item.getHighest_gain()),com.xscm.moduleutil.R.color.color_FFEA00);
ImageUtils.loadSetErrorImg(item.getIcon(), helper.getView(R.id.task_box), com.xscm.moduleutil.R.mipmap.task_cj);
} else if (position == 1) {
itemView.setBackgroundResource(R.drawable.shape_8);
itemView.setBackgroundTintList(ColorStateList.valueOf(Color.parseColor("#FFFDE8AE")));
itemView.setBackgroundTintList(ColorStateList.valueOf(Color.parseColor("#DEA84D")));
ImageUtils.loadSetErrorImg(item.getIcon(), helper.getView(R.id.task_box), com.xscm.moduleutil.R.mipmap.task_gj);
giftName.setTextColor(mContext.getResources().getColor(com.xscm.moduleutil.R.color.color_F35F07));
setSpannableText(giftTitle, "最高可获得%d金币", Integer.parseInt(item.getHighest_gain()),com.xscm.moduleutil.R.color.color_F35F07);
giftName.setTextColor(mContext.getResources().getColor(com.xscm.moduleutil.R.color.white));
setSpannableText(giftTitle, "最高可获得%d金币", Integer.parseInt(item.getHighest_gain()),com.xscm.moduleutil.R.color.color_FFEA00);
} else {
// 其他 item 恢复默认背景(可选)
@@ -80,7 +80,7 @@ public class TaskBoxAdapter extends BaseQuickAdapter<GiftBoxBean.GiftBean, BaseV
unlockView.setClickable(false);
unlockView.setEnabled(false);
// 可选:改变颜色或透明度来视觉反馈
unlockView.setAlpha(0.2f); // 半透明表示不可点击
unlockView.setAlpha(0.5f); // 半透明表示不可点击
}else if (item.getStatus().equals("1")){
unlockView.setClickable(true);
unlockView.setEnabled(true);

View File

@@ -34,7 +34,7 @@ public class TaskDataAdapter extends BaseQuickAdapter<GiftBoxBean.TaskDataBean.D
if (item.getTask_status()==1){
textView.setText(item.getTask_type_str());
textView.setBackgroundResource(com.xscm.moduleutil.R.drawable.bg_r99_e24171);
textView.setBackgroundResource(com.xscm.moduleutil.R.drawable.cs);
}else if (item.getTask_status()==2){
textView.setText("");
textView.setBackgroundResource(com.xscm.moduleutil.R.mipmap.task_lq);

View File

@@ -512,7 +512,7 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
private void showGiftLotteryDialog(RoonGiftModel gift, String roomId) {
String userId = gifyuseradapter.getUserIdToString();
if (userId == null || userId.isEmpty()) {
if ((userId == null || userId.isEmpty()) && gift.getGift_bag()==10) {
ToastUtils.show("请先选择人员");
gift.setChecked(false);

View File

@@ -1,15 +1,19 @@
package com.xscm.modulemain.dialog;
import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomOrderMic;
import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomTimeRedSound;
import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomTimeSpace;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.*;
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.GsonUtils;
@@ -26,6 +30,7 @@ import com.xscm.modulemain.databinding.DialogRoomSettingFragmentBinding;
import com.xscm.modulemain.activity.WebViewActivity;
import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.base.WebUrlConstants;
import com.xscm.moduleutil.bean.BlindBoxStatus;
import com.xscm.moduleutil.dialog.ConfirmDialog;
import com.xscm.moduleutil.event.EffectEvent;
import com.xscm.moduleutil.event.FloatingScreenEvent;
@@ -46,6 +51,7 @@ import org.greenrobot.eventbus.ThreadMode;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author qx
@@ -57,12 +63,19 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
private String roomId;
RoomSettingAdapter adapter;
List<RoomSettingBean> dataList;
// 创建父级列表
List<RoomSettingBean> parentList = new ArrayList<>();
private RoomInfoResp roomInfoResp;
private int read;
private boolean isSelected;
private boolean effectOn = false;//开启/关闭特效
private boolean redSound = false;//开启/关闭红包声音
private boolean floatingScreen = false;//开启/关闭飘屏
List<RoomSettingBean> filteredList = new ArrayList<>();
List<RoomSettingBean> blindList = new ArrayList<>();//盲盒列表
@Override
protected RoomSettingPresenter bindPresenter() {
return new RoomSettingPresenter(this, getActivity());
@@ -82,7 +95,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
super.onAttach(context);
// roomId=getArguments().getString("roomId");
roomInfoResp = (RoomInfoResp) getArguments().getSerializable("roomInfoResp");
if (roomInfoResp==null){
if (roomInfoResp == null) {
ToastUtils.show("房间信息为空");
return;
}
@@ -101,6 +114,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
} else {
isSelected = false;
}
}
@@ -129,11 +143,51 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
@Override
protected void initData() {
dataList = new ArrayList<>();
effectOn = SpUtil.getOpenEffect() == 1;
floatingScreen = SpUtil.getFloatingScreen() == 1;
redSound = SpUtil.getRedSound() == 1;
boolean b = roomInfoResp.getRoom_info().getRoom_up_pit_type().equals("1");
LogUtils.e("effectOn=" + effectOn);
// 房间类型组
RoomSettingBean roomTypeParent = new RoomSettingBean("房间类型", null, null, null, -1, read, isSelected, false, false);
List<RoomSettingBean> roomTypeChildren = new ArrayList<>();
roomTypeChildren.add(new RoomSettingBean("交友", "ic_sing", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeSing, read, isSelected, false, false));
roomTypeChildren.add(new RoomSettingBean("拍卖", "ic_auction", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeAuction, read, isSelected, false, false));
roomTypeChildren.add(new RoomSettingBean("点唱", "jiao_y", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy, read, isSelected, false, false));
roomTypeChildren.add(new RoomSettingBean("互娱", "ic_jiaoy", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU, read, isSelected, false, false));
roomTypeChildren.add(new RoomSettingBean("练歌房", "ic_liang", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeLianG, read, isSelected, false, false));
roomTypeChildren.add(new RoomSettingBean("签约", "sing_contract", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT, read, isSelected, false, false));
roomTypeParent.setChildren(roomTypeChildren);
parentList.add(roomTypeParent);
// 常用工具组
RoomSettingBean toolsParent = new RoomSettingBean("常用工具", null, null, null, -1, read, isSelected, false, false);
List<RoomSettingBean> toolsChildren = new ArrayList<>();
toolsChildren.add(new RoomSettingBean("房间补贴", "ic_subsidy", null, null, RoomSettingBean.QXRoomSettingTypeRoomSubsidy, read, isSelected, false, false));
toolsChildren.add(new RoomSettingBean("主持设置", "ic_compere", null, null, RoomSettingBean.QXRoomSettingTypeRoomCompere, read, isSelected, false, false));
toolsChildren.add(new RoomSettingBean("清空消息", "ic_clear_message", null, null, RoomSettingBean.QXRoomSettingTypeRoomClearMessage, read, isSelected, false, false));
toolsChildren.add(new RoomSettingBean("排麦模式", "ic_order_mic", null, null, QXRoomSettingTypeRoomOrderMic, read, isSelected, false, roomInfoResp.getRoom_info().getRoom_up_pit_type().equals("1")));
toolsChildren.add(new RoomSettingBean("背景音乐", "ic_bg_music", null, null, RoomSettingBean.QXRoomSettingTypeRoomBgMusic, read, isSelected, false, false));
toolsChildren.add(new RoomSettingBean("背景图片", "ic_bg_image", null, null, RoomSettingBean.QXRoomSettingTypeRoomBgImage, read, isSelected, false, false));
toolsParent.setChildren(toolsChildren);
parentList.add(toolsParent);
// 更多操作组
RoomSettingBean moreParent = new RoomSettingBean("更多操作", null, null, null, -1, read, isSelected, false, false);
List<RoomSettingBean> moreChildren = new ArrayList<>();
moreChildren.add(new RoomSettingBean("发红包", "ic_red", null, null, RoomSettingBean.QXRoomSettingTypeRoomFloatingRed, read, isSelected, false, false));
moreChildren.add(new RoomSettingBean("房间设置", "ic_room_setting", null, null, RoomSettingBean.QXRoomSettingTypeRoomSetting, read, isSelected, false, false));
moreChildren.add(new RoomSettingBean("关闭特效", "ic_close_effects", null, null, RoomSettingBean.QXRoomSettingTypeRoomCloseEffects, read, isSelected, false, effectOn));
moreChildren.add(new RoomSettingBean("关闭飘屏", "ic_close_floating_screen", null, null, RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen, read, isSelected, false, floatingScreen));
moreChildren.add(new RoomSettingBean("举报", "ic_report", null, null, RoomSettingBean.QXRoomSettingTypeRoomReport, read, isSelected, false, false));
moreChildren.add(new RoomSettingBean("岁月之城", "the_city_years", null, null, RoomSettingBean.QXRoomSettingTypeRoomTheCityYears, read, isSelected, false, false));
moreChildren.add(new RoomSettingBean("时空之巅", "time_space", null, null, QXRoomSettingTypeRoomTimeSpace, read, isSelected, false, false));
moreChildren.add(new RoomSettingBean("关闭红包声音", "crossing", null, null, QXRoomSettingTypeRoomTimeRedSound, read, isSelected, false, redSound));
moreParent.setChildren(moreChildren);
parentList.add(moreParent);
/*
// 添加标题和对应的内容项
dataList.add(new RoomSettingBean("房间类型", null, null, null, -1, read, isSelected, false, false));
dataList.add(new RoomSettingBean("交友", "ic_sing", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeSing, read, isSelected, false, false));
@@ -164,9 +218,62 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
dataList.add(new RoomSettingBean("关闭特效", "ic_close_effects", null, null, RoomSettingBean.QXRoomSettingTypeRoomCloseEffects, read, isSelected, false, effectOn));
dataList.add(new RoomSettingBean("关闭飘屏", "ic_close_floating_screen", null, null, RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen, read, isSelected, false, floatingScreen));
dataList.add(new RoomSettingBean("举报", "ic_report", null, null, RoomSettingBean.QXRoomSettingTypeRoomReport, read, isSelected, false, false));
List<RoomSettingBean> filteredList = new ArrayList<>();
// 更新 itemType
for (RoomSettingBean bean : dataList) {
dataList.add(new RoomSettingBean("岁月之城", "the_city_years", null, null, RoomSettingBean.QXRoomSettingTypeRoomTheCityYears, read, isSelected, false, false));
dataList.add(new RoomSettingBean("时空之巅", "time_space", null, null, RoomSettingBean.QXRoomSettingTypeRoomTimeSpace, read, isSelected, false, false));
*/
// 更新 itemType
for (RoomSettingBean bean : parentList) {
bean.setRead(read);
bean.setSelected(isSelected);
switch (read) {
case 1, 2, 3:
bean.setStatus(true);
break;
case 4:
if (bean.getName().equals("房间类型") || bean.getName().equals("常用工具")) {
bean.setStatus(false);
bean.setChildren(null);
} else {
bean.setStatus(true);
}
break;
}
// 如果是父级项目(type = -1)
// 检查父级是否可见
// 处理子项
List<RoomSettingBean> children = bean.getChildren();
List<RoomSettingBean> children2 = new ArrayList<>();
if (children != null && !children.isEmpty()) {
for (RoomSettingBean child : children) {
child.setRead(read);
child.setSelected(isSelected);
if (isItemVisible(child)) {
child.setStatus(true);
if (child.getType() == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears || child.getType() == RoomSettingBean.QXRoomSettingTypeRoomTimeSpace) {
blindList.add(child);
}
children2.add(child);
} else {
child.setStatus(false);
}
child.updateItemType();
}
}
bean.setChildren(children2);
if (bean.isStatus()) {
filteredList.add(bean);
}
}
// 更新 itemType
/* for (RoomSettingBean bean : dataList) {
bean.setRead(read);
bean.setSelected(isSelected);
// 根据角色和状态设置 isVisible
@@ -181,12 +288,9 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
if (bean.isStatus()) {
filteredList.add(bean);
}
}
adapter = new RoomSettingAdapter(filteredList);
mBinding.recycleView.setAdapter(adapter);
// 动态设置 GridLayoutManager 的列数
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 6); // 默认每行 4 个 item
// 动态设置 GridLayoutManager 的列数
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 6); // 默认每行 4 个 item
layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
@@ -201,8 +305,186 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
});
// 根据 itemType 动态调整列数
mBinding.recycleView.setLayoutManager(layoutManager);
}*/
adapter = new RoomSettingAdapter();
mBinding.recycleView.setAdapter(adapter);
adapter.setNewData(filteredList);
mBinding.recycleView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
adapter.setOnItemClickListener(new RoomSettingAdapter.OnItemClickListener() {
@Override
public void onItemClick(RoomSettingBean bean, int position) {
// 示例:切换选择状态
if (bean.getType() == QXRoomSettingTypeRoomOrderMic) {
MvpPre.changeRoom(roomId, SpUtil.getUserId() + "", position, bean);
adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomClearMessage) {
RoomMessageEvent.T t = new RoomMessageEvent.T();
t.setText("清空消息");
RoomMessageEvent roomMessageEvent = new RoomMessageEvent(123, roomId, t);
EventBus.getDefault().post(roomMessageEvent);
String json = GsonUtils.toJson(roomMessageEvent);
// 转换为 byte[]
byte[] binaryData = json.getBytes(StandardCharsets.UTF_8);
// 创建自定义消息
MessageListenerSingleton.getInstance().sendCustomRoomMessage(
roomId,
binaryData
);
if (getActivity() instanceof RoomActivity) {
((RoomActivity) getActivity()).clearData();
}
}
// else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomMyDress) {
// TunerDialogFragment.show(roomId, getChildFragmentManager());
// }
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomCompere) {//主持设置
RoomHostFragment.newInstance(roomId).show(getChildFragmentManager(), "RoomHostFragment");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomBgImage) {//背景图片
RoomBackgroundDialogFragment.newInstance(roomId).show(getChildFragmentManager(), "RoomBackgroundDialogFragment");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomCloseEffects) {//关闭特效
if (effectOn) {
//关闭
effectOn = false;
//保存到本地
SpUtil.setOpenEffect(0);
EventBus.getDefault().post(new EffectEvent(false));
bean.setSelect(false);
} else {
//打开
effectOn = true;
SpUtil.setOpenEffect(1);
EventBus.getDefault().post(new EffectEvent(true));
bean.setSelect(true);
}
upAdapter();
// adapter.notifyItemChanged(position);
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomBgMusic) {
EventBus.getDefault().post(new MusicEvent());
dismiss();
}
// else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomLeave) {
// EventBus.getDefault().post(new RoomOutEvent());
// }
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeSing) {
// MvpPre.changeRoomType(roomId, "1");
queren("1");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeAuction) {
// MvpPre.changeRoomType(roomId, "2");
queren("2");
}
// else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeBoy) {
//// MvpPre.changeRoomType(roomId, "3");
// queren("3");
// }
// else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeGirl) {
//// MvpPre.changeRoomType(roomId, "4");
// queren("4");
// }
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy) {
// MvpPre.changeRoomType(roomId, "7");
queren("9");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU) {
queren("7");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG) {
queren("-1");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT) {
queren("10");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
if (roomInfoResp != null) {
ARouter.getInstance().build(ARouteConstants.CREATED_ROOM).withSerializable("roomInfoResp", roomInfoResp).navigation();
} else {
com.blankj.utilcode.util.ToastUtils.showShort("数据错误,请关闭重试");
}
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomReport) {
if (roomId != null) {
Intent intent = new Intent(getActivity(), WebViewActivity.class);
intent.putExtra("url", String.format(WebUrlConstants.INSTANCE.getWEB_REPORT_URL(), SpUtil.getToken(), 2, roomId));
startActivity(intent);
} else {
com.blankj.utilcode.util.ToastUtils.showShort("数据错误,请关闭重试");
}
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
ARouter.getInstance().build(ARouteConstants.ROOM_ALLOWANCE).withString("from", "我的界面").withString("roomId", roomInfoResp.getRoom_info().getRoom_id() + "").navigation();
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen) {//2025年9月22日14:10:25添加飘屏关闭打开按钮
if (floatingScreen) {
//关闭
floatingScreen = false;
//保存到本地
SpUtil.setFloatingScreen(0);
EventBus.getDefault().post(new FloatingScreenEvent(false));
bean.setSelect(false);
} else {
//打开
floatingScreen = true;
SpUtil.setFloatingScreen(1);
EventBus.getDefault().post(new FloatingScreenEvent(true));
bean.setSelect(true);
}
upAdapter();
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomFloatingRed) {
if (getActivity() instanceof RoomActivity) {
((RoomActivity) getActivity()).redDialogView();
}
dismiss();
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears) {
try {
// // 直接显示对话框,移除有问题的 FragmentTransaction
// this.dismissAllowingStateLoss(); // 使用 dismissAllowingStateLoss 更安全
//
FragmentManager fm = getParentFragmentManager();
if (fm != null && !fm.isDestroyed()) {
GiftLotteryDialog newDialog = GiftLotteryDialog.newInstance(
"11", roomId, "", "", "");
newDialog.show(fm, "GiftLotteryDialog");
}
} catch (Exception e) {
LogUtils.e("RoomGiftDialogFragment", "Error in showGiftLotteryDialog", e);
ToastUtils.show("操作失败,请重试");
}
} else if (bean.getType() == QXRoomSettingTypeRoomTimeSpace) {
try {
// // 直接显示对话框,移除有问题的 FragmentTransaction
// this.dismissAllowingStateLoss(); // 使用 dismissAllowingStateLoss 更安全
//
FragmentManager fm = getParentFragmentManager();
if (fm != null && !fm.isDestroyed()) {
GiftLotteryDialog newDialog = GiftLotteryDialog.newInstance(
"12", roomId, "", "", "");
newDialog.show(fm, "GiftLotteryDialog");
}
} catch (Exception e) {
LogUtils.e("RoomGiftDialogFragment", "Error in showGiftLotteryDialog", e);
ToastUtils.show("操作失败,请重试");
}
} else if (bean.getType() == QXRoomSettingTypeRoomTimeRedSound) {//关闭红包声音
if (redSound) {
//关闭
redSound = false;
//保存到本地
SpUtil.setRedSound(0);
bean.setSelect(false);
} else {
//打开
redSound = true;
SpUtil.setRedSound(1);
bean.setSelect(true);
}
upAdapter();
// adapter.notifyItemChanged(position);
}
}
});
MvpPre.blindBoxStatus();
/* adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
RoomSettingBean bean = (RoomSettingBean) adapter.getItem(position);
@@ -282,12 +564,11 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
queren("9");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU) {
queren("7");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG){
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG) {
queren("-1");
}else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT){
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT) {
queren("10");
}
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
if (roomInfoResp != null) {
ARouter.getInstance().build(ARouteConstants.CREATED_ROOM).withSerializable("roomInfoResp", roomInfoResp).navigation();
} else {
@@ -296,9 +577,9 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomReport) {
if (roomId != null) {
Intent intent = new Intent(getActivity(), WebViewActivity.class);
intent.putExtra("url", String.format(WebUrlConstants.INSTANCE.getWEB_REPORT_URL(),SpUtil.getToken(),2, roomId));
intent.putExtra("url", String.format(WebUrlConstants.INSTANCE.getWEB_REPORT_URL(), SpUtil.getToken(), 2, roomId));
startActivity(intent);
}else {
} else {
com.blankj.utilcode.util.ToastUtils.showShort("数据错误,请关闭重试");
}
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
@@ -319,19 +600,48 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
bean.setSelect(true);
}
upAdapter();
}
else if (bean.getType()==RoomSettingBean.QXRoomSettingTypeRoomFloatingRed){
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomFloatingRed) {
if (getActivity() instanceof RoomActivity) {
((RoomActivity) getActivity()).redDialogView();
}
dismiss();
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears) {
try {
// // 直接显示对话框,移除有问题的 FragmentTransaction
// this.dismissAllowingStateLoss(); // 使用 dismissAllowingStateLoss 更安全
//
FragmentManager fm = getParentFragmentManager();
if (fm != null && !fm.isDestroyed()) {
GiftLotteryDialog newDialog = GiftLotteryDialog.newInstance(
"11", roomId, "", "", "");
newDialog.show(fm, "GiftLotteryDialog");
}
} catch (Exception e) {
LogUtils.e("RoomGiftDialogFragment", "Error in showGiftLotteryDialog", e);
ToastUtils.show("操作失败,请重试");
}
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTimeSpace) {
try {
// // 直接显示对话框,移除有问题的 FragmentTransaction
// this.dismissAllowingStateLoss(); // 使用 dismissAllowingStateLoss 更安全
//
FragmentManager fm = getParentFragmentManager();
if (fm != null && !fm.isDestroyed()) {
GiftLotteryDialog newDialog = GiftLotteryDialog.newInstance(
"12", roomId, "", "", "");
newDialog.show(fm, "GiftLotteryDialog");
}
} catch (Exception e) {
LogUtils.e("RoomGiftDialogFragment", "Error in showGiftLotteryDialog", e);
ToastUtils.show("操作失败,请重试");
}
}
}
});
});*/
}
// TODO: 2025/8/29 房间切换提示框
@@ -359,7 +669,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
"取消",
v -> {
if (type.equals("-1")) {
MvpPre.agreeSong(roomId,"1");
MvpPre.agreeSong(roomId, "1");
} else
// 点击“确认”按钮时执行删除操作
MvpPre.changeRoomType(roomId, type);
@@ -388,12 +698,12 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
if (roleLevel == 1) {
if (onMic) {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy
|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress ) {
|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress) {
return false;
}
} else {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy
|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress ) {
|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress) {
return false;
}
}
@@ -401,25 +711,18 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
} else if (roleLevel == 2 || roleLevel == 3) { // type == RoomSettingBean.QXRoomSettingTypeRoomTypeBoy || type == RoomSettingBean.QXRoomSettingTypeRoomTypeGirl || 2025年9月19日11:21:04将男神女神合并成互娱最总是新添加一个标签
if (type == RoomSettingBean.QXRoomSettingTypeRoomTypeSing || type == RoomSettingBean.QXRoomSettingTypeRoomTypeAuction ||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU ||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy ||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG || type== RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT ||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy || type == RoomSettingBean.QXRoomSettingTypeRoomSetting ||
type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy || type == RoomSettingBean.QXRoomSettingTypeRoomMyDress ||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG || type == RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT ||
type == RoomSettingBean.QXRoomSettingTypeRoomClearMessage || type == QXRoomSettingTypeRoomOrderMic || type == RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen
|| type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomBgImage || type == -1) {
if (onMic) {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy
|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress ) {
return false;
}
} else {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy
|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress ) {
return false;
}
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy
|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress || type == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
return false;
}
// if (onMic) {
// if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy
// || type == RoomSettingBean.QXRoomSettingTypeRoomMyDress /*|| type == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG*/) {
@@ -434,12 +737,13 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
return true;
}
if (type >= RoomSettingBean.QXRoomSettingTypeRoomLeave &&
type <= RoomSettingBean.QXRoomSettingTypeRoomReport || type == RoomSettingBean.QXRoomSettingTypeRoomFloatingRed) {
type <= RoomSettingBean.QXRoomSettingTypeRoomReport || type == RoomSettingBean.QXRoomSettingTypeRoomFloatingRed || type == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears ||
type == QXRoomSettingTypeRoomTimeSpace || type == QXRoomSettingTypeRoomTimeRedSound) {
return true;
} else {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy
|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress ) {
|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress) {
return false;
}
@@ -449,14 +753,14 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
// }
}
return false;
}
else { // 普通用户只显示更多操作中的特定条目
} else { // 普通用户只显示更多操作中的特定条目
return type == RoomSettingBean.QXRoomSettingTypeRoomLeave ||
type == RoomSettingBean.QXRoomSettingTypeRoomShare ||
type == RoomSettingBean.QXRoomSettingTypeRoomCloseEffects ||
type == RoomSettingBean.QXRoomSettingTypeRoomReport ||
type == RoomSettingBean.QXRoomSettingTypeRoomFloatingRed||
type == RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen;
type == RoomSettingBean.QXRoomSettingTypeRoomFloatingRed ||
type == RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen
|| type == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears || type == QXRoomSettingTypeRoomTimeSpace || type == QXRoomSettingTypeRoomTimeRedSound;
}
@@ -529,4 +833,24 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
ToastUtils.show(s);
dismiss();
}
@Override
public void blindBoxStatus(List<BlindBoxStatus> blindBoxStatus) {
for (int i = 0; i < blindBoxStatus.size(); i++) {
int giftBagId = blindBoxStatus.get(i).getGift_bag_id();
int status = blindBoxStatus.get(i).getStatus();
for (int j = 0; j < filteredList.size(); j++) {
for (int k = 0; k < filteredList.get(j).getChildren().size(); k++) {
if ((giftBagId == 11 && filteredList.get(j).getChildren().get(k).getType() == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears) ||
(giftBagId == 12 && filteredList.get(j).getChildren().get(k).getType() == RoomSettingBean.QXRoomSettingTypeRoomTimeSpace)) {
if (status != 1) {
filteredList.get(j).getChildren().remove(k);
}
}
}
}
}
adapter.notifyDataSetChanged();
}
}

View File

@@ -67,7 +67,7 @@ import java.util.Map;
public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresenter, FragmentRoomUserInfoBinding> implements RoomUserContacts.View {
private String room_id, user_id, pit_number;
private UserInfo userInfo;
private UserInfo userInfo=new UserInfo();
CustomPopWindow mCustomPopWindow;
private String is_room_owner;//是否是房主
private String is_host;//是否是主持
@@ -460,6 +460,10 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
}
this.userInfo = userInfo1;
if (userInfo==null || userInfo.getUser_code() == null || userInfo.getUser_id()==0){
ToastUtils.show("用户数据错误,稍后重试");
return;
}
mBinding.ivAvatar.setData(userInfo.getAvatar(), "", userInfo.getNobility_image() + "");
String sex = userInfo.getSex() == 1 ? "" : "";
mBinding.tvId.setText(sex + " ID:" + userInfo.getUser_code());

View File

@@ -11,7 +11,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_e3fae4">
android:background="@mipmap/home_bj">
<com.xscm.moduleutil.widget.CustomTopBar
android:id="@+id/top_bar"
@@ -58,6 +58,7 @@
android:layout_below="@+id/tv_title"
android:layout_marginTop="@dimen/dp_8"
android:background="@drawable/bg_r16_fff"
android:backgroundTint="#31433F"
android:paddingHorizontal="@dimen/dp_11"
android:paddingVertical="@dimen/dp_16" />
@@ -80,6 +81,7 @@
android:layout_height="match_parent"
android:layout_marginHorizontal="@dimen/dp_12"
android:background="@drawable/bg_r16_fff"
android:backgroundTint="@color/transparent"
android:layout_marginBottom="@dimen/dp_10"
android:orientation="vertical">
@@ -91,16 +93,16 @@
android:layout_marginTop="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_16"
android:textSize="@dimen/sp_16"
app:tabIndicatorColor="@color/colorPrimary"
app:tabIndicatorColor="@color/transparent"
app:tabIndicatorFullWidth="false"
app:tabIndicatorGravity="bottom"
android:background="@color/transparent"
app:tabRippleColor="@color/transparent"
app:tabIndicatorHeight="@dimen/dp_2"
app:tabIndicatorHeight="0dp"
app:tabMinWidth="@dimen/dp_20"
app:tabMode="scrollable"
app:tabSelectedTextColor="@color/black"
app:tabTextColor="@color/colorBlack45" />
app:tabSelectedTextColor="@color/white"
app:tabTextColor="@color/colorWhite45" />
<androidx.viewpager2.widget.ViewPager2

View File

@@ -9,12 +9,25 @@
android:id="@+id/tabText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/colorBlack45"
android:textColor="@color/colorWhite45"
android:textSize="@dimen/sp_14"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="任务" />
<TextView
android:id="@+id/tabCount"
android:layout_width="8dp"
android:layout_height="8dp"
android:background="@drawable/bg_r99_2b2482"
android:backgroundTint="#E54860"
android:gravity="center"
tools:text="10"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
app:layout_constraintTop_toTopOf="@id/tabText"
app:layout_constraintEnd_toEndOf="@id/tabText"/>
<ImageView
android:id="@+id/tabIcon"
android:layout_width="wrap_content"

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/horizontal_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" />

View File

@@ -27,7 +27,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:text="最高可获得?金币"
android:textColor="@color/color_FF999999"
android:textColor="#F1F1F1"
android:textSize="@dimen/sp_12"
/>
@@ -49,7 +49,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:text="满?金币"
android:textColor="@color/color_FF999999"
android:textColor="@color/white"
android:textSize="@dimen/sp_12"
/>

View File

@@ -4,7 +4,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:layout_marginBottom="@dimen/dp_20">
android:background="@drawable/bg_r12_f9f9f9"
android:backgroundTint="#332A46"
android:paddingVertical="@dimen/dp_10"
android:paddingHorizontal="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_8">
<com.xscm.moduleutil.widget.GifAvatarOvalView
android:id="@+id/task_pic"
@@ -22,7 +26,7 @@
android:layout_marginStart="@dimen/dp_2"
android:layout_marginEnd="@dimen/dp_4"
tools:text="任务名称"
android:textColor="@color/color_FF333333"
android:textColor="#F1EAFF"
android:textSize="@dimen/sp_14"
app:layout_constraintEnd_toStartOf="@+id/task_type"
app:layout_constraintStart_toEndOf="@id/task_pic"
@@ -47,7 +51,7 @@
android:layout_marginHorizontal="@dimen/dp_4"
tools:text="+10"
android:gravity="start"
android:textColor="#FF8827"
android:textColor="#FFB027"
android:textSize="@dimen/sp_14"
app:layout_constraintEnd_toStartOf="@+id/task_type"
app:layout_constraintStart_toEndOf="@id/task_jb"
@@ -58,8 +62,8 @@
android:layout_width="@dimen/dp_60"
android:layout_height="@dimen/dp_30"
android:gravity="center"
android:textColor="#C134EE"
android:background="@drawable/bg_r99_e24171"
android:textColor="@color/white"
android:background="@drawable/cs"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />

View File

@@ -1,12 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tv_title"
android:textSize="@dimen/sp_16"
android:gravity="center|left"
android:layout_marginTop="@dimen/dp_16"
android:padding="@dimen/dp_2"
android:textColor="@color/color_FF333333"
android:textStyle="bold"
android:text="标题" />
android:orientation="vertical"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tv_title"
android:textSize="@dimen/sp_16"
android:gravity="center|left"
android:layout_marginTop="@dimen/dp_16"
android:padding="@dimen/dp_2"
android:textColor="@color/color_FF333333"
android:textStyle="bold"
android:text="标题"/>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/rv_content"
android:layout_marginTop="@dimen/dp_8"
android:layout_marginBottom="@dimen/dp_8"
android:padding="@dimen/dp_2"
/>
</LinearLayout>

View File

@@ -181,7 +181,18 @@
android:text="房间补贴"
android:visibility="gone"
/>
<TextView
android:id="@+id/tv_luck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="幸运流水:12345"
android:textColor="@color/color_FFA5A5A5"
android:textSize="@dimen/sp_12"
app:layout_constraintTop_toBottomOf="@+id/v"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginEnd="@dimen/dp_10"
app:layout_constraintEnd_toEndOf="parent"
android:visibility="gone"/>
<ImageView
android:id="@+id/im_sh"

View File

@@ -10,7 +10,7 @@ import com.xscm.modulemain.Application;
*/
public class AppContext extends Application {
private static boolean isKilled = false;
private boolean mBeautyInited;
@Override
@@ -18,7 +18,7 @@ public class AppContext extends Application {
super.onCreate();
ToastUtils.init(this);
ARouter.init(this);
isKilled = true;
/* mqttClient = MyMQTTClient.getInstance(this);
mqttClient.initialize("tcp://81.70.45.221:1883");
new Thread(() -> {
@@ -39,6 +39,15 @@ public class AppContext extends Application {
// });
// L.setDeBug(BuildConfig.DEBUG);
}
public static boolean isKilled() {
return isKilled;
}
public static void setKilled(boolean killed) {
isKilled = killed;
}
public static void initSdk() {
// CommonAppContext context = CommonAppContext.getInstance();

View File

@@ -3,15 +3,25 @@ package com.qxcm.qxlive;
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.PersistableBundle;
import android.util.Log;
import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.VideoView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.LogUtils;
import com.qxcm.qxlive.databinding.ActivityLaunchPageBinding;
import com.tencent.qgame.animplayer.AnimConfig;
import com.tencent.qgame.animplayer.inter.IAnimListener;
import com.xscm.modulemain.BaseMvpActivity;
import com.xscm.modulemain.activity.WebViewActivity;
import com.xscm.moduleutil.activity.IPresenter;
@@ -60,11 +70,12 @@ public class LaunchPageActivity extends BaseMvpActivity<IPresenter,ActivityLaunc
private Handler handler;
private PolicyDialog policyDialog;
private AppStateListener appStateListener;
private VideoView videoView;
@Override
public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
super.onCreate(savedInstanceState, persistentState);
LogUtils.e("4444","LaunchPageActivity onCreate");
// 获取Application实例并设置监听器
CommonAppContext app = (CommonAppContext) getApplication();
appStateListener = AppStateManager.getInstance();
@@ -113,6 +124,35 @@ public class LaunchPageActivity extends BaseMvpActivity<IPresenter,ActivityLaunc
initLogin();
}
};
}
@Override
protected void onDestroy() {
// 如果 PolicyDialog 仍在显示,则 dismiss 它
if (policyDialog != null && policyDialog.isShowing()) {
policyDialog.dismiss();
policyDialog = null;
}
// 移除所有待处理的回调以防止内存泄漏
if (handler != null) {
handler.removeCallbacksAndMessages(null);
}
if (videoView != null) {
videoView.stopPlayback();
}
super.onDestroy();
}
@Override
protected IPresenter bindPresenter() {
return null;
}
private void setEnter(){
if (SpUtil.isAgreePolicy()) {
initLogin();
// //延迟1.5秒执行
@@ -137,32 +177,86 @@ public class LaunchPageActivity extends BaseMvpActivity<IPresenter,ActivityLaunc
policyDialog.show();
}
}
@Override
protected void onDestroy() {
// 如果 PolicyDialog 仍在显示,则 dismiss 它
if (policyDialog != null && policyDialog.isShowing()) {
policyDialog.dismiss();
policyDialog = null;
}
// 移除所有待处理的回调以防止内存泄漏
if (handler != null) {
handler.removeCallbacksAndMessages(null);
}
super.onDestroy();
}
@Override
protected IPresenter bindPresenter() {
return null;
}
@Override
protected void initView() {
if (AppContext.isKilled()) {
videoView = new VideoView(this);
// 创建LayoutParams并设置MATCH_PARENT
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
);
// 设置gravity来填充整个布局
params.gravity = Gravity.FILL;
mBinding.root.addView(videoView, params);
// 设置视频缩放模式为拉伸填充
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
// 获取视频的宽高
int videoWidth = mp.getVideoWidth();
int videoHeight = mp.getVideoHeight();
// 获取屏幕的宽高
int screenWidth = getResources().getDisplayMetrics().widthPixels;
int screenHeight = getResources().getDisplayMetrics().heightPixels;
// 计算缩放比例
float scaleX = (float) screenWidth / videoWidth;
float scaleY = (float) screenHeight / videoHeight;
// 选择较大的缩放比例,确保视频填满屏幕
float scale = Math.max(scaleX, scaleY);
// 计算实际显示的宽高
int scaledWidth = (int) (videoWidth * scale);
int scaledHeight = (int) (videoHeight * scale);
// 设置VideoView的布局参数
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(scaledWidth, scaledHeight);
layoutParams.gravity = Gravity.CENTER;
videoView.setLayoutParams(layoutParams);
}
});
// 设置视频路径从raw资源中
String videoPath = "android.resource://" + getPackageName() + "/" + R.raw.app_start;
// 设置播放完成监听器
videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
// 播放完成后执行后续操作
setEnter();
}
});
// 设置错误监听器
videoView.setOnErrorListener(new MediaPlayer.OnErrorListener() {
@Override
public boolean onError(MediaPlayer mp, int what, int extra) {
// 发生错误时也执行后续操作
setEnter();
return true; // 返回true表示已处理错误
}
});
// 设置视频路径并开始播放
try {
videoView.setVideoURI(Uri.parse(videoPath));
videoView.requestFocus(); // 请求焦点以确保视频能够播放
videoView.start();
} catch (Exception e) {
e.printStackTrace();
// 如果设置视频路径时出错,直接执行后续操作
setEnter();
}
AppContext.setKilled(false);
} else {
setEnter();
}
}
@@ -177,20 +271,19 @@ public class LaunchPageActivity extends BaseMvpActivity<IPresenter,ActivityLaunc
}
@Override
protected int getLayoutId() {
return R.layout.activity_launch_page;
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (!isTaskRoot()) {
finish();
return;
}
}
// @Override
// protected void onCreate(@Nullable Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// if (!isTaskRoot()) {
// finish();
// return;
// }
//
// }
}

View File

@@ -89,14 +89,14 @@
</LinearLayout>
<ImageView
android:id="@+id/cover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:src="@mipmap/screen"
android:scaleType="centerCrop"
android:visibility="visible" />
<!-- <ImageView-->
<!-- android:id="@+id/cover"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:clickable="true"-->
<!-- android:src="@mipmap/screen"-->
<!-- android:scaleType="centerCrop"-->
<!-- android:visibility="visible" />-->
</FrameLayout>
</layout>

Binary file not shown.

View File

@@ -1159,24 +1159,24 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
if (TUIChatConfigClassic.isShowInputBarCustom()
&& getChatInfo().isEnableCustomHelloMessage()
&& !excludeItems.contains(TUIChatConfigClassic.CUSTOM)) {
actionUnit = new InputMoreItem() {};
actionUnit.setIconResId(R.drawable.chat_more_input_custom_message);
actionUnit.setName(getResources().getString(R.string.test_custom_action));
actionUnit.setActionId(CustomHelloMessage.CUSTOM_HELLO_ACTION_ID);
actionUnit.setPriority(10);
actionUnit.setOnClickListener(actionUnit.new OnActionClickListener() {
@Override
public void onClick() {
Gson gson = new Gson();
CustomHelloMessage customHelloMessage = new CustomHelloMessage();
customHelloMessage.version = TUIChatConstants.version;
String data = gson.toJson(customHelloMessage);
TUIMessageBean info = ChatMessageBuilder.buildCustomMessage(data, customHelloMessage.text, customHelloMessage.text.getBytes());
mChatLayout.sendMessage(info, false);
}
});
mInputMoreActionList.add(actionUnit);
// actionUnit = new InputMoreItem() {};
// actionUnit.setIconResId(R.drawable.chat_more_input_custom_message);
// actionUnit.setName(getResources().getString(R.string.test_custom_action));
// actionUnit.setActionId(CustomHelloMessage.CUSTOM_HELLO_ACTION_ID);
// actionUnit.setPriority(10);
// actionUnit.setOnClickListener(actionUnit.new OnActionClickListener() {
// @Override
// public void onClick() {
// Gson gson = new Gson();
// CustomHelloMessage customHelloMessage = new CustomHelloMessage();
// customHelloMessage.version = TUIChatConstants.version;
//
// String data = gson.toJson(customHelloMessage);
// TUIMessageBean info = ChatMessageBuilder.buildCustomMessage(data, customHelloMessage.text, customHelloMessage.text.getBytes());
// mChatLayout.sendMessage(info, false);
// }
// });
// mInputMoreActionList.add(actionUnit);
}
List<InputMoreItem> extensionList = getExtensionInputMoreList();

View File

@@ -1336,24 +1336,24 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
}
if (!excludeItems.contains(TUIChatConfigMinimalist.CUSTOM) && TUIChatConfigMinimalist.isShowInputBarCustom()) {
InputMoreItem helloMessage = new InputMoreItem() {};
helloMessage.setIconResId(R.drawable.chat_minimalist_more_action_custom_icon);
helloMessage.setName(getResources().getString(R.string.test_custom_action));
helloMessage.setActionId(CustomHelloMessage.CUSTOM_HELLO_ACTION_ID);
helloMessage.setPriority(10);
helloMessage.setOnClickListener(helloMessage.new OnActionClickListener() {
@Override
public void onClick() {
Gson gson = new Gson();
CustomHelloMessage customHelloMessage = new CustomHelloMessage();
customHelloMessage.version = TUIChatConstants.version;
String data = gson.toJson(customHelloMessage);
TUIMessageBean info = ChatMessageBuilder.buildCustomMessage(data, customHelloMessage.text, customHelloMessage.text.getBytes());
mChatLayout.sendMessage(info, false);
}
});
mInputMoreActionList.add(helloMessage);
// InputMoreItem helloMessage = new InputMoreItem() {};
// helloMessage.setIconResId(R.drawable.chat_minimalist_more_action_custom_icon);
// helloMessage.setName(getResources().getString(R.string.test_custom_action));
// helloMessage.setActionId(CustomHelloMessage.CUSTOM_HELLO_ACTION_ID);
// helloMessage.setPriority(10);
// helloMessage.setOnClickListener(helloMessage.new OnActionClickListener() {
// @Override
// public void onClick() {
// Gson gson = new Gson();
// CustomHelloMessage customHelloMessage = new CustomHelloMessage();
// customHelloMessage.version = TUIChatConstants.version;
//
// String data = gson.toJson(customHelloMessage);
// TUIMessageBean info = ChatMessageBuilder.buildCustomMessage(data, customHelloMessage.text, customHelloMessage.text.getBytes());
// mChatLayout.sendMessage(info, false);
// }
// });
// mInputMoreActionList.add(helloMessage);
}
mInputMoreActionList.addAll(getExtensionInputMoreList());