2 Commits

Author SHA1 Message Date
lzl
cb9cc716db Merge branch 'branch_new' into branch_new_69 2025-12-10 10:10:56 +08:00
lzl
7030256e70 管理不可以设置主持。 2025-12-09 19:34:52 +08:00
239 changed files with 2937 additions and 5328 deletions

View File

@@ -74,7 +74,8 @@ public class AppUpdateDialog extends BaseDialog<DialogAppUpdateBinding> implemen
mProgressDialog.setCanceledOnTouchOutside(false);
mProgressDialog.setMessage("下载中请稍等!!!");
mProgressDialog.show();
DownloadUtil downloadUtil = new DownloadUtil(getContext(),appUpdateModel.getUrl(),this);
DownloadUtil downloadUtil = new DownloadUtil(getContext());
downloadUtil.downloadFile(appUpdateModel.getUrl(), this);
}
}
@@ -117,7 +118,6 @@ public class AppUpdateDialog extends BaseDialog<DialogAppUpdateBinding> implemen
mProgressDialog.dismiss();
}
try {
LogUtils.e("installAppSuccess",localPath);
AppUtils.installApp(localPath);
} catch (Exception e) {
Logger.e("installAppError", e);

View File

@@ -186,7 +186,7 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
helper.getView(R.id.dy_lookmore_tv).setVisibility(GONE);
helper.getView(R.id.dy_content_tv).setVisibility(GONE);
} else {
helper.getView(R.id.dy_lookmore_tv).setVisibility(GONE);
helper.getView(R.id.dy_lookmore_tv).setVisibility(VISIBLE);
helper.getView(R.id.dy_content_tv).setVisibility(VISIBLE);
}
helper.getView(R.id.dy_lookmore_tv).getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@@ -196,7 +196,7 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
TextView view = helper.getView(R.id.dy_content_tv);
int lineCount = view.getLineCount();
if (lineCount >= 7) {
helper.getView(R.id.dy_lookmore_tv).setVisibility(GONE);
helper.getView(R.id.dy_lookmore_tv).setVisibility(VISIBLE);
helper.getView(R.id.dy_content_tv).getViewTreeObserver().removeOnPreDrawListener(this);//销毁
} else {
helper.getView(R.id.dy_lookmore_tv).setVisibility(GONE);
@@ -274,11 +274,9 @@ public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewH
}
if (item.getRoom_id() != null && !item.getRoom_id().equals("0")) {
helper.setText(R.id.gensui, "");
helper.getView(R.id.gensui).setBackgroundResource(com.xscm.moduleutil.R.mipmap.gsui);
helper.setText(R.id.gensui, "跟随");
} else if (item.getRoom_id() == null || item.getRoom_id().equals("0")) {
helper.setText(R.id.gensui, "");
helper.getView(R.id.gensui).setBackgroundResource(com.xscm.moduleutil.R.mipmap.six);
helper.setText(R.id.gensui, "私信");
}
//分享数
// helper.setText(R.id.dy_zs, item.getRewards_num() != null ? item.getRewards_num() : "0");

View File

@@ -80,7 +80,6 @@ public class GiftRoomAdapter extends BaseAdapter {
private static RoonGiftModel sGiftModel;
private GiftRoomAdapter mAdapter;
private RoonGiftModel mGiftModel;
public void setGiftModel(GiftRoomAdapter adapter, RoonGiftModel gift) {
sAdapter = new WeakReference<>(adapter);
sGiftModel = gift;
@@ -130,7 +129,7 @@ public class GiftRoomAdapter extends BaseAdapter {
viewHolder.tv_gift_price = (TextView) convertView.findViewById(R.id.tv_gift_price);
viewHolder.iv_gift_pic = (ImageView) convertView.findViewById(R.id.iv_gift_pic);
viewHolder.ivDownOn = (ImageView) convertView.findViewById(R.id.iv_down_on);
viewHolder.iv_gift_select = (ImageView) convertView.findViewById(R.id.iv_gift_select);
viewHolder.iv_gift_select= (ImageView) convertView.findViewById(R.id.iv_gift_select);
// im_heart现在位于顶层布局中
viewHolder.im_heart = (ImageView) convertView.findViewById(R.id.im_heartssss);
@@ -141,32 +140,25 @@ public class GiftRoomAdapter extends BaseAdapter {
viewHolder.item_layout.setOnClickListener(v -> {
// RoonGiftModel clickedModel = (RoonGiftModel) v.getTag();
if (giftModel.getIs_lock() == 0) {
if (giftModel.getIs_lock()==0) {
EventBus.getDefault().post(new RoomGiftClickToEvent(this, giftModel, 1));
} else if (giftModel.getIs_lock() == 1) {
}else if (giftModel.getIs_lock()==1){
ToastUtils.show("当前属于爵位礼物,请开通爵位");
}
});
if (giftModel.getIs_lock() == 0) {
if (giftModel.getIs_lock()==0){
viewHolder.iv_gift_select.setVisibility(GONE);
} else {
}else {
viewHolder.iv_gift_select.setVisibility(VISIBLE);
}
if (giftModel.getIs_cp() == 0 && giftModel.getIs_teacher() == 0 ) {//这是cp礼物
viewHolder.im_heart.setVisibility(GONE);
} else {
if (giftModel.getIs_cp()==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

@@ -297,18 +297,12 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
roonGiftModel.setNum(giftModel.getNum());
if (giftModel.getGift_id().equals(id)) {
if (!giftModel.isChecked()) {
giftModel.setChecked(true);
roonGiftModel.setChecked(giftModel.isChecked());
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type, roonGiftModel));
}else {
giftModel.setChecked(false);
roonGiftModel.setChecked(giftModel.isChecked());
giftModel.setChecked(true);
}
} else {
giftModel.setChecked(false);
roonGiftModel.setChecked(giftModel.isChecked());
}
}
if (event.adapter != null && event.adapter.get() != null) {
event.adapter.get().notifyDataSetChanged();
@@ -327,20 +321,13 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
if (giftModel.getGift_id().equals(id)) {
selGift = giftModel;
if (!giftModel.isChecked()) {
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type, roonGiftModel));
giftModel.setChecked(true);
roonGiftModel.setChecked(giftModel.isChecked());
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type, roonGiftModel));
}else {
giftModel.setChecked(false);
roonGiftModel.setChecked(giftModel.isChecked());
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type, roonGiftModel));
}
} else {
giftModel.setChecked(false);
roonGiftModel.setChecked(giftModel.isChecked());
// EventBus.getDefault().post(new GiftUserRefreshEvent(false, event.type, roonGiftModel));
EventBus.getDefault().post(new GiftUserRefreshEvent(false, event.type, null));
}
}
if (event.adapter != null && event.adapter.get() != null) {
event.adapter.get().notifyDataSetChanged();

View File

@@ -161,7 +161,7 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
//设置mqtt环境 false 测试环境 true 正式环境
// ExternalResConstants.INSTANCE.setIS_MQTT_RELEASE(false);
//设置http环境 false 测试环境 true 正式环境
ExternalResConstants.INSTANCE.setIS_HTTP_RELEASE(true);
ExternalResConstants.INSTANCE.setIS_HTTP_RELEASE(false);
currentEnvironment = ExternalResConstants.INSTANCE.HTTP_PATH();
initialization();

View File

@@ -16,6 +16,6 @@ public class BlackUserBean {
private int sex;
private String user_code;
private int is_online;
private int is_follow;// 是否关注 0:未关注 1已关注 2别人关注了你你没有关注别人这个2只会在粉丝中使用
private int is_follow;
private List<String> icon;
}

View File

@@ -3,18 +3,16 @@ package com.xscm.moduleutil.bean;
import java.util.List;
import lombok.Data;
/**
* @author qx
* @data 2025/5/27
* @description: 礼盒数据
*@author qx
*@data 2025/5/27
*@description: 礼盒数据
*/
@Data
public class GiftBoxBean {
private String user_gold;//累计获取的金币
private List<GiftBean> gift_box_list;
private List<TaskDataBean> tasks;
private TaskDataBean tasks;
@Data
public static class GiftBean {
// private String giftName; //初级礼盒、高级礼盒
@@ -23,25 +21,10 @@ public class GiftBoxBean {
// private String giftTypeNumber; //当前的百分比
// private String giftTypeStatus; //是否已经可以
/*{
"id":2,
"name":"高级礼盒",
"title":"最高可获得10000金币",
"icon":"",
"highest_gain":"10000",
"meet":"300",
"unlock_progress":0,
"all_number":"1",
"taday_number":0,
"taday_number_left":1,
"status":0,
"status_str":"未解锁"
}*/
private String id;//礼盒ID
private String name;//礼盒名称
private String title; //标题
private String icon;//图标
private String icon ;//图标
private String highest_gain;//最高获得金币数
private String meet;//满多少金币可抽
private String unlock_progress;// //解锁进度
@@ -54,62 +37,25 @@ public class GiftBoxBean {
@Data
public static class TaskDataBean {
private List<DailyTasksBean> task_list;
// private List<DailyTasksBean> daily_tasks_special;
// private List<DailyTasksBean> usual_tasks;
// private List<DailyTasksBean> teacher_tasks;
private List<DailyTasksBean> daily_tasks;
private List<DailyTasksBean> daily_tasks_special;
private List<DailyTasksBean> usual_tasks;
private List<DailyTasksBean> teacher_tasks;
private int task_type_id;
private String task_type_name;
private int is_lock;//锁:0 不开启锁 1 开启锁
@Data
public static class DailyTasksBean {
/* {
"task_id":20,
"icon":null,
"task_name":"每日在房间时长 15 分钟(0/15)",
"target_quantity":900,
"task_type":2,
"jump_type":4,
"tasks_bag_id":0,
"task_status":1,
"task_type_str":"去完成",
"jump_type_str":"跳转房间",
"from_id":6040,
"is_time":1,
"processing_type":2,
"processing_type_str":"去观看",
"reward_str":"25金币笨笨狗x1,
仙女之星头像框,
三八大杠"
}*/
private int task_id;////任务Id
private String icon;//图标
private String task_name;//任务名称
private int target_quantity;//目标完成数量
private int task_type;//任务类型 1每日任务 2每日特殊任务 3平台常规任务
/**
* 0 不跳转
* 1 跳转实名
* 2 跳转我的相册
* 3 跳转绑定管理
* 4 跳转房间
* 5 跳转申请加入公会
* 6 跳转充值
*/
private int jump_type; //跳转类型
private int tasks_bag_id; //任务礼盒ID
private int task_status;//任务状态1完成 2去领取 3已领取
private String task_type_str; //任务状态
private String jump_type_str; //跳转类型提示
private String from_id;
private int is_time;
private int processing_type;//跳转状态:
private String processing_type_str;//跳转状态
private String reward_str;//1奖励
private String student_id;//徒弟ID
private int task_id;////任务Id
private String task_name;//任务名称
private String icon;//图标
private int gold_reward; //奖励金币
private int target_quantity;//目标完成数量
private int task_type;//任务类型 1每日任务 2每日特殊任务 3平台常规任务
private int task_status;//任务状态1完成 2去领取 3已领取
private String task_type_str; //任务状态
private int processing_type;//跳转状态:
private String processing_type_str;//跳转状态
private String from_id;
private int reward_type;//1金币 2钻石
}
}

View File

@@ -58,7 +58,7 @@ public class PlaceholderBean {
private String nickname1;
private String avatar;
private String total;
private String rank="";
private String rank;
private List<String> icon;
private String room_name;
private String room_id;

View File

@@ -111,9 +111,6 @@ public class RoomMessageEvent extends BaseEvent {
private String sign_day;//被签约天数
private String current_body_value;//被签约身价
private String status = "";
private String from_id = "";
}
@Data

View File

@@ -35,8 +35,7 @@ public class RoonGiftModel {
private int gift_bag;//10天空之境 11岁月之城 12时空之巅
private int is_lock;//爵位礼物 0不锁 1
private int is_cp;//1:是 0不是 是不是cp心动礼物
private int is_teacher;//1:是 0不是 是不是师徒礼物
private int is_cp;//1:是 0不是
public boolean isCan_send_self() {
if ( isManghe()) {
return true;

View File

@@ -1,115 +0,0 @@
package com.xscm.moduleutil.bean
import com.chad.library.adapter.base.entity.MultiItemEntity
/**
* 项目名称:羽声语音
* 时间2025/12/12 10:35
* 用途:签到实体类
*/
class SignInData : MultiItemEntity{
val TYPE_NORMAL: Int = 0 // 普通类型使用day_sgin布局
val TYPE_DOUBLE: Int = 1 // 双倍宽度类型使用day_sgin2布局
var viewType: Int = TYPE_NORMAL // 默认为普通类型
var day: Int = 0 //第几天
var sign_in_date: String = "" //日期
var sign_in_status: Int = 0 // 签到状态1已签到 0未签到
var sign_in_status_str: String = "" //已签到
var is_today: Int = 0 //是否是当天 0否 1是
var gift_name: String = "" //礼物名称
var num: String = "" //数量
var gift_price: Int = 0 //价格
var type: Int = 0 //类型: 1金币 2礼物 3装扮 4钻石
var base_image: String = "" //礼物图片
override fun getItemType(): Int {
return viewType
}
/* "gift_bag": [
{
"day": 1, //第几天
"sign_in_date": "2025-12-09", //日期
"sign_in_status": 1, //签到状态1已签到 0未签到
"sign_in_status_str": "已签到",
"is_today": 0, //是否是当天 0否 1是
"gift_name": "金币", //礼物名称
"num": 1, //数量
"gift_price": 1, //价格
"type": 1, //类型: 1金币 2礼物 3装扮 4钻石
"base_image": "https://test.vespa.qxyushen.top/static/image/icon/gold.png" //礼物图片
},
{
"day": 2,
"sign_in_date": "2025-12-10",
"sign_in_status": 1,
"sign_in_status_str": "已签到",
"is_today": 0,
"gift_name": "打工狗",
"num": "1 个",
"gift_price": "9",
"type": 2,
"base_image": "https://cos.xscmmidi.site/admin/3143tianxuanbanzhuangou_17615346376493.png"
},
{
"day": 3,
"sign_in_date": "2025-12-11",
"sign_in_status": 1,
"sign_in_status_str": "已签到",
"is_today": 0,
"gift_name": "神皇",
"num": "3 天",
"gift_price": 30,
"type": 3,
"base_image": "https://midi01.oss-cn-beijing.aliyuncs.com/5544shenhuang_17579016149523.png"
},
{
"day": 4,
"sign_in_date": "2025-12-12",
"sign_in_status": 1,
"sign_in_status_str": "已签到",
"is_today": 1,
"gift_name": "心动喷发",
"num": "2 个",
"gift_price": "100",
"type": 2,
"base_image": "https://cos.xscmmidi.site/admin/3300xindongpenfa_17615347008740.png"
},
{
"day": 5,
"sign_in_date": "2025-12-13",
"sign_in_status": 0,
"sign_in_status_str": "未签到",
"is_today": 0,
"gift_name": "钻石",
"num": 20,
"gift_price": 1,
"type": 4,
"base_image": "https://test.vespa.qxyushen.top/static/image/icon/gold.png"
},
{
"day": 6,
"sign_in_date": "2025-12-14",
"sign_in_status": 0,
"sign_in_status_str": "未签到",
"is_today": 0,
"gift_name": "王者之戒",
"num": "1 个",
"gift_price": "19",
"type": 2,
"base_image": "https://cos.xscmmidi.site/admin/5390wangzhezhijie_17615353361010.png"
},
{
"day": 7,
"sign_in_date": "2025-12-15",
"sign_in_status": 0,
"sign_in_status_str": "未签到",
"is_today": 0,
"gift_name": "财源滚滚",
"num": "30 天",
"gift_price": 288,
"type": 3,
"base_image": "https://midi01.oss-cn-beijing.aliyuncs.com/2160caiyuangunguntouxiangkuang_17579008394073.png"
}
]*/
}

View File

@@ -1,11 +0,0 @@
package com.xscm.moduleutil.bean
/**
* 项目名称:羽声语音
* 时间2025/12/16 11:35
* 用途:任务未领取角标
*/
class TasksMessage {
var num: Int=0
var not_received_tasks_num : Int=0 //任务未领取奖励数 这是心跳中返回的参数,用于展示任务未领取角标,是在房间内展示的
}

View File

@@ -1,11 +0,0 @@
package com.xscm.moduleutil.bean
/**
* 项目名称:羽声语音
* 时间2025/12/12 14:54
* 用途:签到状态
*/
class TasksSignStatus {
var status : Int=0
var status_str: String=""
}

View File

@@ -1,7 +1,5 @@
package com.xscm.moduleutil.bean;
import java.util.List;
import lombok.Data;
@Data
@@ -11,9 +9,8 @@ public class UserResultResp {
private String user_id;
private String user_code;
private String nickname;
private String avatar;
private int sex;
private List<String> icon;
private String head_picture;
private String sex;
private String follow;
private String fans_count;
private String online_text;

View File

@@ -11,21 +11,10 @@ public class EMMessageInfo implements MultiItemEntity {
public static final int QXRoomMessageTypeJoin = 1001;
/// 用户退出房间
public static final int QXRoomMessageTypeQuit = 1002;
//================================================================================================麦上变化=================================================================
/// 用户上麦
public static final int QXRoomMessageTypeUpSeat = 1003;
/// 用户下麦
public static final int QXRoomMessageTypeDownSeat = 1004;
/// 拍卖者被拉上麦
public static final int QXRoomMessageTypeAuctionIsUp = 1022;
/// 竞拍开始,竞拍麦位发生变化
public static final int QXRoomMessageTypeAuctionIsStart = 1024;
/// 互娱 麦位发生变化
public static final int QXRoomMessageTypeSeatDidChanged = 1053;
/// 房间内换麦
public static final int QXRoomMessageTypehm = 1039;
//==============================================================================================end=================================================================
/// 房间收到礼物
public static final int QXRoomMessageTypeGift = 1005;
/// 设置管理员
@@ -59,11 +48,12 @@ public class EMMessageInfo implements MultiItemEntity {
public static final int QXRoomMessageTypeRoomUpdate = 1020;
/// 清除魅力值
public static final int QXRoomMessageTypeRoom = 1021;
/// 拍卖者被拉上麦
public static final int QXRoomMessageTypeAuctionIsUp = 1022;
/// 拍卖者拍卖开始
public static final int QXRoomMessageTypeAuctionIsSelected = 1023;
/// 竞拍开始,竞拍麦位发生变化
public static final int QXRoomMessageTypeAuctionIsStart = 1024;
/// 竞拍结束
public static final int QXRoomMessageTypeAuctionIsEnd = 1025;
/// 主持延时
@@ -111,7 +101,8 @@ public class EMMessageInfo implements MultiItemEntity {
public static final int QXRoomMessageTypeRoomFriendCreateRelation = 1051;
/// 私密小屋结束时间发生延时
public static final int QXRoomMessageTypeCabinTimeDelay = 1052;
/// 麦位发生变化
public static final int QXRoomMessageTypeSeatDidChanged = 1053;
/// 心动值发生变化
public static final int QXRoomMessageTypeHeartDidChanged = 1054;
/// 小黑屋有人退出房间
@@ -138,7 +129,8 @@ public class EMMessageInfo implements MultiItemEntity {
//已点歌曲数量
public static final int QXRoomMessageTypeSongerNum = 1072;
/// 房间内换麦
public static final int QXRoomMessageTypehm = 1039;
public static final int QXRoomMessageTypeCPText = 1080;//CP特效进入房间的特效
/// 签约开始
public static final int QXRoomMessageTypeSignStartText = 1090;

View File

@@ -26,7 +26,7 @@ public class RoomInfoResp implements Serializable {
private RoomOrderDemand demand;//嘉宾需求
private int rejoin;
private int is_show_self;//盲盒是否送自己
private MusicSongBean song_user_info;//ktv
private MusicSongBean song_user_info;
private MusicSongBean nextInfo;
private RoomAuction room_auction;//拍卖房信息
private RoomCpUserBean cp_user;

View File

@@ -1,12 +1,11 @@
package com.xscm.moduleutil.bean.room;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
@Data
public class RoomOnline implements Serializable {
public class RoomOnline {
private List<RoomOnlineBean> on_pit;//麦上用户
private List<RoomOnlineBean> off_pit;//麦下用户

View File

@@ -2,7 +2,6 @@ package com.xscm.moduleutil.bean.room;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
@@ -13,7 +12,7 @@ import lombok.Data;
* @description: 房间在线列表
*/
@Data
public class RoomOnlineBean implements MultiItemEntity, Serializable {
public class RoomOnlineBean implements MultiItemEntity {
private int itemViewType;
private String typeNames;
private int user_id;

View File

@@ -1,7 +1,6 @@
package com.xscm.moduleutil.dialog;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
@@ -37,7 +36,6 @@ public class ConfirmDialog extends Dialog {
private int countdownSeconds = 0; // 倒计时秒数
private CountDownTimer countDownTimer; // 倒计时对象
private Context context;
public ConfirmDialog(Context context, String title, String message,
String positiveButtonText, String negativeButtonText,
@@ -45,7 +43,6 @@ public class ConfirmDialog extends Dialog {
View.OnClickListener negativeButtonClickListener,
boolean isCountdownEnabled, int countdownSeconds) {
super(context);
this.context = context;
this.title = title;
this.message = message;
this.positiveButtonText = positiveButtonText;
@@ -63,7 +60,6 @@ public class ConfirmDialog extends Dialog {
View.OnClickListener negativeButtonClickListener,
boolean isCountdownEnabled, int countdownSeconds) {
super(context);
this.context = context;
this.title = title;
this.spannableMessage = spannableMessage;
this.positiveButtonText = positiveButtonText;
@@ -182,12 +178,6 @@ public class ConfirmDialog extends Dialog {
countDownTimer.cancel(); // 取消倒计时
countDownTimer = null;
}
if (context instanceof Activity) {
Activity activity = (Activity) context;
if (activity.isFinishing() || activity.isDestroyed()) {
return; // Don't try to dismiss if activity is gone
}
}
super.dismiss();
}
}

View File

@@ -25,11 +25,9 @@ import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.bean.AppPay;
import com.xscm.moduleutil.bean.BindType;
import com.xscm.moduleutil.bean.RechargeBean;
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
import com.xscm.moduleutil.databinding.FragmentRechargeDialogBinding;
import com.xscm.moduleutil.presenter.RechargeDialogContacts;
import com.xscm.moduleutil.presenter.RechargeDialogPresenter;
import com.xscm.moduleutil.utils.ColorManager;
import com.xscm.moduleutil.utils.SpUtil;
import com.xscm.moduleutil.widget.PaymentUtil;
import com.tencent.mm.opensdk.openapi.IWXAPI;
@@ -144,9 +142,6 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
}else{
mBinding.r4.setVisibility(View.GONE);
}
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvPayment, ColorManager.getInstance().getPrimaryColorInt(), 53);
mBinding.tvPayment.setTextColor(ColorManager.getInstance().getButtonColorInt());
}
@Override

View File

@@ -13,7 +13,6 @@ import com.xscm.moduleutil.widget.Constants;
import java.util.List;
import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Field;
@@ -27,7 +26,7 @@ public interface ApiServer {
@FormUrlEncoded //请求验证码
@POST(Constants.SEND_CODE)
Call<BaseModel<String>> sendCode(@Field("mobile") String mobile, @Field("event") String event);
Observable<BaseModel<Object>> sendCode(@Field("mobile") String mobile, @Field("event") String event);
@FormUrlEncoded
@POST(Constants.LOGIN)
@@ -39,7 +38,7 @@ public interface ApiServer {
@FormUrlEncoded //手机换绑
@POST(Constants.MODIFY_MOBILE)
Call<BaseModel<String>> mobileView(@Field("mobile") String mobile, @Field("new_mobile") String new_mobile, @Field("sms_code") String sms_code,@Field("new_sms_code") String new_sms_code);
Call<BaseModel<String>> mobileView(@Field("mobile") String mobile, @Field("new_mobile") String new_mobile, @Field("sms_code") String sms_code);
@GET(Constants.GET_EMOTION)
Call<BaseModel<List<Emotion>>> upEmotion();
@@ -81,7 +80,7 @@ public interface ApiServer {
@FormUrlEncoded
@POST(Constants.dailyTasksReceive)
Call<ResponseBody> dailyTasksReceive(@Field("task_id") String task_id,@Field("student_id") String student_id);
Call<ResponseBody> dailyTasksReceive(@Field("task_id") String task_id);
@FormUrlEncoded
@POST(Constants.dailyTasksComplete)
@@ -499,10 +498,6 @@ public interface ApiServer {
@POST(Constants.JOIN_ROOM)
Call<BaseModel<RoomInfoResp>> roomGetIn(@Field("room_id") String roomId, @Field("password") String password);
@FormUrlEncoded
@POST(Constants.TASK_JUMP_ROOM)
Call<BaseModel<String>> taskJumpRoomId(@Field("task_id") String taskId);
@FormUrlEncoded
@POST(Constants.DELETE_ALBUM_IMAGE)
Call<BaseModel<String>> deleteAlbumImage(@Field("id") String id);
@@ -557,9 +552,6 @@ public interface ApiServer {
@GET(Constants.GET_WALLET)
Call<BaseModel<WalletBean>> wallet();
@GET(Constants.GET_TASKS_MESSAGE)
Call<BaseModel<TasksMessage>> getTasksMessage();
@FormUrlEncoded
@POST(Constants.REDPACKET_CREATE)
Call<ResponseBody> redPacketCreate(@Field("type") int type, @Field("password") String password, @Field("coin_type") int coin_type, @Field("total_amount") String total_amount,
@@ -633,7 +625,7 @@ public interface ApiServer {
@FormUrlEncoded
@POST(Constants.POST_KEEP_XINTIAO)
Call<BaseModel<TasksMessage>> keepXintiao(@Field("room_id") String room_id);
Call<ResponseBody> keepXintiao(@Field("room_id") String room_id);
@FormUrlEncoded
@POST(Constants.DOWN_PIT)
@@ -693,7 +685,7 @@ public interface ApiServer {
@FormUrlEncoded
@POST(Constants.CHANGE_SONG)
Call<BaseModel<String>> changeSong(@Field("room_id") String roomId, @Field("now_did") String now_did,@Field("is_auto_next") String is_auto_next);
Call<BaseModel<String>> changeSong(@Field("room_id") String roomId, @Field("now_did") String now_did);
@FormUrlEncoded
@POST(Constants.POST_HOST_LIST)
@@ -923,14 +915,4 @@ public interface ApiServer {
@FormUrlEncoded
@POST(Constants.POST_SIGN_REFUSE)
Call<BaseModel<String>> signRefuse(@Field("room_id") String room_id);
@GET(Constants.GET_SIGN_IN_LIST)
Call<BaseModel<List<SignInData>>> signIn();
@GET(Constants.POST_DAILY_TASKS_SIGN)
Call<BaseModel<String>> postDailyTasksSign();
@GET(Constants.POST_DAILY_TASKS_SIGN_STATUS)
Call<BaseModel<TasksSignStatus>> postDailyTasksSignStatus();
}

View File

@@ -7,7 +7,6 @@ import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.GsonUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
@@ -80,7 +79,6 @@ public class RetrofitClient {
public interface JoinRoomLoadListener {
void onJoinRoomLoad(String result);
}
public void setJoinRoomLoadListener(JoinRoomLoadListener joinRoomLoadListener) {
this.joinRoomLoadListener = joinRoomLoadListener;
}
@@ -163,16 +161,6 @@ public class RetrofitClient {
return cpListener;
}
private TasksMessageListener tasksMessageListener;
public interface TasksMessageListener {
void onTasksMessageNum(int result);
}
public void setTasksMessageListener(TasksMessageListener tasksMessageListener) {
this.tasksMessageListener = tasksMessageListener;
}
public static RetrofitClient getInstance() {
if (INSTANCE == null) {
@@ -219,30 +207,12 @@ public class RetrofitClient {
sApiServer.appUpdate().compose(new DefaultTransformer<>()).subscribe(observer);
}
public void sendCode(String mobile, String event, BaseObserver<String> observer) {
sApiServer.sendCode(mobile, event).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
if (response.code() == 200) {
BaseModel<String> body = response.body();
if (body.getCode() == 1) {
observer.onNext(body.getMsg());
} else if (body.getCode() == 0) {
ToastUtils.showLong(body.getMsg());
}
}
}
@Override
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
LogUtils.e("sendCode", t.getMessage());
}
});
public void sendCode(String mobile, String event, BaseObserver<Object> observer) {
sApiServer.sendCode(mobile, event).compose(new DefaultTransformer<>()).subscribe(observer);
}
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, BaseObserver<String> observer) {
sApiServer.mobileView(mobile, new_mobile, sms_code).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
if (response.code() == 200) {
@@ -575,7 +545,7 @@ public class RetrofitClient {
} catch (ClassNotFoundException e) {
}
} else {
ToastUtils.showLong(baseModel.getMsg());
ToastUtils.showLong(baseModel.getMsg());
}
}
}
@@ -917,8 +887,8 @@ public class RetrofitClient {
sApiServer.roomRanking(type).compose(new DefaultTransformer<>()).subscribe(observer);
} else if (ranking_type.equals("1") || ranking_type.equals("2")) {
sApiServer.wealthRanking(ranking_type, type).compose(new DefaultTransformer<>()).subscribe(observer);
} else if (ranking_type.equals("3")) {//2025年12月11日14:57:44原是传递的type现在修改成0.只是将真爱榜变成心动榜
sApiServer.loveRanking("0").compose(new DefaultTransformer<>()).subscribe(observer);
} else if (ranking_type.equals("3")) {
sApiServer.loveRanking(type).compose(new DefaultTransformer<>()).subscribe(observer);
} else if (ranking_type.equals("4")) {
sApiServer.guildRanking().compose(new DefaultTransformer<>()).subscribe(observer);
}
@@ -951,8 +921,6 @@ public class RetrofitClient {
BaseModel<List<MyBagDataBean>> baseModel = response.body();
if (baseModel.getCode() == 1) {
observer.onNext(baseModel.getData());
} else if (baseModel.getCode() == 0) {
observer.onNext(new ArrayList<>());
}
}
}
@@ -972,8 +940,6 @@ public class RetrofitClient {
BaseModel<List<MyBagDataBean>> baseModel = response.body();
if (baseModel.getCode() == 1) {
observer.onNext(baseModel.getData());
} else if (baseModel.getCode() == 0) {
observer.onNext(new ArrayList<>());
}
}
}
@@ -995,7 +961,7 @@ public class RetrofitClient {
if (baseModel.getCode() == 1) {
observer.onNext(baseModel.getData());
} else {
// observer.onNext(null);
observer.onNext(null);
}
}
}
@@ -1016,7 +982,7 @@ public class RetrofitClient {
if (baseModel.getCode() == 1) {
observer.onNext(baseModel.getMsg());
} else {
// observer.onNext(null);
observer.onNext(null);
}
}
}
@@ -1092,8 +1058,8 @@ public class RetrofitClient {
sApiServer.dailyTasksOpenBox(gift_box_id).compose(new DefaultTransformer<>()).subscribe(observer);
}
public void dailyTasksReceive(String task_id, String student_id, BaseObserver<String> observer) {
sApiServer.dailyTasksReceive(task_id, student_id).enqueue(new Callback<ResponseBody>() {
public void dailyTasksReceive(String task_id, BaseObserver<String> observer) {
sApiServer.dailyTasksReceive(task_id).enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
@@ -2080,11 +2046,6 @@ public class RetrofitClient {
BaseModel<UserInfo> listBaseModel = response.body();
if (listBaseModel.getCode() == 1) {
observer.onNext(listBaseModel.getData());
}else if (listBaseModel.getCode() == 0){
ToastUtils.showShort(listBaseModel.getMsg());
if (ActivityUtils.getTopActivity().getComponentName().getClassName().contains("UserHomepageActivity")){
ActivityUtils.getTopActivity().finish();
}
}
}
}
@@ -2296,10 +2257,10 @@ public class RetrofitClient {
}
} else if (roomInfoRespBaseModel.getCode() == 0) {
ToastUtils.showShort(roomInfoRespBaseModel.getMsg());
if (joinRoomLoadListener != null) {
if (joinRoomLoadListener != null){
joinRoomLoadListener.onJoinRoomLoad(roomInfoRespBaseModel.getMsg());
}
} else if (roomInfoRespBaseModel.getCode() == 202) {
}else if (roomInfoRespBaseModel.getCode() == 202){
observer.onNext(roomInfoRespBaseModel.getData());
} else {
MessageListenerSingleton.getInstance().quitGroup(roomId);
@@ -2316,26 +2277,6 @@ public class RetrofitClient {
});
}
public void taskJumpRoomId(String taskId, BaseObserver<String> observer) {
sApiServer.taskJumpRoomId(taskId).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
if (response.code() == 200) {
BaseModel<String> stringBaseModel = response.body();
if (stringBaseModel.getCode() == 1) {
observer.onNext(stringBaseModel.getData());
}
}
}
@Override
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
}
});
}
public void updatePassword(String roomId, String password, BaseObserver<String> observer) {
sApiServer.updatePassword(roomId, password).enqueue(new Callback<BaseModel<String>>() {
@@ -2397,7 +2338,7 @@ public class RetrofitClient {
});
}
public void check_create_room(BaseObserver<String> observer) {
public void check_create_room(BaseObserver<String> observer){
sApiServer.checkCreateRoom().enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -2405,9 +2346,9 @@ public class RetrofitClient {
BaseModel<String> stringBaseModel = response.body();
if (stringBaseModel.getCode() == 1) {
observer.onNext("");
} else if (stringBaseModel.getCode() == 0) {
}else if (stringBaseModel.getCode() == 0) {
com.hjq.toast.ToastUtils.show(stringBaseModel.getMsg());
} else if (stringBaseModel.getCode() == 301) {
}else if(stringBaseModel.getCode()==301){
try {
CommonAppContext.getInstance().clearLoginInfo();
ToastUtils.showShort(stringBaseModel.getMsg());
@@ -2415,7 +2356,7 @@ public class RetrofitClient {
throw new RuntimeException(e);
}
}
} else {
}else {
LogUtils.e("check_create_room", response.message());
}
@@ -2461,7 +2402,7 @@ public class RetrofitClient {
BaseModel<RoomOnline> roomOnlineBaseModel = response.body();
if (roomOnlineBaseModel.getCode() == 1) {
observer.onNext(roomOnlineBaseModel.getData());
} else if (roomOnlineBaseModel.getCode() == 0) {
}else if (roomOnlineBaseModel.getCode() == 0) {
ToastUtils.showLong(roomOnlineBaseModel.getMsg());
}
}
@@ -2503,7 +2444,7 @@ public class RetrofitClient {
});
}
public void index_recommend_room(BaseObserver<IndexRecommendRoom> observer) {
public void index_recommend_room(BaseObserver<IndexRecommendRoom> observer) {
sApiServer.index_recommend_room().enqueue(new Callback<BaseModel<IndexRecommendRoom>>() {
@Override
@@ -2511,11 +2452,7 @@ public class RetrofitClient {
if (response.code() == 200) {
BaseModel<IndexRecommendRoom> indexRecommendRoomBaseModel = response.body();
if (indexRecommendRoomBaseModel.getCode() == 1) {
if (indexRecommendRoomBaseModel.getData() == null) {
observer.onNext(new IndexRecommendRoom());
} else {
observer.onNext(indexRecommendRoomBaseModel.getData());
}
observer.onNext(indexRecommendRoomBaseModel.getData());
} else if (indexRecommendRoomBaseModel.getCode() == 0) {
ToastUtils.showShort(indexRecommendRoomBaseModel.getMsg());
} else if (indexRecommendRoomBaseModel.getCode() == 301) {
@@ -2531,11 +2468,11 @@ public class RetrofitClient {
@Override
public void onFailure(Call<BaseModel<IndexRecommendRoom>> call, Throwable t) {
LogUtils.e("首页房间推荐", t.fillInStackTrace());
LogUtils.e("首页房间推荐",t.fillInStackTrace());
}
});
}
}
public void wallet(BaseObserver<WalletBean> observer) {
sApiServer.wallet().enqueue(new Callback<BaseModel<WalletBean>>() {
@@ -2556,36 +2493,7 @@ public class RetrofitClient {
});
}
public void getTasksMessage(BaseObserver<TasksMessage> observer) {
sApiServer.getTasksMessage().enqueue(new Callback<BaseModel<TasksMessage>>() {
@Override
public void onResponse(Call<BaseModel<TasksMessage>> call, Response<BaseModel<TasksMessage>> response) {
if (response.code() == 200) {
BaseModel<TasksMessage> tasksMessage = response.body();
if (tasksMessage.getCode() == 1) {
observer.onNext(tasksMessage.getData());
} else if (tasksMessage.getCode() == 0) {
} else if (tasksMessage.getCode() == 301) {
try {
CommonAppContext.getInstance().clearLoginInfo();
ToastUtils.showShort(tasksMessage.getMsg());
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
}
}
@Override
public void onFailure(Call<BaseModel<TasksMessage>> call, Throwable t) {
LogUtils.e("任务个数", t.fillInStackTrace());
}
});
}
public void redPacketCreate(int type, String password, int coin_type, String
total_amount, String total_count, String conditions, String countdown, String
room_id, String remark, BaseObserver<String> observer) {
public void redPacketCreate(int type, String password, int coin_type, String total_amount, String total_count, String conditions, String countdown, String room_id, String remark, BaseObserver<String> observer) {
sApiServer.redPacketCreate(type, password, coin_type, total_amount, total_count, conditions, countdown, room_id, remark).enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
@@ -2646,8 +2554,7 @@ public class RetrofitClient {
// });
}
public void appPay(String user_id, String money, String coin, String type, String
type_params, String type_id, String nobility_id, BaseObserver<AppPay> observer) {
public void appPay(String user_id, String money, String coin, String type, String type_params, String type_id, String nobility_id, BaseObserver<AppPay> observer) {
sApiServer.appPay(user_id, money, coin, type, type_params, type_id, nobility_id).enqueue(new Callback<BaseModel<AppPay>>() {
@Override
public void onResponse(Call<BaseModel<AppPay>> call, Response<BaseModel<AppPay>> response) {
@@ -2706,8 +2613,7 @@ public class RetrofitClient {
});
}
public void bind(String userId, String type, String alipayAccount, String
bank_card_number, String bank_card, String open_bank, BaseObserver<String> observer) {
public void bind(String userId, String type, String alipayAccount, String bank_card_number, String bank_card, String open_bank, BaseObserver<String> observer) {
sApiServer.bind(userId, type, alipayAccount, bank_card_number, bank_card, open_bank).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -2740,8 +2646,7 @@ public class RetrofitClient {
});
}
public void getRoomUserInfo(String room_id, String
user_id, BaseObserver<UserInfo> observer) {
public void getRoomUserInfo(String room_id, String user_id, BaseObserver<UserInfo> observer) {
sApiServer.getRoomUserInfo(room_id, user_id).enqueue(new Callback<BaseModel<UserInfo>>() {
@Override
public void onResponse(Call<BaseModel<UserInfo>> call, Response<BaseModel<UserInfo>> response) {
@@ -2760,9 +2665,8 @@ public class RetrofitClient {
});
}
public void songList(String room_id, String
page, BaseObserver<List<MusicSongBean>> observer) {
sApiServer.songList(room_id, page).enqueue(new Callback<BaseModel<List<MusicSongBean>>>() {
public void songList(String room_id,String page, BaseObserver<List<MusicSongBean>> observer) {
sApiServer.songList(room_id,page).enqueue(new Callback<BaseModel<List<MusicSongBean>>>() {
@Override
public void onResponse(Call<BaseModel<List<MusicSongBean>>> call, Response<BaseModel<List<MusicSongBean>>> response) {
if (response.code() == 200) {
@@ -2802,8 +2706,7 @@ public class RetrofitClient {
}
public void getSearch(String keyWord, String
type, BaseObserver<List<RoomSearchResp>> observer) {
public void getSearch(String keyWord, String type, BaseObserver<List<RoomSearchResp>> observer) {
sApiServer.getSearch(keyWord, type).enqueue(new Callback<BaseModel<List<RoomSearchResp>>>() {
@Override
public void onResponse(Call<BaseModel<List<RoomSearchResp>>> call, Response<BaseModel<List<RoomSearchResp>>> response) {
@@ -2926,8 +2829,7 @@ public class RetrofitClient {
});
}
public void roomAuctionJoin(String auctionId, String userId, String giftId, String
num, String type, BaseObserver<RoomAuction.AuctionListBean> observer) {
public void roomAuctionJoin(String auctionId, String userId, String giftId, String num, String type, BaseObserver<RoomAuction.AuctionListBean> observer) {
sApiServer.roomAuctionJoin(auctionId, userId, giftId, num, type).enqueue(new ApiResponseCallback<RoomAuction.AuctionListBean>(CommonAppContext.getInstance()) {
@Override
public void onSuccess(RoomAuction.AuctionListBean data) {
@@ -3042,14 +2944,10 @@ public class RetrofitClient {
if (response.code() == 200) {
BaseModel<RedPackGrab> baseModel = response.body();
if (baseModel.getCode() == 1) {
if (baseModel.getData() != null) {
observer.onNext(baseModel.getData());
}
observer.onNext(baseModel.getData());
} else if (baseModel.getCode() == 0) {
ToastUtils.showShort(baseModel.getMsg());
if (baseModel.getData() != null) {
observer.onNext(baseModel.getData());
}
observer.onNext(baseModel.getData());
} else if (baseModel.getCode() == 301) {
try {
ToastUtils.showShort(baseModel.getMsg());
@@ -3274,8 +3172,7 @@ public class RetrofitClient {
});
}
public void roomGift(String room_id, String gift_id, String gift_num, String to_uid, String
type, String pit_number, String heart_id, BaseObserver<RoomGiftData> observer) {
public void roomGift(String room_id, String gift_id, String gift_num, String to_uid, String type, String pit_number, String heart_id, BaseObserver<RoomGiftData> observer) {
sApiServer.roomGift(room_id, gift_id, gift_num, to_uid, type, pit_number, heart_id).enqueue(new Callback<BaseModel<RoomGiftData>>() {
@Override
public void onResponse(Call<BaseModel<RoomGiftData>> call, Response<BaseModel<RoomGiftData>> response) {
@@ -3313,8 +3210,7 @@ public class RetrofitClient {
});
}
public void cpGiveGift(String user_id, String gift_id, String
room_id, BaseObserver<RoomGiftData> observer) {
public void cpGiveGift(String user_id, String gift_id, String room_id, BaseObserver<RoomGiftData> observer) {
sApiServer.cpGiveGift(user_id, gift_id, room_id).enqueue(new Callback<BaseModel<RoomGiftData>>() {
@Override
@@ -3508,36 +3404,21 @@ public class RetrofitClient {
}
public void keepXintiao(String roomId) {
sApiServer.keepXintiao(roomId).enqueue(new Callback<BaseModel<TasksMessage>>() {
sApiServer.keepXintiao(roomId).enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<BaseModel<TasksMessage>> call, Response<BaseModel<TasksMessage>> response) {
if (response.code() == 200) {
BaseModel<TasksMessage> tasksMessage = response.body();
assert tasksMessage != null;
if (tasksMessage.getCode() == 1) {
if (tasksMessageListener != null && tasksMessage.getData() != null) {
tasksMessageListener.onTasksMessageNum(tasksMessage.getData().getNot_received_tasks_num());
}
} else if (tasksMessage.getCode() == 0) {
} else if (tasksMessage.getCode() == 301) {
try {
CommonAppContext.getInstance().clearLoginInfo();
ToastUtils.showShort(tasksMessage.getMsg());
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
}
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
}
@Override
public void onFailure(Call<BaseModel<TasksMessage>> call, Throwable t) {
LogUtils.e("心跳: " + t.fillInStackTrace());
public void onFailure(Call<ResponseBody> call, Throwable t) {
}
});
}
public void setMutePit(String roomId, String user_id, String isMute, BaseObserver<String> observer) {
public void setMutePit(String roomId, String user_id, String
isMute, BaseObserver<String> observer) {
sApiServer.setMutePit(roomId, user_id, isMute).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -3677,8 +3558,7 @@ public class RetrofitClient {
});
}
public void roomRelationList(String
type, BaseObserver<List<RoomRelationBean>> observer) {
public void roomRelationList(String type, BaseObserver<List<RoomRelationBean>> observer) {
sApiServer.roomRelationList(type).enqueue(new Callback<BaseModel<List<RoomRelationBean>>>() {
@Override
public void onResponse(Call<BaseModel<List<RoomRelationBean>>> call, Response<BaseModel<List<RoomRelationBean>>> response) {
@@ -3717,8 +3597,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, BaseObserver<String> observer) {
sApiServer.changeSong(room_id, now_did).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
onNextRetu(response, observer);
@@ -3815,7 +3695,7 @@ public class RetrofitClient {
public void quitRoom(String room_id, String user_id, BaseObserver<String> observer) {
if (room_id == null || room_id.isEmpty())
if (room_id == null ||room_id.isEmpty())
return;
sApiServer.quitRoom(room_id, user_id).enqueue(new Callback<ResponseBody>() {
@Override
@@ -3830,8 +3710,7 @@ public class RetrofitClient {
});
}
public void getFriendListMore(String user_id, String
relation_id, BaseObserver<List<RelationshipBean>> observer) {
public void getFriendListMore(String user_id, String relation_id, BaseObserver<List<RelationshipBean>> observer) {
sApiServer.getFriendListMore(user_id, relation_id).enqueue(new Callback<BaseModel<List<RelationshipBean>>>() {
@Override
@@ -3977,8 +3856,7 @@ public class RetrofitClient {
});
}
public void commentZone(String id, String content, String pid, String
reply_to, BaseObserver<String> observer) {
public void commentZone(String id, String content, String pid, String reply_to, BaseObserver<String> observer) {
sApiServer.commentZone(id, content, pid, reply_to).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -3992,8 +3870,7 @@ public class RetrofitClient {
});
}
public void getFriendList(String userId, String page, String
page_limit, BaseObserver<RelationBean> observer) {
public void getFriendList(String userId, String page, String page_limit, BaseObserver<RelationBean> observer) {
sApiServer.getFriendList(userId, page, page_limit).enqueue(new Callback<BaseModel<RelationBean>>() {
@Override
public void onResponse(Call<BaseModel<RelationBean>> call, Response<BaseModel<RelationBean>> response) {
@@ -4036,8 +3913,8 @@ public class RetrofitClient {
});
}
public void cancel(String sms_code, BaseObserver<String> observer) {
sApiServer.cancel(SpUtil.getToken(), sms_code).enqueue(new Callback<BaseModel<String>>() {
public void cancel(String sms_code,BaseObserver<String> observer) {
sApiServer.cancel(SpUtil.getToken(),sms_code).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -4065,8 +3942,7 @@ public class RetrofitClient {
});
}
public void getPostData(String new_password, String mobile, String code, String
userId, BaseObserver<String> observer) {
public void getPostData(String new_password, String mobile, String code, String userId, BaseObserver<String> observer) {
sApiServer.getPostData(new_password, mobile, code, userId).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -4223,8 +4099,7 @@ public class RetrofitClient {
});
}
public void userOnlineStatus(String user_id, String
roomId, BaseObserver<List<UserOnlineStatusBean>> observer) {
public void userOnlineStatus(String user_id, String roomId, BaseObserver<List<UserOnlineStatusBean>> observer) {
sApiServer.userOnlineStatus(user_id, roomId).enqueue(new Callback<BaseModel<List<UserOnlineStatusBean>>>() {
@Override
public void onResponse(Call<BaseModel<List<UserOnlineStatusBean>>> call, Response<BaseModel<List<UserOnlineStatusBean>>> response) {
@@ -4401,8 +4276,7 @@ public class RetrofitClient {
});
}
public void onNextRetu
(Response<BaseModel<String>> response, BaseObserver<String> observer) {
public void onNextRetu(Response<BaseModel<String>> response, BaseObserver<String> observer) {
if (response.code() == 200) {
BaseModel<String> string = response.body();
if (string != null) {
@@ -4525,8 +4399,7 @@ public class RetrofitClient {
}
/// 盲盒转盘抽奖
public void drawGiftList(String giftBagId, String gift_user_ids, String roomId, String
num, String heart_id, String auction_id, BaseObserver<BlindReslutBean> observer) {
public void drawGiftList(String giftBagId, String gift_user_ids, String roomId, String num, String heart_id, String auction_id, BaseObserver<BlindReslutBean> observer) {
sApiServer.drawGiftList(giftBagId, gift_user_ids, roomId, num, heart_id, auction_id).enqueue(new Callback<BaseModel<BlindReslutBean>>() {
@Override
public void onResponse(Call<BaseModel<BlindReslutBean>> call, Response<BaseModel<BlindReslutBean>> response) {
@@ -4746,8 +4619,7 @@ public class RetrofitClient {
});
}
public void roomUserCharmList(String room_id, String
user_id, BaseObserver<List<RoomUserCharmListBean>> observer) {
public void roomUserCharmList(String room_id, String user_id, BaseObserver<List<RoomUserCharmListBean>> observer) {
sApiServer.roomUserCharmList(room_id, user_id).enqueue(new Callback<BaseModel<List<RoomUserCharmListBean>>>() {
@Override
public void onResponse(Call<BaseModel<List<RoomUserCharmListBean>>> call, Response<BaseModel<List<RoomUserCharmListBean>>> response) {
@@ -4797,8 +4669,8 @@ public class RetrofitClient {
});
}
public void signCoin(String sign_id, String sign_value, BaseObserver<String> observer) {
sApiServer.signCoin(sign_id, sign_value).enqueue(new Callback<BaseModel<String>>() {
public void signCoin(String sign_id,String sign_value, BaseObserver<String> observer) {
sApiServer.signCoin(sign_id,sign_value).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -4813,8 +4685,8 @@ public class RetrofitClient {
}
public void getCpRoom(String userId, int page, BaseObserver<HeartCpBean> observer) {
sApiServer.getCpRoom(userId, page + "").enqueue(new Callback<BaseModel<HeartCpBean>>() {
public void getCpRoom(String userId,int page, BaseObserver<HeartCpBean> observer) {
sApiServer.getCpRoom(userId,page+"").enqueue(new Callback<BaseModel<HeartCpBean>>() {
@Override
public void onResponse(Call<BaseModel<HeartCpBean>> call, Response<BaseModel<HeartCpBean>> response) {
if (response.code() == 200) {
@@ -4892,8 +4764,7 @@ public class RetrofitClient {
}
}
public void familyEarnings(String user_id, int page, String start_time, String
end_time, BaseObserver<List<FamilyEarnings>> observer) {
public void familyEarnings(String user_id, int page, String start_time, String end_time, BaseObserver<List<FamilyEarnings>> observer) {
sApiServer.familyEarnings(user_id, page, start_time, end_time).enqueue(new Callback<BaseModel<List<FamilyEarnings>>>() {
@Override
public void onResponse(Call<BaseModel<List<FamilyEarnings>>> call, Response<BaseModel<List<FamilyEarnings>>> response) {
@@ -4994,7 +4865,7 @@ public class RetrofitClient {
});
}
public void signRefuse(String roomId, BaseObserver<String> observer) {
public void signRefuse(String roomId,BaseObserver<String> observer){
sApiServer.signRefuse(roomId).enqueue(new Callback<BaseModel<String>>() {
@Override
@@ -5009,8 +4880,8 @@ public class RetrofitClient {
});
}
public void freeReSign(int type, String userId, BaseObserver<String> observer) {
if (type == 1) {
public void freeReSign(int type, String userId,BaseObserver<String> observer) {
if (type==1) {
sApiServer.freeReSign(userId).enqueue(new Callback<BaseModel<String>>() {
@Override
@@ -5023,7 +4894,7 @@ public class RetrofitClient {
LogUtils.e("freeReSign", t.fillInStackTrace());
}
});
} else {
}else {
sApiServer.reSign(userId).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -5038,85 +4909,6 @@ public class RetrofitClient {
}
}
public void signIn(BaseObserver<List<SignInData>> observer) {
sApiServer.signIn().enqueue(new Callback<BaseModel<List<SignInData>>>() {
@Override
public void onResponse(Call<BaseModel<List<SignInData>>> call, Response<BaseModel<List<SignInData>>> response) {
if (response.code() == 200) {
BaseModel<List<SignInData>> baseModel = response.body();
if (baseModel.getCode() == 1) {
observer.onNext(baseModel.getData() != null ? baseModel.getData() : new ArrayList<SignInData>());
} else if (baseModel.getCode() == 0) {
com.hjq.toast.ToastUtils.show(baseModel.getMsg());
} else if (baseModel.getCode() == 301) {
try {
CommonAppContext.getInstance().clearLoginInfo();
ToastUtils.showShort(baseModel.getMsg());
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
} else {
LogUtils.e("signIn", response.errorBody());
}
}
@Override
public void onFailure(Call<BaseModel<List<SignInData>>> call, Throwable t) {
LogUtils.e("signIn", t.fillInStackTrace());
}
});
}
public void dailyTasksSign(BaseObserver<String> observer) {
sApiServer.postDailyTasksSign().enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
onNextRetu(response, observer);
}
@Override
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
LogUtils.e("signIn", t.fillInStackTrace());
}
});
}
public void tasksSignStatus(BaseObserver<TasksSignStatus> observer) {
sApiServer.postDailyTasksSignStatus().enqueue(new Callback<BaseModel<TasksSignStatus>>() {
@Override
public void onResponse(Call<BaseModel<TasksSignStatus>> call, Response<BaseModel<TasksSignStatus>> response) {
if (response.code() == 200) {
BaseModel<TasksSignStatus> baseModel = response.body();
if (baseModel.getCode() == 1) {
observer.onNext(baseModel.getData());
} else if (baseModel.getCode() == 0) {
com.hjq.toast.ToastUtils.show(baseModel.getMsg());
} else if (baseModel.getCode() == 301) {
try {
CommonAppContext.getInstance().clearLoginInfo();
ToastUtils.showShort(baseModel.getMsg());
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
} else {
LogUtils.e("postDailyTasksSignStatus", response.errorBody());
}
}
@Override
public void onFailure(Call<BaseModel<TasksSignStatus>> call, Throwable t) {
LogUtils.e("postDailyTasksSignStatus", t.fillInStackTrace());
}
});
}
}

View File

@@ -17,7 +17,6 @@ import com.xscm.moduleutil.event.RoomJoinMountModel;
import com.xscm.moduleutil.event.UnreadCountEvent;
import com.xscm.moduleutil.http.RetrofitClient;
import com.xscm.moduleutil.rtc.MusicPlayBean;
import com.xscm.moduleutil.utils.CustomMsgCode;
import com.xscm.moduleutil.utils.SpUtil;
import com.tencent.imsdk.v2.V2TIMAdvancedMsgListener;
import com.tencent.imsdk.v2.V2TIMCallback;
@@ -67,8 +66,6 @@ public class MessageListenerSingleton {
private final Map<String, List<RoomMessageEvent>> cachedMessages = new ConcurrentHashMap<>();
private final Set<String> joinedRooms = ConcurrentHashMap.newKeySet();
private OnMsgTaskListener onMsgTaskListener;
// private boolean listenersAdded = false; // 标记监听器是否已添加
// 1. 添加新的监听器接口
public interface PublicScreenMessageListener {
@@ -324,10 +321,6 @@ public class MessageListenerSingleton {
if (event.getMsgType() == 130 || event.getMsgType() == 131) {
// EventBus.getDefault().post(event);
RetrofitClient.getInstance().getCpListener().onReceiveMsg(event);
} else if (event.getMsgType() == CustomMsgCode.INSTANCE.getCODE_TASK_APPRENTICE_JOIN_ROOM()) {
if (onMsgTaskListener != null) {
onMsgTaskListener.onMsgTask(event);
}
} else {
notifyMessageReceived(event);
}
@@ -407,7 +400,7 @@ public class MessageListenerSingleton {
// 使用默认解析
event = GsonUtils.fromJson(message, RoomMessageEvent.class);
}
LogUtils.e("收到群自定义消息:" + mRoomId + "===" + event);
LogUtils.e("收到群自定义消息:"+mRoomId+"===" + event);
// event = GsonUtils.fromJson(message, RoomMessageEvent.class);
} catch (Exception e) {
// 处理 JSON 解析过程中可能出现的异常,例如记录日志
@@ -615,30 +608,6 @@ public class MessageListenerSingleton {
}
// TODO: 2025/11/19 添加发送公共方法messageType发送的typemessage发送的内容 userId发送给谁
public void sendCustomC2CMessage(int messageType, String userId,RoomMessageEvent.T text) {
text.setFromUserInfo(SpUtil.getUserInfo());
LogUtils.e("发送消息", "messageType:" + messageType + "\nuserId:" + userId + "\ntext:" + text,toString());
RoomMessageEvent roomMessageEvent = new RoomMessageEvent(messageType, mRoomId, text);
String json = com.blankj.utilcode.util.GsonUtils.toJson(roomMessageEvent);
// 转换为 byte[]
byte[] binaryData = json.getBytes(StandardCharsets.UTF_8);
// 创建自定义群消息
V2TIMMessage v2TIMMessage = V2TIMManager.getMessageManager().createCustomMessage(binaryData);
v2TIMMessage.setExcludedFromUnreadCount(true);
v2TIMMessage.setExcludedFromContentModeration(true);
// v2TIMMessage.setNeedReadReceipt(true);
//
// // 发送消息
V2TIMManager.getMessageManager().sendMessage(v2TIMMessage, "u" + userId, null, V2TIMMessage.V2TIM_PRIORITY_HIGH,
true,
null,
sendCallback);
}
public void sendCustomC2CMessage125(String userId, byte[] binaryData) {
// 创建自定义群消息
V2TIMMessage v2TIMMessage = V2TIMManager.getMessageManager().createCustomMessage(binaryData);
@@ -695,13 +664,4 @@ public class MessageListenerSingleton {
public interface OnMessageReceivedListener {
void onMessageReceived(RoomMessageEvent message);
}
public void setOnMsgTaskListener(OnMsgTaskListener listener) {
this.onMsgTaskListener = listener;
}
public interface OnMsgTaskListener {
void onMsgTask(RoomMessageEvent message);
}
}

View File

@@ -1,8 +0,0 @@
package com.xscm.moduleutil.utils
object CustomMsgCode {
val CODE_TASK_APPRENTICE_JOIN_ROOM_TIMER_ID = "132"
val CODE_TASK_APPRENTICE_JOIN_ROOM = 132
val CODE_TASK_APPRENTICE_JOIN_ROOM_MSG = "您的师傅邀请您进入房间,您是否同意?"
val CODE_TASK_APPRENTICE_JOIN_ROOM_MSG_REFUSE = "您的徒弟拒绝了您的邀请。"
}

View File

@@ -135,7 +135,7 @@ public class DateSelectDialog extends BaseBottomSheetDialog<MeDialogDateSelectBi
int currentDay = TimeUtils.getDay();
// 如果是最大年份且是最大月份,则日期不能超过当前日期
if (year == currentYear - 18 && month == currentMonth) {
if (year == currentYear - 16 && month == currentMonth) {
dayLimit = currentDay;
}
@@ -158,7 +158,7 @@ public class DateSelectDialog extends BaseBottomSheetDialog<MeDialogDateSelectBi
int monthLimit = 12;
// 如果是最大年份16年前则月份不能超过当前月份
if (year == currentYear - 18) {
if (year == currentYear - 16) {
monthLimit = currentMonth;
}
@@ -175,7 +175,7 @@ public class DateSelectDialog extends BaseBottomSheetDialog<MeDialogDateSelectBi
private List<DateBean> getYear() {
int currentYear = TimeUtils.getYear();
int minYear = currentYear - 100; // 最小年份设为100年前
int maxYear = currentYear - 18; // 最大年份设为16年前
int maxYear = currentYear - 16; // 最大年份设为16年前
List<DateBean> yearList = new ArrayList<>();
for (int i = minYear; i <= maxYear; i++) {

View File

@@ -1,21 +1,16 @@
package com.xscm.moduleutil.utils;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.util.Log;
import com.alibaba.android.arouter.utils.TextUtils;
import com.blankj.utilcode.util.FileUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ThreadUtils;
import com.blankj.utilcode.util.ToastUtils;
import java.io.File;
import java.io.FileNotFoundException;
@@ -24,11 +19,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
@@ -51,58 +41,14 @@ public class DownloadUtil {
private static final String PATH_AUDIO = Environment.getExternalStorageDirectory() + "/qipao/audio";
@SuppressLint("CheckResult")
public DownloadUtil(Context context, String downUrl,final DownloadListener downloadListener) {
// 1. 判空,避免空指针
if (context == null) {
ToastUtils.showShort("Context 不能为 null");
LogUtils.e("Context 不能为 null."+(mApi == null));
return;
}
if (downUrl == null || downUrl.trim().isEmpty()) {
ToastUtils.showShort("下载链接不能为 null 或空!");
LogUtils.e("下载链接不能为 null 或空!."+(mApi == null));
return;
}
public DownloadUtil(Context context) {
this.mContext = context;
final String dUrl = downUrl;
File qipaoDir = new File(mContext.getFilesDir(), PATH_APK);
if (qipaoDir.exists() && qipaoDir.isDirectory()) {
Observable.create(new ObservableOnSubscribe<Boolean>() {
@Override
public void subscribe(ObservableEmitter<Boolean> emitter) throws Exception {
LogUtils.e("删除文件中."+(mApi == null));
FileUtils.deleteAllInDir(qipaoDir);
emitter.onNext(true);
}
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(result -> {
LogUtils.e("删除成功."+(mApi == null));
if (mApi == null) {
//初始化网络请求接口
mApi = ApiHelper.getInstance().createService(ApiInterface.class);
int i = dUrl.lastIndexOf('/');//一定是找最后一个'/'出现的位置
String downUrlEnd = "";
if (i != -1) {
downUrlEnd = dUrl.substring(i);
}
mApkPath = new File(mContext.getFilesDir(), PATH_APK + downUrlEnd).getAbsolutePath();
}
downloadFile(dUrl, downloadListener);
});
} else {
LogUtils.e("else ."+(mApi == null));
if (mApi == null) {
//初始化网络请求接口
mApi = ApiHelper.getInstance().createService(ApiInterface.class);
int i = downUrl.lastIndexOf('/');//一定是找最后一个'/'出现的位置
if (i != -1) {
downUrl = downUrl.substring(i);
}
mApkPath = new File(mContext.getFilesDir(), PATH_APK + downUrl).getAbsolutePath();
}
downloadFile(downUrl, downloadListener);
if (mApi == null) {
//初始化网络请求接口
mApi = ApiHelper.getInstance().createService(ApiInterface.class);
mApkPath = new File(mContext.getFilesDir(), PATH_APK).getAbsolutePath();
}
}

View File

@@ -26,18 +26,13 @@ import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.vectordrawable.graphics.drawable.Animatable2Compat;
import com.blankj.utilcode.util.ConvertUtils;
import com.blankj.utilcode.util.Utils;
import com.bumptech.glide.Glide;
import com.bumptech.glide.integration.webp.decoder.WebpDrawable;
import com.bumptech.glide.integration.webp.decoder.WebpDrawableTransformation;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.Transformation;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.load.resource.bitmap.CenterInside;
import com.bumptech.glide.load.resource.gif.GifDrawable;
import com.bumptech.glide.request.FutureTarget;
import com.bumptech.glide.request.RequestListener;
@@ -660,54 +655,6 @@ public class ImageUtils {
}
}
public static void loadWebpOneStart(int webp_anim, ImageView mAnimView){
if (mAnimView == null) {
return;
}
// 1. 本地资源专属优化配置
RequestOptions options = new RequestOptions()
// 强制限制解码尺寸为ImageView显示尺寸核心优化
.override(800, 800); // 本地图用原尺寸,或指定固定尺寸
//webp动图
CenterInside transformation = new CenterInside();
Glide.with(mAnimView)
.load(webp_anim)//不是本地资源就改为url即可
.apply(options)
.optionalTransform(transformation)
.optionalTransform(WebpDrawable.class, new WebpDrawableTransformation(transformation))
.addListener(new RequestListener<Drawable>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
return false;
}
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
WebpDrawable webpDrawable = (WebpDrawable) resource;
//需要设置为循环1次才会有onAnimationEnd回调
webpDrawable.setLoopCount(1);
webpDrawable.registerAnimationCallback(new Animatable2Compat.AnimationCallback() {
@Override
public void onAnimationStart(Drawable drawable) {
super.onAnimationStart(drawable);
}
@Override
public void onAnimationEnd(Drawable drawable) {
super.onAnimationEnd(drawable);
webpDrawable.unregisterAnimationCallback(this);
}
});
return false;
}
})
.into(mAnimView);
}
public static void clearDiskCache(Context context){
Glide.get(context).clearDiskCache();
}

View File

@@ -50,16 +50,15 @@ public class QXRedPacketManager {
*
* @param redPackets 红包模型列表
*/
public void addRedPackets(String roomId,List<RedPacketInfo> redPackets) {
public void addRedPackets(List<RedPacketInfo> redPackets) {
if (redPackets == null || redPackets.isEmpty()) {
return;
}
this.redPackets.entrySet().removeIf(entry ->
!(entry.getValue().getRoom_id()+"").equals(roomId));
for (RedPacketInfo model : redPackets) {
this.redPackets.put(model.getRedpacket_id(), model);
}
// 在添加数据后启动定时器(如果尚未启动)
startCheckTimer();
if (this.delegate != null && this.delegate instanceof QXRedPacketManagerDelegate) {
@@ -72,12 +71,11 @@ public class QXRedPacketManager {
*
* @param redPacket 红包模型
*/
public void addRedPacket(String roomId,RedPacketInfo redPacket) {
public void addRedPacket(RedPacketInfo redPacket) {
if (redPacket == null || redPacket.getRedpacket_id() == null) {
return;
}
this.redPackets.entrySet().removeIf(entry ->
!(entry.getValue().getRoom_id()+"").equals(roomId));
this.redPackets.put(redPacket.getRedpacket_id(), redPacket);
// 在添加数据后启动定时器(如果尚未启动)

View File

@@ -168,28 +168,4 @@ public class TextViewUtils {
public interface OnClickableTextListener {
void onClick();
}
/**
* 使用正则表达式格式化手机号中间4位替换为****
* @param phone 原始手机号
* @return 格式化后的手机号
*/
public static String formatPhoneNumberWithRegex(String phone) {
if (phone == null) {
return "";
}
return phone.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
}
/**
* 处理带区号的手机号中间4位替换为****
* @param phone 原始手机号(可能带区号)
* @return 格式化后的手机号
*/
public static String formatAnyPhone(String phone) {
if (phone == null) {
return "";
}
return phone.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
}
}

View File

@@ -1,7 +1,5 @@
package com.xscm.moduleutil.utils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@@ -209,7 +207,7 @@ public class TimeUtils {
//获取当前日期
public static String getCurrentDate2() {
Date d = new Date();
SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddhhmmssSSS");
SimpleDateFormat sf = new SimpleDateFormat("yyyy_MM_dd_hh_mm_ss_SSS");
return sf.format(d);
}
/**
@@ -260,25 +258,6 @@ public class TimeUtils {
return "1天"; // 或者 return "0天";
}
/**
* 计算时间差值并向上取整为天数
* @param currentTimeMillis 当前时间(毫秒级时间戳)
* @param createTimeSecond 创建时间(秒级时间戳)
* @return 向上取整后的天数
*/
public static int calculateDays(long currentTimeMillis, long createTimeSecond) {
// 1. 计算时间差(毫秒)
long timeDiffMillis = currentTimeMillis - createTimeSecond;
// 2. 转换为天数1天 = 24*60*60*1000 毫秒)
BigDecimal daysDecimal = new BigDecimal(timeDiffMillis)
.divide(new BigDecimal(24 * 60 * 60 * 1000), 10, RoundingMode.HALF_UP);
// 3. 向上取整(即使是 8.0001 天也会变成 9 天)
return daysDecimal.setScale(0, RoundingMode.CEILING).intValue();
}
/**
* 根据生日字符串计算年龄
* @param birthDay 生日字符串,格式为 "yyyy-MM-dd"

View File

@@ -15,8 +15,7 @@ public enum EnvironmentEnum {
1600096860,
"3e8f3add448d4692bc1d04c75ffe801b",
//"tcp://1.13.101.98",
// "tcp://1.13.20.30",
"tcp://yushengapi.qxyushen.top",
"tcp://1.13.20.30",
// "https://vespa.qxyushen.top/h5",
"https://yushengapi.qxyushen.top/h5",
0),
@@ -31,8 +30,7 @@ public enum EnvironmentEnum {
"wxc7681513be9f926b",
1600096890,
"02f7339ec98947deaeab173599891932",
// "tcp://1.13.181.248",
"tcp://test.vespa.qxyushen.top",
"tcp://1.13.181.248",
"https://test.vespa.qxyushen.top/h5",
1);

View File

@@ -422,7 +422,6 @@ public class AvatarFrameView extends FrameLayout {
mainHandler.post(() -> {
// 检查是否已销毁
if (file.exists()) {
LogUtils.e("有缓存:"+file.exists()+"===="+file.getAbsolutePath());
playMp4File(file);
} else {
LogUtils.w(TAG, "有缓存2222222222222");

View File

@@ -260,7 +260,6 @@ public class Constants {
public static final String GET_DECORATE = "/api/Decorate/user_decorate";//装扮详情
public static final String SET_USER_DECORATE = "/api/Decorate/set_user_decorate";//用户装扮
public static final String JOIN_ROOM = "/api/Room/join_room";//加入房间
public static final String TASK_JUMP_ROOM = "/api/Room/task_jump_room";//师徒任务 加入房间
public static final String UPDATEPASSWORD = "/api/room/setRoomPassword";//更新房间秘密啊
public static final String GET_ROOM_ONLINE = "/api/Room/room_online_list";//房间在线列表
@@ -272,7 +271,6 @@ public class Constants {
public static final String GET_ROOM_TYPE = "/api/Index/room_type_list";//房间分类列表
public static final String GET_GIVE_GIFT = "/api/Gift/chat_gift_send";//聊天送礼物
public static final String GET_WALLET = "/api/UserWallet/wallet";//钱包
public static final String GET_TASKS_MESSAGE = "/api/Tasks/dailyTasksUnReceiveCount";//【新】未领取奖励任务数量
public static final String REDPACKET_CREATE = "/api/Redpacket/create";//创建红包
public static final String ROOM_REDPACKET = "/api/Redpacket/roomRedPackets";//红包列表
@@ -362,11 +360,9 @@ public class Constants {
public static final String POST_ROOM_RANKING = "/api/Ranking/room_ranking";//房间榜
public static final String GUILD_RANKING = "/api/Ranking/guild_ranking";//公会榜
public static final String POST_LOVE_RANKING = "/api/Ranking/love_ranking";//真爱榜
public static final String GET_TASKS_LIHEN = "/api/Tasks/dailyTasksList";//每日任务列表
public static final String GET_DAILY_TASK_BOX = "/api/Tasks/dailyTasksBoxRecord";//礼盒记录
public static final String dailyTasksOpenBox = "/api/Tasks/dailyTasksOpenBox";//开启礼盒
public static final String dailyTasksReceive = "/api/Tasks/dailyTasksReceive";//领取每日任务奖励
public static final String dailyTasksComplete = "/api/Tasks/dailyTasksComplete";//领取每日任务奖励
public static final String GET_TASKS_LIHEN = "/api/Dailytasks/dailyTasksList";//每日任务列表
public static final String GET_DAILY_TASK_BOX = "/api/Dailytasks/dailyTasksBoxRecord";//礼盒记录
public static final String dailyTasksOpenBox = "/api/Dailytasks/dailyTasksOpenBox";//开启礼盒
public static final String GET_MY_BAG_DATA = "/api/UserGiftPack/get_gift_pack_income";//背包收入
public static final String GET_MY_BAG_OUTCOME = "/api/UserGiftPack/get_gift_pack_outcome";//背包礼物支出列表
public static final String GET_GIFT_PACK = "/api/UserGiftPack/get_gift_pack_list";//获取背包礼物列表
@@ -390,7 +386,9 @@ public class Constants {
public static final String GET_ACTIVITIES_PERMISSION = "/api/Activities/activities_permission";//活动弹框权限
public static final String GET_INDEX_RECOMMEND_ROOM = "/api/Index/index_recommend_room";//首页弹窗推荐房间
public static final String GET_DAY_DROP_GIFT = "/api/Activities/day_drop_gift";//天降好礼列表接口(弹框)
public static final String dailyTasksReceive = "/api/Dailytasks/dailyTasksReceive";//领取每日任务奖励
public static final String postRoomSwToken = "/api/Room/update_user_sw_token";//获取用户声网token
public static final String dailyTasksComplete = "/api/Dailytasks/dailyTasksComplete";//领取每日任务奖励
public static final String POST_CANCEL_USER_DECORATE = "/api/Decorate/cancel_user_decorate";//取消装扮
public static final String GET_THEME_DATA = "/api/Theme/get_theme_data";//主题接口
public static final String START_FRIEND = "/api/Friend/start_friend";//点击开始按钮 交友房
@@ -438,14 +436,10 @@ public class Constants {
public static final String POST_FREE_RE_SIGN = "/api/Sign/free_re_sign";//免费续约
public static final String POST_RE_SIGN = "/api/Sign/re_sign";//续签(花金币)
public static final String POST_SIGN_REFUSE = "/api/RoomPit/refuse_sign_room_host_invite";//签约房间主持邀请上签约麦用户拒绝
public static final String GET_SIGN_IN_LIST = "/api/Tasks/dailyTasksSignList";//签到列表页面
public static final String POST_DAILY_TASKS_SIGN = "/api/Tasks/dailyTasksSign";//每日签到
public static final String POST_DAILY_TASKS_SIGN_STATUS = "/api/Tasks/dailyTasksSignStatus";//每日签到状态
// public static final String MODIFY_MOBILE = "/api/UserData/modify_mobile";//手机换绑
public static final String MODIFY_MOBILE = "/api/UserData/modify_mobiles";//手机换绑
public static final String MODIFY_MOBILE = "/api/UserData/modify_mobile";//手机换绑
public static final String BIND_MOBILE = "/api/UserData/bind_mobile";//手机绑定

View File

@@ -15,8 +15,6 @@ class CustomViewPager(context: Context, attrs: AttributeSet?) : ViewPager(contex
private var initialX = 0f
private var initialY = 0f
private var isBeingDragged = false
override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
when (ev.action) {
MotionEvent.ACTION_DOWN -> {
@@ -33,34 +31,11 @@ class CustomViewPager(context: Context, attrs: AttributeSet?) : ViewPager(contex
if (deltaX > deltaY && deltaX > 30) { // 30是阈值可以根据需要调整
return super.onInterceptTouchEvent(ev)
}
// 如果是向上滑动,确保父容器不拦截
if (deltaY > deltaX && ev.y < initialY) {
parent.requestDisallowInterceptTouchEvent(true)
return false
}
// // 否则,不拦截,让子视图处理
// parent.requestDisallowInterceptTouchEvent(true)
// return false
}
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> {
isBeingDragged = false
// 否则,不拦截,让子视图处理
parent.requestDisallowInterceptTouchEvent(true)
return false
}
}
return super.onInterceptTouchEvent(ev)
}
override fun onTouchEvent(ev: MotionEvent): Boolean {
when (ev.action) {
MotionEvent.ACTION_DOWN -> {
parent.requestDisallowInterceptTouchEvent(true)
}
MotionEvent.ACTION_MOVE -> {
if (isBeingDragged) {
parent.requestDisallowInterceptTouchEvent(true)
}
}
}
return super.onTouchEvent(ev)
}
}

View File

@@ -10,20 +10,28 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.blankj.utilcode.util.LogUtils;
import com.opensource.svgaplayer.SVGACallback;
import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.tencent.qgame.animplayer.AnimConfig;
import com.tencent.qgame.animplayer.AnimView;
import com.tencent.qgame.animplayer.inter.IAnimListener;
import com.xscm.moduleutil.R;
import com.xscm.moduleutil.bean.GiftBean;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.locks.ReentrantLock;
import lombok.Getter;
import lombok.Setter;
import okhttp3.Call;
import okhttp3.Callback;
@@ -41,7 +49,6 @@ public class GiftAnimView extends FrameLayout implements GiftSvgaView.OnAnimatio
private ReentrantLock lock = new ReentrantLock();
private List<String> giftArray = new ArrayList<>();
@Setter
@Getter
public ExecutorService queue;
private Context mContext;
private boolean isOnece;
@@ -227,19 +234,17 @@ public class GiftAnimView extends FrameLayout implements GiftSvgaView.OnAnimatio
public void openOrCloseEffectViewWith(boolean isShow) {
this.isShow = isShow;
removeSvgaQueueData();
if(playerMp4View!=null) {
playerMp4View.stopPlay();
playerMp4View.setVisibility(View.GONE);
}
playerMp4View.stopPlay();
playerMp4View.setVisibility(View.GONE);
setVisibility(isShow ? View.VISIBLE : View.GONE);
}
public void stopPlay() {
removeSvgaQueueData();
if(playerMp4View!=null) {
playerMp4View.stopPlay();
playerMp4View.setVisibility(View.GONE);
}
playerMp4View.stopPlay();
playerMp4View.setVisibility(View.GONE);
}
@@ -271,52 +276,55 @@ public class GiftAnimView extends FrameLayout implements GiftSvgaView.OnAnimatio
if (isLoadEffect && giftModel != null && !TextUtils.isEmpty(giftModel)) {
String finalGiftModel = giftModel;
post(() -> {
String playImage = finalGiftModel;
if (playImage.endsWith("mp4")) {
downloadAndPlay(getContext(), playImage, new DownloadCallback() {
@Override
public void onSuccess(File file) {
post(() -> {
playerMp4View.setVisibility(View.VISIBLE);
svgaView.setVisibility(View.GONE);
playerMp4View.startPlay(file);
});
}
post(new Runnable() {
@Override
public void run() {
String playImage = finalGiftModel;
if (playImage.endsWith("mp4")) {
downloadAndPlay(getContext(), playImage, new DownloadCallback() {
@Override
public void onSuccess(File file) {
post(() -> {
playerMp4View.setVisibility(View.VISIBLE);
svgaView.setVisibility(View.GONE);
playerMp4View.startPlay(file);
});
}
@Override
public void onFailure(Exception e) {
LogUtils.e("MP4下载或播放失败: " + e.getMessage());
// 处理失败情况,继续播放下一个
post(() -> {
lock.lock();
try {
isLoadEffect = false;
} finally {
lock.unlock();
}
loadStartSVGAPlayer();
});
}
});
} else if (playImage.endsWith("svga")) {
@Override
public void onFailure(Exception e) {
LogUtils.e("MP4下载或播放失败: " + e.getMessage());
// 处理失败情况,继续播放下一个
post(() -> {
lock.lock();
try {
isLoadEffect = false;
} finally {
lock.unlock();
}
loadStartSVGAPlayer();
});
}
});
} else if (playImage.endsWith("svga")) {
// File file = downloadAndPlay(getContext(), playImage);
post(() -> {
playerMp4View.setVisibility(View.GONE);
svgaView.setVisibility(View.VISIBLE);
svgaView.loadSVGAPlayerWith(finalGiftModel, false);
});
} else {
lock.lock();
try {
isLoadEffect = false;
} finally {
lock.unlock();
post(() -> {
playerMp4View.setVisibility(View.GONE);
svgaView.setVisibility(View.VISIBLE);
svgaView.loadSVGAPlayerWith(finalGiftModel, false);
});
} else {
lock.lock();
try {
isLoadEffect = false;
} finally {
lock.unlock();
}
loadStartSVGAPlayer();
// 直接播放缓存文件
}
loadStartSVGAPlayer();
// 直接播放缓存文件
}
}
});
}
}

View File

@@ -98,13 +98,6 @@ public class QXGiftPlayerManager {
}
public void displayFullEffectView1(List<String> stringList){
if (getDefaultFullEffectView().getQueue() == null){
// 创建专用线程池替代GCD队列
ExecutorService queue = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(),
Executors.defaultThreadFactory());
fullEffectView.setQueue(queue);
}
getDefaultFullEffectView().displayEffectView1(stringList);
}

View File

@@ -37,7 +37,7 @@ class ShineTextView : AppCompatTextView {
var _count: Int = 0 //自行运行动画次数
private var mLinearGradient: LinearGradient? = null
private lateinit var mLinearGradient: LinearGradient
private var mGradientMatrix: Matrix = Matrix()
private var mViewWidth = 0
private var mTranslate = 0
@@ -121,13 +121,13 @@ class ShineTextView : AppCompatTextView {
_count++
}
mGradientMatrix.setTranslate(mTranslate.toFloat(), 0f)
mLinearGradient?.setLocalMatrix(mGradientMatrix)
mLinearGradient.setLocalMatrix(mGradientMatrix)
when {
shineType == 0 && _count < shineCount -> postInvalidateDelayed(50)
shineType == 1 && _count < 1 -> postInvalidateDelayed(50)
else -> {
mGradientMatrix.setTranslate((1.2 * mViewWidth).toFloat(), 0f)
mLinearGradient?.setLocalMatrix(mGradientMatrix)
mLinearGradient.setLocalMatrix(mGradientMatrix)
}
}
}

View File

@@ -270,7 +270,7 @@ public class RewardGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPr
private void giveGift(String num) {
getSelectedGift();
if (roonGiftModel == null || !roonGiftModel.isChecked()) {
if (roonGiftModel == null) {
ToastUtils.show("请选择礼物");
return;
}

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:centerColor="#CFFFDC"
android:endColor="#CFFFDC"
android:startColor="#DEFF85"
android:type="linear"
android:useLevel="true" />
<corners
android:radius="@dimen/dp_16"
/>
</shape>

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="180"
android:centerColor="#90FF86"
android:endColor="#E7FE67"
android:startColor="#5CFBBD"
android:type="linear"
android:useLevel="true" />
<stroke android:color="#FFFFF072" android:width="@dimen/dp_1"/>
<corners android:radius="@dimen/dp_99" />
</shape>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#fffcf7eb" />
<corners
android:bottomLeftRadius="4dp"
android:bottomRightRadius="4dp"
android:topLeftRadius="4dp"
android:topRightRadius="4dp" />
</shape>

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:centerColor="#CFFFDC"
android:endColor="#CFFFDC"
android:startColor="#DEFF85"
android:type="linear"
android:useLevel="true" />
<corners
android:bottomLeftRadius="4dp"
android:bottomRightRadius="4dp"
android:topLeftRadius="4dp"
android:topRightRadius="4dp" />
</shape>

View File

@@ -544,7 +544,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_3"
android:gravity="center"
android:text="抽次"
android:text="抽次"
android:textSize="@dimen/sp_12" />
<TextView
@@ -573,7 +573,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_3"
android:gravity="center"
android:text="抽次"
android:text="抽次"
android:textSize="@dimen/sp_12" />
<TextView

View File

@@ -122,10 +122,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginTop="14dp"
tools:text="为什么会有这篇文章呢,是因为之前关于 TabLayout 的使用陆陆续续也写了好几篇了,感觉比较分散,且不成体系,写这篇文章的目的就是希望能把各种效果的实现一次性讲齐,所以也有了标题的「看这篇就够了」。
TabLayout作为导航组件来说使用场景非常的多也意味着要满足各种各样的需求。
在效果实现上,有同学会选择自定义 View 来做,定制性高,但易用性、稳定性、维护性不敢保证,使用官方组件能避免这些不确定性,一是开源,有很多大佬共建,会不停的迭代;二是经过大型 app 验证,比如 google play有了这两点基本可以放心大胆的使用官方组件了。
那可能有的同学又会说,道理我都懂,可是不满足需求啊,只能自定义了。是的,早期的 api 确实不够丰富,在某些需求的实现上显得捉襟见肘,但是 google 也在不断的迭代,目前为止,常见的样式都能满足。"
android:ellipsize="end"
android:maxLines="7"
android:textColor="@color/black"
android:textSize="14sp"
/>

View File

@@ -90,7 +90,7 @@
android:id="@+id/im_heartssss"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:src="@mipmap/icon_heart"
android:src="@mipmap/icon_heart"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:scaleType="fitCenter"

View File

@@ -43,7 +43,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.62" />
app:layout_constraintGuide_percent="0.59" />
<ImageView
android:id="@+id/iv_frame_bg"

View File

@@ -24,6 +24,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
android:src="@mipmap/jiaoy"/>
<!-- 头像框,与头像大小相同,覆盖在头像上 -->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 633 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 554 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

View File

@@ -299,7 +299,6 @@
<color name="EFF2F8">#EFF2F8</color>
<color name="color_5B5B5B">#5B5B5B</color>
<color name="color_C7BF62">#C7BF62</color>
<color name="color_e3fae4">#FFE3FAE4</color>
<!-- 主题色 -->

View File

@@ -10,7 +10,7 @@
<string name="dressup">个性装扮</string>
<string name="shopping">道具商城</string>
<string name="backpack">我的背包</string>
<string name="daily">任务</string>
<string name="daily">每日任务</string>
<string name="news">消息</string>
<string name="setting_name">设置</string>
<string name="me_family">我的家族</string>

View File

@@ -7,13 +7,10 @@
<uses-permission android:name="android.permission.VIBRATE" />
<application android:theme="@style/AppTheme">
<activity
android:name=".activity.user.activity.MobilePhoneActivity"
android:exported="false" />
<activity
android:name=".TransparentActivity"
android:exported="false"
android:theme="@style/TransparentActivityTheme" />
android:theme="@style/TransparentActivityTheme"
android:exported="false" />
<activity
android:name=".activity.user.activity.TotalRevenueActivity"
android:exported="false" />

View File

@@ -2,9 +2,6 @@ package com.xscm.modulemain
import android.app.Activity
import android.content.Context
import android.text.TextUtils
import android.view.View
import com.blankj.utilcode.util.ActivityUtils
import com.blankj.utilcode.util.AppUtils
import com.blankj.utilcode.util.CrashUtils
import com.blankj.utilcode.util.LogUtils
@@ -13,35 +10,24 @@ import com.opensource.svgaplayer.utils.log.SVGALogger
import com.scwang.smartrefresh.layout.SmartRefreshLayout
import com.scwang.smartrefresh.layout.footer.ClassicsFooter
import com.scwang.smartrefresh.layout.header.ClassicsHeader
import com.xscm.modulemain.activity.room.activity.RoomActivity
import com.xscm.modulemain.dialog.InviteDialog
import com.xscm.modulemain.manager.RoomManager
import com.xscm.modulemain.utils.TimerManager
import com.xscm.modulemain.widget.WheatLayoutSingManager
import com.xscm.moduleutil.base.CommonAppContext
import com.xscm.moduleutil.bean.IndexRecommendRoom
import com.xscm.moduleutil.bean.RoomMessageEvent
import com.xscm.moduleutil.dialog.ConfirmDialog
import com.xscm.moduleutil.http.BaseObserver
import com.xscm.moduleutil.http.RetrofitClient
import com.xscm.moduleutil.listener.MessageListenerSingleton
import com.xscm.moduleutil.utils.CustomMsgCode
import io.reactivex.disposables.Disposable
import org.json.JSONObject
import java.io.File
import java.util.concurrent.TimeUnit
open class Application : CommonAppContext() {
var APP_CONTENT = ""
var APP_CONENT = ""
var LOGUTILS_SAVE_PATH = ""
var CRASHUTILS_SAVE_PATH = ""
var isAgoraStop = false
var inviteDialog: InviteDialog? = null
var currDialogActivity: Activity? = null
// 单例实例
companion object {
@@ -61,13 +47,10 @@ open class Application : CommonAppContext() {
override fun onCreate() {
super.onCreate()
// 应用内部存储 filesDir 目录的根路径
APP_CONTENT = File(filesDir, "APP_CONTENT").absolutePath
// 内部存储下的日志目录
LOGUTILS_SAVE_PATH = File(filesDir, "APP_CONTENT/APP_LOG").absolutePath
// 内部存储下的崩溃日志目录
CRASHUTILS_SAVE_PATH = File(filesDir, "APP_CONTENT/APP_CRASH").absolutePath
LOGUTILS_SAVE_PATH = getExternalFilesDir("APP_CONTENT/APP_LOG")?.absolutePath.toString()
CRASHUTILS_SAVE_PATH = getExternalFilesDir("APP_CONTENT/APP_CRASH")?.absolutePath.toString()
getExternalFilesDir("")
APP_CONENT = getExternalFilesDir("APP_CONTENT")?.absolutePath.toString()
// 初始化单例实例
instance = this
@@ -82,133 +65,9 @@ open class Application : CommonAppContext() {
initCrashUtils()
initSmartRefreshLayout()
initImMsg()
}
private fun initImMsg() {
MessageListenerSingleton.getInstance().setOnMsgTaskListener { event ->
when (event.msgType) {
CustomMsgCode.CODE_TASK_APPRENTICE_JOIN_ROOM -> {
TimerManager.cancelTimer(CustomMsgCode.CODE_TASK_APPRENTICE_JOIN_ROOM_TIMER_ID)
try {
val json = JSONObject(event.text.text)
if (!json.isNull("status")) {
event.text.status = json.getString("status")
}
if (TextUtils.isEmpty(event.text.status))
return@setOnMsgTaskListener
when (event.text.status) {
"1" -> {//1:邀请
if (!json.isNull("room_id"))
event.text.room_id = json.getString("room_id")
if (event?.text?.room_id.isNullOrEmpty())
return@setOnMsgTaskListener
customDialog(
event.text.room_id,
CustomMsgCode.CODE_TASK_APPRENTICE_JOIN_ROOM_MSG,
5,
1,
event.text
)
}
"2" -> {//2:拒绝
customDialog(
"",
CustomMsgCode.CODE_TASK_APPRENTICE_JOIN_ROOM_MSG_REFUSE,
5,
3,
null,
"",
"知道了"
)
}
}
}catch (E: Exception){
LogUtils.e("Exception",E.message.toString())
}
}
}
}
}
private fun customDialog(
roomId: String,
message: String,
downCount: Int,
status: Int = 1,
event: RoomMessageEvent.T?,
confirm: String = "同意",
cancel: String = "拒绝",
) {
// 创建并显示确认对话框
ConfirmDialog(
ActivityUtils.getTopActivity(),
"提示",
message,
confirm,
cancel,
{ v: View? ->
when (status) {
1 -> {
if (!TextUtils.isEmpty(CommonAppContext.getInstance().playId)
&& roomId == CommonAppContext.getInstance().playId
&& ActivityUtils.getTopActivity() is RoomActivity
) {
return@ConfirmDialog
}
if (ActivityUtils.getTopActivity() is RoomActivity) {
(ActivityUtils.getTopActivity() as RoomActivity).refreshRoomInfo(roomId)
return@ConfirmDialog
}
RoomManager.getInstance()
.fetchRoomDataAndEnter(ActivityUtils.getTopActivity(), roomId, "", null)
}
}
},
{ v: View? ->
when (status) {
1 -> {
val text = RoomMessageEvent.T()
val json = JSONObject()
json.put("status", "2")
json.put("room_id", roomId)
text.text = json.toString()
MessageListenerSingleton.getInstance().sendCustomC2CMessage(
CustomMsgCode.CODE_TASK_APPRENTICE_JOIN_ROOM,
event?.fromUserInfo?.user_id.toString(),
text
)
}
}
}, true, downCount
).show()
}
fun inviteApprenticeTaskTimer() {
TimerManager.scheduleTimer(
CustomMsgCode.CODE_TASK_APPRENTICE_JOIN_ROOM_TIMER_ID,
20,
TimeUnit.SECONDS,
onTimeUp = {
customDialog(
"",
CustomMsgCode.CODE_TASK_APPRENTICE_JOIN_ROOM_MSG_REFUSE,
5,
3,
null,
"",
"知道了"
)
})
}
fun bgToForeground() {
AppUtils.registerAppStatusChangedListener(object : Utils.OnAppStatusChangedListener {
override fun onForeground(activity: Activity?) {//应用切换到前台
if (!CommonAppContext.getInstance().isPlaying) {
RetrofitClient.getInstance()
.index_recommend_room(object : BaseObserver<IndexRecommendRoom>() {
@@ -216,11 +75,15 @@ open class Application : CommonAppContext() {
}
override fun onNext(t: IndexRecommendRoom) {
LogUtils.e(t)
if (!t.room_id.isNullOrEmpty()) {
showInviteDialog(activity, t)
if (t != null) {
inviteDialog = activity?.let { InviteDialog(it, t) }
if (inviteDialog?.isShowing == false) {
inviteDialog?.setData(t)
inviteDialog?.show()
}
}
}
})
}
}
@@ -231,19 +94,6 @@ open class Application : CommonAppContext() {
})
}
fun showInviteDialog(activity: Activity?, t: IndexRecommendRoom) {
if (activity != null && activity == currDialogActivity && inviteDialog != null) {
inviteDialog?.setData(t)
return
}
inviteDialog?.dismiss()
inviteDialog = null
inviteDialog = activity?.let { InviteDialog(it, t) }
inviteDialog?.setData(t)
currDialogActivity = activity
}
private fun initLogUtils() {
LogUtils.getConfig()
.setLogSwitch(true) // 全局开关
@@ -285,7 +135,7 @@ open class Application : CommonAppContext() {
}
fun getAppContent(): String {
return APP_CONTENT
return APP_CONENT
}

View File

@@ -42,7 +42,6 @@ import com.tencent.qcloud.tuikit.tuichat.bean.ChatInfo;
import com.xscm.modulemain.activity.WebViewActivity;
import com.xscm.modulemain.activity.main.activity.MainActivity;
import com.xscm.modulemain.activity.room.activity.RoomActivity;
import com.xscm.modulemain.activity.user.activity.DailyTasksActivity;
import com.xscm.modulemain.activity.user.activity.HeartCpActivity;
import com.xscm.modulemain.activity.user.activity.MyRoomActivity;
import com.xscm.modulemain.manager.RoomManager;
@@ -148,8 +147,6 @@ public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewData
((MainActivity) mThis).isShowLoading(false);
} else if (mThis instanceof MyRoomActivity) {
((MyRoomActivity) mThis).isShowLoading(false);
} else if (mThis instanceof DailyTasksActivity) {
((DailyTasksActivity) mThis).isShowLoading(false);
}
});
@@ -1145,9 +1142,5 @@ public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewData
startActivity(intent);
}
public void toActivity(Class<?> clazz) {
Intent intent = new Intent(this, clazz);
startActivity(intent);
}
}

View File

@@ -1,7 +1,10 @@
package com.xscm.modulemain
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
class TransparentActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {

View File

@@ -17,7 +17,6 @@ import androidx.fragment.app.Fragment;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.hjq.toast.ToastUtils;
import com.luck.picture.lib.basic.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
import com.luck.picture.lib.engine.CropFileEngine;
@@ -140,11 +139,6 @@ public class ImproveInfoActivity extends BaseMvpActivity<ImproveInfoPresenter, A
// ToastUtils.showShort("请选择性别");
return;
}
if(birthdy==null||TextUtils.isEmpty(birthdy)){
ToastUtils.show("请选择生日");
return;
}
if (!inviteCode.isEmpty() || inviteCode != null) {
// map.put("user_no", inviteCode);
init_code = inviteCode;

View File

@@ -32,7 +32,7 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
@Override
public void sendCode(String phoneNumber, int type) {
api.sendCode(phoneNumber, "default", new BaseObserver<String>() {
api.sendCode(phoneNumber, "default", new BaseObserver<Object>() {
@Override
public void onSubscribe(Disposable d) {
@@ -40,7 +40,7 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
}
@Override
public void onNext(String o) {
public void onNext(Object o) {
MvpRef.get().sendCodeSuccess1(o + "");
}

Some files were not shown because too many files have changed in this diff Show More