diff --git a/BaseModule/build.gradle b/BaseModule/build.gradle index f76bcf0c..48d480b5 100644 --- a/BaseModule/build.gradle +++ b/BaseModule/build.gradle @@ -44,7 +44,6 @@ android { kotlinOptions { jvmTarget = '11' } - packagingOptions { // exclude 'lib/arm64-v8a/libagora-fdkaac.so' } diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/base/BaseBottomFragmentDialog.kt b/BaseModule/src/main/java/com/xscm/moduleutil/base/BaseBottomFragmentDialog.kt new file mode 100644 index 00000000..abca7b2b --- /dev/null +++ b/BaseModule/src/main/java/com/xscm/moduleutil/base/BaseBottomFragmentDialog.kt @@ -0,0 +1,74 @@ +package com.xscm.moduleutil.base + +import android.app.Dialog +import android.content.DialogInterface +import android.graphics.Color +import android.os.Bundle +import android.view.Gravity +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.view.Window +import android.view.WindowManager +import androidx.core.view.WindowCompat +import androidx.databinding.DataBindingUtil +import androidx.fragment.app.DialogFragment +import androidx.viewbinding.ViewBinding +import com.voice.lib_base.ext.inflateBindingWithGeneric +import com.xscm.moduleutil.R + + +open class BaseBottomFragmentDialog(private val resourceID: Int) : + DialogFragment() { + var mDatabind: B? = null + val mBinding: B get() = mDatabind!! + + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { + val dialog = Dialog(requireActivity(), R.style.myChooseDialog) + mDatabind = DataBindingUtil.inflate(LayoutInflater.from(requireContext()), resourceID, null, false) as B + dialog.requestWindowFeature(Window.FEATURE_NO_TITLE) + dialog.setContentView(mBinding!!.root) + val window = dialog.window + val params = window!!.attributes + params.width = WindowManager.LayoutParams.MATCH_PARENT + params.height = WindowManager.LayoutParams.WRAP_CONTENT + params.gravity = Gravity.BOTTOM + window.attributes = params + dialog.setCanceledOnTouchOutside(true) + return dialog + + } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + mDatabind = inflateBindingWithGeneric(inflater, container, false) +// return if (mBinding != null) mBinding!!.root else mDatabind?.root + return mBinding?.root + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + WindowCompat.setDecorFitsSystemWindows(requireDialog().window!!, false) + requireDialog().setOnShowListener { dialog: DialogInterface? -> + (view.parent as ViewGroup).setBackgroundColor( + Color.TRANSPARENT + ) + } + } + + + override fun onDestroyView() { + super.onDestroyView() + mDatabind = null + } + + + + fun setBundleArgs(bundleArgs: Bundle?): BaseBottomFragmentDialog { + arguments = bundleArgs + return this + } +} diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/base/BaseFragmentDialog.kt b/BaseModule/src/main/java/com/xscm/moduleutil/base/BaseFragmentDialog.kt new file mode 100644 index 00000000..7460a1fc --- /dev/null +++ b/BaseModule/src/main/java/com/xscm/moduleutil/base/BaseFragmentDialog.kt @@ -0,0 +1,68 @@ +package com.voice.lib_base.base.dialog + +import android.app.Dialog +import android.content.DialogInterface +import android.graphics.Color +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.view.Window +import android.view.WindowManager +import androidx.core.view.WindowCompat +import androidx.databinding.DataBindingUtil +import androidx.databinding.ViewDataBinding +import androidx.fragment.app.DialogFragment +import androidx.viewbinding.ViewBinding +import com.voice.lib_base.ext.inflateBindingWithGeneric +import com.xscm.moduleutil.R + +open class BaseFragmentDialog(private val resourceID: Int) : DialogFragment() { + var mDatabind: B? = null + val mBinding: B get() = mDatabind!! + + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { + val dialog = Dialog(requireActivity(), R.style.myChooseDialog) + dialog.requestWindowFeature(Window.FEATURE_NO_TITLE) + mDatabind = DataBindingUtil.inflate(LayoutInflater.from(requireContext()), resourceID, null, false) as B + dialog.setContentView(mDatabind!!.root) + val window = dialog.window + val params = window!!.attributes + params.width = WindowManager.LayoutParams.MATCH_PARENT + params.height = WindowManager.LayoutParams.WRAP_CONTENT + window.attributes = params + dialog.setCanceledOnTouchOutside(true) + return dialog + } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + mDatabind = inflateBindingWithGeneric(inflater, container, false) + return if (mBinding != null) mBinding!!.root else null + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + WindowCompat.setDecorFitsSystemWindows(requireDialog().window!!, false) + requireDialog().setOnShowListener { dialog: DialogInterface? -> + (view.parent as ViewGroup).setBackgroundColor( + Color.TRANSPARENT + ) + } + } + + + override fun onDestroyView() { + super.onDestroyView() + mDatabind = null + } + + + fun setBundleArgs(bundleArgs: Bundle?): BaseFragmentDialog { + arguments = bundleArgs + return this + } +} diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/base/BaseViewModel.kt b/BaseModule/src/main/java/com/xscm/moduleutil/base/BaseViewModel.kt new file mode 100644 index 00000000..35791fbc --- /dev/null +++ b/BaseModule/src/main/java/com/xscm/moduleutil/base/BaseViewModel.kt @@ -0,0 +1,65 @@ +package com.xscm.moduleutil.base + +import androidx.lifecycle.* +import com.xscm.moduleutil.http.RetrofitClient +import com.xscm.moduleutil.widget.room.PassRoomException +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.launch +import okhttp3.MultipartBody + + +/** + * + */ +open class BaseViewModel : ViewModel(), LifecycleObserver { + private var clickTime: Long = 0 + var baseRepository = RetrofitClient.getInstance() + + private val passRoom by lazy { MutableLiveData() } + + private val error by lazy { MutableLiveData() } + + private val finally by lazy { MutableLiveData() } + + + + + //进入房间 + + var imgListData: MutableLiveData> = MutableLiveData() + var addImgData = MutableLiveData() + + + //运行在UI线程的协程 + fun launchUI(block: suspend CoroutineScope.() -> Unit) = viewModelScope.launch { + try { + block() + } catch (e: Exception) { + if (e is PassRoomException) { + passRoom.value = e + } else { + error.value = e +// throw e + } + + } finally { + finally.value = 200 + + } + } + + /** + * 请求失败,出现异常 + */ + fun getError(): LiveData { + return error + } + + /** + * 请求完成,在此处做一些关闭操作 + */ + fun getFinally(): LiveData { + return finally + } + +} \ No newline at end of file diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/base/CommonAppContext.java b/BaseModule/src/main/java/com/xscm/moduleutil/base/CommonAppContext.java index c83d8879..c9bc9864 100644 --- a/BaseModule/src/main/java/com/xscm/moduleutil/base/CommonAppContext.java +++ b/BaseModule/src/main/java/com/xscm/moduleutil/base/CommonAppContext.java @@ -137,13 +137,13 @@ public class CommonAppContext extends MultiDexApplication implements Application @Getter public UnreadCountEvent unreadCountEvent; - public static int selectRelease = 1; + public static int selectRelease = -1; public int is_open = 0;//主题的开关 public String appId = "com.qxcm.qxlive"; - public String appVersionCode = "87"; - public String appVersionName = "1.0.9.7"; + public String appVersionCode = "88"; + public String appVersionName = "1.0.9.8"; @Override public void onCreate() { diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/base/RealTimeMessages.java b/BaseModule/src/main/java/com/xscm/moduleutil/base/RealTimeMessages.java new file mode 100644 index 00000000..35a37da5 --- /dev/null +++ b/BaseModule/src/main/java/com/xscm/moduleutil/base/RealTimeMessages.java @@ -0,0 +1,10 @@ +package com.xscm.moduleutil.base; + +public class RealTimeMessages { + + public T data; + + public int code; + + +} diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/base/SocketBean.kt b/BaseModule/src/main/java/com/xscm/moduleutil/base/SocketBean.kt new file mode 100644 index 00000000..f0cfc035 --- /dev/null +++ b/BaseModule/src/main/java/com/xscm/moduleutil/base/SocketBean.kt @@ -0,0 +1,6 @@ +package com.xscm.moduleutil.base + + +data class SocketBean( + val code: Int, val data: Any +) diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/bean/room/RoomSettingBean.java b/BaseModule/src/main/java/com/xscm/moduleutil/bean/room/RoomSettingBean.java index 27ee1165..8e7007c1 100644 --- a/BaseModule/src/main/java/com/xscm/moduleutil/bean/room/RoomSettingBean.java +++ b/BaseModule/src/main/java/com/xscm/moduleutil/bean/room/RoomSettingBean.java @@ -66,6 +66,7 @@ public class RoomSettingBean implements MultiItemEntity { public static final int QXRoomSettingTypeRoomTimeRedSound = 35;//红包声音 public static final int QXRoomSettingTypeRoomBusinessTime = 37;//营业时间 + public static final int QXRoomSettingTypeRoomBusinessLegend = 38;//炼仙传说 diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/bean/room/refining/LiveBean.kt b/BaseModule/src/main/java/com/xscm/moduleutil/bean/room/refining/LiveBean.kt new file mode 100644 index 00000000..d323f291 --- /dev/null +++ b/BaseModule/src/main/java/com/xscm/moduleutil/bean/room/refining/LiveBean.kt @@ -0,0 +1,110 @@ +package com.xscm.moduleutil.bean.room.refining + + +data class BoxJiangChiBean( + var gid: String = "", + var gift_name: String = "", + var gift_price: String = "", + var base_image: String = "", + var play_image: String = "" +) + + + +data class MonsterLogBean( + val add_time: Int, + val id: Int, + val is_evil_wind: Int, + val is_join: Int, + val win_type: Int, + val win_type_data: List, + val join_data: List, + + val base_image: String, + val gift_name: String, + val gift_price: Int, + val num: Int, + val type_name: String, +) + + +data class WinTypeData( + val type: Int, val type_name: String, + val num: Int +) + + +data class MonsterUserLogBean( + val add_time: Int, + val base64_nick_name: String, + val base_image: String, + val gift_name: String, + val gift_price: String, + val head_pic: String, + val id: Int, + val mid: Int, + val nick_name: String, + val num: Int, + val type_name: String, + val uid: Int, + val win_type: Int +) + +data class MonsterInfoBean( + val integral: String, + val is_finsh: Int, + val multiple_list: List, + val open_monster_price: String, + val surplus_time: Int, + val win_number: Int +) + +data class Multiple( + val id: Int, + val multiple: Double, + val type_name: String, + val num: Int, + val type: Int +) + +data class MonsterResultBean( + val head_pic: String, + val id: String, + val integral: String, + val nick_name: String, + val num: Int, + val price: Int, + val type: String, + val type_name: String, + val uid: Int +) + +data class MonsterEndBean( + val game_name: String, + val gift_name: String, + val is_finsh: Int, + val is_push_message: Int, + val multiple_list: List, + val num: Int, + val surplus_time: Int, + val total_gift_price: Int, + val win_count: Int, + val win_number: Int, + val win_type_name: String +) + +data class OpenMonsterBean( + val base_image: String, // 礼物图片 + val gid: Int, // 礼物id + val gift_name: String, // 礼物名称 + val gift_price: String, // 礼物价格 + val is_win: Int,// 是否中奖 2未中奖 1中奖 + val num: Int, // 中奖数量 + val total_gift_price: Int, // 总价格 + val type_name: String, // 中奖类型 + val win_type: Int // 中奖类型 +) + + + + diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/http/ApiServer.java b/BaseModule/src/main/java/com/xscm/moduleutil/http/ApiServer.java index dbcaba18..b927b6f0 100644 --- a/BaseModule/src/main/java/com/xscm/moduleutil/http/ApiServer.java +++ b/BaseModule/src/main/java/com/xscm/moduleutil/http/ApiServer.java @@ -6,6 +6,11 @@ import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean; import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean; import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean; import com.xscm.moduleutil.bean.room.*; +import com.xscm.moduleutil.bean.room.refining.BoxJiangChiBean; +import com.xscm.moduleutil.bean.room.refining.MonsterInfoBean; +import com.xscm.moduleutil.bean.room.refining.MonsterLogBean; +import com.xscm.moduleutil.bean.room.refining.MonsterResultBean; +import com.xscm.moduleutil.bean.room.refining.MonsterUserLogBean; import com.xscm.moduleutil.bean.zhuangb.ZhuangBanShangChengBean; import com.xscm.moduleutil.utils.cos.TempKeyBean; import com.xscm.moduleutil.widget.Constants; @@ -540,6 +545,25 @@ public interface ApiServer { @POST(Constants.SET_USER_DECORATE) Call> setUserDecorate(@Field("udid") String udid); + @GET(Constants.GET_MONSTER_INFO_BOX) + Call> get_monster_info_box(); + + @GET(Constants.GET_OPEN_BEAT_MONSTER) + Call> open_beat_monster(@Query("rid")String rid,@Query("type") String type,@Query("num") String num); + + @GET(Constants.GET_MONSTER_BOX_LIST) + Call>> get_monster_box_list(); + + @GET(Constants.GET_USER_MONSTER_LOG) + Call>> get_user_monster_log(@Query("page")String page); + + @GET(Constants.GET_MONSTER_LOG) + Call>> get_monster_log(@Query("page")String page,@Query("page_limit")String page_limit); + + @GET(Constants.GET_MONSTER_NOTE) + Call> get_monster_note(); + + @FormUrlEncoded @POST(Constants.POST_CANCEL_USER_DECORATE) Call> cancelUserDecorate(@Field("type") String type); diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/http/RetrofitClient.java b/BaseModule/src/main/java/com/xscm/moduleutil/http/RetrofitClient.java index d7afbd3e..8f12babf 100644 --- a/BaseModule/src/main/java/com/xscm/moduleutil/http/RetrofitClient.java +++ b/BaseModule/src/main/java/com/xscm/moduleutil/http/RetrofitClient.java @@ -22,6 +22,11 @@ import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean; import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean; import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean; import com.xscm.moduleutil.bean.room.*; +import com.xscm.moduleutil.bean.room.refining.BoxJiangChiBean; +import com.xscm.moduleutil.bean.room.refining.MonsterInfoBean; +import com.xscm.moduleutil.bean.room.refining.MonsterLogBean; +import com.xscm.moduleutil.bean.room.refining.MonsterResultBean; +import com.xscm.moduleutil.bean.room.refining.MonsterUserLogBean; import com.xscm.moduleutil.bean.zhuangb.ZhuangBanShangChengBean; import com.xscm.moduleutil.listener.CPListener; import com.xscm.moduleutil.listener.JoinRoomErrorListener; @@ -1299,7 +1304,7 @@ public class RetrofitClient { } public void roomHotCard(String udid, String room_id, String num, BaseObserver observer) { - sApiServer.roomHotCard(udid, room_id, num).enqueue(new Callback>(){ + sApiServer.roomHotCard(udid, room_id, num).enqueue(new Callback>() { @Override public void onResponse(Call> call, Response> response) { @@ -1313,7 +1318,7 @@ public class RetrofitClient { } else if (baseModel.getCode() == 0) { ToastUtils.showLong(baseModel.getMsg()); } - }else { + } else { ToastUtils.showLong("使用热度卡出现错误", response.code()); LogUtils.e("roomHotCard", response.message()); } @@ -2326,7 +2331,8 @@ public class RetrofitClient { /** * 礼物标签表 - * @param type 1:房间获取标签 2:打赏,不要热度卡 3: + * + * @param type 1:房间获取标签 2:打赏,不要热度卡 3: * @param observer */ @@ -2357,7 +2363,8 @@ public class RetrofitClient { /** * 获取礼物列表 - * @param type 0:只获取热门礼物和普通礼物 99:拍卖卡关系选择礼物 100:歌单礼物 + * + * @param type 0:只获取热门礼物和普通礼物 99:拍卖卡关系选择礼物 100:歌单礼物 * @param roomId * @param observer */ @@ -2962,7 +2969,7 @@ public class RetrofitClient { // sApiServer.getSubsidyDetail(roomId).compose(new DefaultTransformer<>()).subscribe(observer); } - public void getPersonaltyList(String from,BaseObserver> observer) { + public void getPersonaltyList(String from, BaseObserver> observer) { sApiServer.getPersonaltyList(from).enqueue(new Callback>>() { @Override public void onResponse(Call>> call, Response>> response) { @@ -3120,7 +3127,7 @@ public class RetrofitClient { } else { MessageListenerSingleton.getInstance().quitGroup(roomId); } - if (joinRoomErrorListener != null){ + if (joinRoomErrorListener != null) { joinRoomErrorListener.onJoinRoomError(roomInfoRespBaseModel.getCode(), roomInfoRespBaseModel.getMsg()); } } @@ -4132,8 +4139,8 @@ public class RetrofitClient { } - public void editRoom(String room_id, String room_name, String room_cover, String room_intro, String room_background,String roomPwd, BaseObserver observer) { - sApiServer.editRoom(room_id, room_name, room_cover, room_intro, room_background,roomPwd).enqueue(new Callback>() { + public void editRoom(String room_id, String room_name, String room_cover, String room_intro, String room_background, String roomPwd, BaseObserver observer) { + sApiServer.editRoom(room_id, room_name, room_cover, room_intro, room_background, roomPwd).enqueue(new Callback>() { @Override public void onResponse(Call> call, Response> response) { onNextRetu(response, observer); @@ -4715,10 +4722,10 @@ public class RetrofitClient { } else if (baseModel.getCode() == 301) { setCode301(baseModel.getMsg()); } else { - ToastUtils.showShort(baseModel.getMsg()); +// ToastUtils.showShort(baseModel.getMsg()); } } else { - ToastUtils.showShort("盲盒转盘失败,", response.code()); + ToastUtils.showShort("暂无活动,", response.code()); LogUtils.e("盲盒转盘", response.message()); } } @@ -5034,8 +5041,8 @@ public class RetrofitClient { }); } - public void checkTxt(String room_name, String room_cover, String room_intro,String roomPwd, BaseObserver observer) { - sApiServer.checkTxt(room_name, room_cover, room_intro,roomPwd).enqueue(new Callback() { + public void checkTxt(String room_name, String room_cover, String room_intro, String roomPwd, BaseObserver observer) { + sApiServer.checkTxt(room_name, room_cover, room_intro, roomPwd).enqueue(new Callback() { @Override public void onResponse(Call call, Response response) { if (response.code() == 200) { @@ -5079,6 +5086,199 @@ public class RetrofitClient { }); } + public void get_monster_info_box(BaseObserver observer) { + sApiServer.get_monster_info_box().enqueue(new Callback>() { + + @Override + public void onResponse(Call> call, Response> response) { + if (response.code() == 200) { + BaseModel baseModel = response.body(); + if (baseModel.getCode() == 1) { + observer.onNext(baseModel.getData()); + } else if (baseModel.getCode() == 301) { + setCode301(baseModel.getMsg()); + } else { + ToastUtils.showShort(baseModel.getMsg()); + } + } else { + ToastUtils.showShort("请求错误:" + response.code()); + LogUtils.e("get_monster_info_box", response.message()); + } + } + + @Override + public void onFailure(Call> call, Throwable t) { + LogUtils.e("get_monster_info_box", t); + } + }); + } + + public void open_beat_monster(String rid, String type, String num, BaseObserver observer) { + sApiServer.open_beat_monster(rid, type, num).enqueue(new Callback>() { + + @Override + public void onResponse(Call> call, Response> response) { + if (response.code() == 200) { + BaseModel baseModel = response.body(); + if (baseModel.getCode() == 1) { + if (baseModel.getData() != null) { + observer.onNext(baseModel.getData()); + } + } else if (baseModel.getCode() == 301) { + setCode301(baseModel.getMsg()); + } else { + ToastUtils.showShort(baseModel.getMsg()); + } + } else { + ToastUtils.showShort("请求错误:" + response.code()); + LogUtils.e("open_beat_monster", response.message()); + } + } + + @Override + public void onFailure(Call> call, Throwable t) { + LogUtils.e("open_beat_monster", t); + } + }); + } + + public void get_monster_box_list(BaseObserver> observer) { + sApiServer.get_monster_box_list().enqueue(new Callback>>() { + + @Override + public void onResponse(Call>> call, Response>> response) { + if (response.code() == 200) { + BaseModel> baseModel = response.body(); + if (baseModel.getCode() == 1) { + if (baseModel.getData() != null) { + observer.onNext(baseModel.getData()); + }else { + observer.onNext(new ArrayList<>()); + } + } else if (baseModel.getCode() == 301) { + setCode301(baseModel.getMsg()); + } else { + ToastUtils.showShort(baseModel.getMsg()); + } + } else { + ToastUtils.showShort("请求错误:" + response.code()); + LogUtils.e("get_monster_box_list", response.message()); + } + } + + @Override + public void onFailure(Call>> call, Throwable t) { + LogUtils.e("get_monster_box_list", t); + } + }); + } + + public void get_user_monster_log(String page, BaseObserver> observer) { + sApiServer.get_user_monster_log(page).enqueue(new Callback>>() { + + @Override + public void onResponse(Call>> call, Response>> response) { + if (response.code() == 200) { + BaseModel> baseModel = response.body(); +// if (baseModel != null) { +// observer.onNext(baseModel); +// } else { +// observer.onNext(new ArrayList<>()); +// } + if (baseModel.getCode() == 1) { + if (baseModel.getData()!=null) { + observer.onNext(baseModel.getData()); + }else { + observer.onNext(new ArrayList<>()); + } + } else if (baseModel.getCode() == 301) { + setCode301(baseModel.getMsg()); + } else { + ToastUtils.showShort(baseModel.getMsg()); + } + } else + ToastUtils.showShort("请求错误:" + response.code()); + LogUtils.e("get_user_monster_log", response.message()); + } + + @Override + public void onFailure(Call>> call, Throwable t) { + LogUtils.e("get_user_monster_log", t.fillInStackTrace()); + } + }); + + } + + public void get_monster_log(String page, BaseObserver> observer) { + sApiServer.get_monster_log(page, "20").enqueue(new Callback>>() { + + @Override + public void onResponse(Call>> call, Response>> response) { + if (response.code() == 200) { + BaseModel> baseModel = response.body(); +// if (baseModel != null) { +// observer.onNext(baseModel); +// } else { +// observer.onNext(new ArrayList<>()); +// } + if (baseModel.getCode() == 1) { + if (baseModel.getData()!=null) { + observer.onNext(baseModel.getData()); + }else { + observer.onNext(new ArrayList<>()); + } + } else if (baseModel.getCode() == 301) + setCode301(baseModel.getMsg()); + else { + ToastUtils.showShort(baseModel.getMsg()); + } + } else { + ToastUtils.showShort("请求错误:" + response.code()); + LogUtils.e("get_monster_log", response.message()); + } + } + + @Override + public void onFailure(Call>> call, Throwable t) { + LogUtils.e("get_monster_log", t); + } + }); + } + + public void get_monster_note(BaseObserver observer) { + sApiServer.get_monster_note().enqueue(new Callback>() { + + @Override + public void onResponse(Call> call, Response> response) { + + if (response.code() == 200) { + BaseModel baseModel = response.body(); + if (baseModel.getCode()==1){ + if (baseModel.getData()!=null){ + observer.onNext(baseModel.getData()); + }else { + observer.onNext(""); + } + }else if (baseModel.getCode() == 301) { + setCode301(baseModel.getMsg()); + }else if (baseModel.getCode() == 0) { + ToastUtils.showShort(baseModel.getMsg()); + } + + }else { + ToastUtils.showShort("请求错误:" + response.code()); + LogUtils.e("get_monster_note", response.message()); + } + } + + @Override + public void onFailure(Call> call, Throwable t) { + LogUtils.e("get_monster_note", t.toString()); + } + }); + } + + public void cancelUserDecorate(String type, BaseObserver observer) { sApiServer.cancelUserDecorate(type).enqueue(new Callback>() { @Override diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/service/MqttConnect.java b/BaseModule/src/main/java/com/xscm/moduleutil/service/MqttConnect.java index 31b624e8..1d0066df 100644 --- a/BaseModule/src/main/java/com/xscm/moduleutil/service/MqttConnect.java +++ b/BaseModule/src/main/java/com/xscm/moduleutil/service/MqttConnect.java @@ -35,6 +35,7 @@ public class MqttConnect { public static String qx_hour_ranking = ""; public static String qx_redpacket_arrive = "";//红包飘屏的主题 + public static String qx_xianxuan = "";//炼仙传说推送 Handler handler = new Handler(Looper.getMainLooper()); String[] topic; int[] qos = {1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // 消息质量 @@ -50,12 +51,14 @@ public class MqttConnect { update_app = "qx_xunlehui"; // 巡乐会飘屏 qx_hour_ranking = "qx_hour_ranking";//小时榜飘屏 qx_redpacket_arrive = "qx_redpacket_arrive"; //红包飘屏的主题 + qx_xianxuan = "qx_xianxuan"; //红包飘屏的主题 ArrayList topicList = new ArrayList<>(); topicList.add(shutdown); topicList.add(update_app); topicList.add(qx_hour_ranking); topicList.add(qx_redpacket_arrive); + topicList.add(qx_xianxuan); topic = topicList.toArray(new String[0]); } @@ -93,6 +96,7 @@ public class MqttConnect { sub(update_app); sub(qx_hour_ranking); sub(qx_redpacket_arrive); + sub(qx_xianxuan); // UI操作回到主线程 ActivityUtils.getTopActivity().runOnUiThread(() -> uiTip("MQTT连接成功")); diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/service/MqttInitCallback.java b/BaseModule/src/main/java/com/xscm/moduleutil/service/MqttInitCallback.java index 9fd44cd0..eae49380 100644 --- a/BaseModule/src/main/java/com/xscm/moduleutil/service/MqttInitCallback.java +++ b/BaseModule/src/main/java/com/xscm/moduleutil/service/MqttInitCallback.java @@ -6,9 +6,16 @@ import android.os.Looper; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.blankj.utilcode.util.GsonUtils; import com.blankj.utilcode.util.LogUtils; +import com.google.gson.reflect.TypeToken; +import com.xscm.moduleutil.base.RealTimeMessages; +import com.xscm.moduleutil.base.SocketBean; import com.xscm.moduleutil.bean.MqttXlhEnd; import com.xscm.moduleutil.bean.XLHBean; +import com.xscm.moduleutil.bean.room.refining.MonsterEndBean; +import com.xscm.moduleutil.bean.room.refining.MonsterInfoBean; +import com.xscm.moduleutil.bean.room.refining.OpenMonsterBean; import com.xscm.moduleutil.event.HourlyBean; import com.xscm.moduleutil.event.RedBean; import com.xscm.moduleutil.event.RoomGiftRunable; @@ -59,6 +66,51 @@ public class MqttInitCallback implements MqttCallback { receiveQXHourRanking(topic, messageStr); } else if (topic.equals("qx_redpacket_arrive")) { receiveRed(topic, messageStr); + } else if (topic.equals("qx_xianxuan")) { + receiveXianxuanMessage(messageStr); + } + } + + private void receiveXianxuanMessage(String messageStr) { + try { + JSONObject jsonObject = JSON.parseObject(messageStr); + String message = jsonObject.getString("msg"); + // 将事件处理放到主线程执行 + new Handler(Looper.getMainLooper()).post(() -> { + processXianxuanMessage(message); + }); + } catch (Exception e) { + LogUtils.e("MQTT", "解析MQTT消息异常", e); + } + } + + private void processXianxuanMessage(String message) { + SocketBean dataList = GsonUtils.fromJson(message, SocketBean.class); + switch (dataList.getCode()) { + case 3031: + RealTimeMessages monsterInfo = GsonUtils.fromJson( + message, + new TypeToken>() {}.getType() + ); + EventBus.getDefault().post(monsterInfo.data); + break; + case 3032: + RealTimeMessages openMonster = + GsonUtils.fromJson( + message, + new TypeToken>() {}.getType() + ); + EventBus.getDefault().post(openMonster.data); + break; + case 3033: + RealTimeMessages monsterEndBean = + GsonUtils.fromJson( + message, + new TypeToken>() {}.getType() + ); + EventBus.getDefault().post(monsterEndBean.data); + break; + } } diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/utils/CountDownUtil.kt b/BaseModule/src/main/java/com/xscm/moduleutil/utils/CountDownUtil.kt new file mode 100644 index 00000000..70b9ac79 --- /dev/null +++ b/BaseModule/src/main/java/com/xscm/moduleutil/utils/CountDownUtil.kt @@ -0,0 +1,62 @@ +package com.xscm.moduleutil.utils + +import androidx.lifecycle.LifecycleCoroutineScope +import androidx.lifecycle.lifecycleScope +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.delay +import kotlinx.coroutines.flow.* +import kotlinx.coroutines.launch +import java.text.DecimalFormat + +object CountDownUtil { + /** + * 倒计时的实现 + */ + fun countDown(lifecycleScope: LifecycleCoroutineScope, + time: Int = 5, + start: (scop: CoroutineScope) -> Unit, + end: () -> Unit, + next: (time: Int) -> Unit + ) { + lifecycleScope.launch { + // 在这个范围内启动的协程会在Lifecycle被销毁的时候自动取消 + flow { + (time downTo 0).forEach { + delay(1000) + emit(it) + } + }.onStart { + // 倒计时开始 ,在这里可以让Button 禁止点击状态 + start(this@launch) + }.onCompletion { + // 倒计时结束 ,在这里可以让Button 恢复点击状态 + end() + }.catch { + //错误 +// YYLogUtils.e(it.message ?: "Unkown Error") + }.collect { + // 在这里 更新值来显示到UI + next(it) + } + } + } + + fun formatCountDownTime(milliseconds: Long): String { + val sb = StringBuilder() + val mss = milliseconds * 1000 / 1000 + val days = mss / (60 * 60 * 24) + val hours = mss % (60 * 60 * 24) / (60 * 60) + val minutes = mss % (60 * 60) / 60 + val seconds = mss % 60 + val format = DecimalFormat("00") + if (days > 0 || hours > 0) { + sb.append(format.format(hours)).append(":").append(format.format(minutes)).append(":") + .append(format.format(seconds)) + } else { + sb.append(format.format(minutes)).append(":").append(format.format(seconds)) + } + return sb.toString() + } + + +} \ No newline at end of file diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/utils/TTSManager.kt b/BaseModule/src/main/java/com/xscm/moduleutil/utils/TTSManager.kt new file mode 100644 index 00000000..c1139b52 --- /dev/null +++ b/BaseModule/src/main/java/com/xscm/moduleutil/utils/TTSManager.kt @@ -0,0 +1,142 @@ +package com.xscm.moduleutil.utils + +import android.content.Context +import android.os.Build +import android.os.Bundle +import android.speech.tts.TextToSpeech +import android.speech.tts.UtteranceProgressListener +import java.util.LinkedList +import java.util.Locale + +/** + * 项目名称:羽声语音 + * 时间:2025/12/6 11:00 + * 用途: + */ +class TTSManager private constructor(context: Context) : + TextToSpeech.OnInitListener { + + companion object { + @Volatile + private var instance: TTSManager? = null + + fun getInstance(context: Context): TTSManager { + return instance ?: synchronized(this) { + instance ?: TTSManager(context.applicationContext).also { + instance = it + } + } + } + } + + private var tts: TextToSpeech? = null + private var isInitialized = false + private val pendingQueue = LinkedList() + private var currentLanguage = Locale.CHINESE + + init { + initTTS(context) + } + + private fun initTTS(context: Context) { + tts = TextToSpeech(context, this).apply { + setOnUtteranceProgressListener(object : UtteranceProgressListener() { + override fun onStart(utteranceId: String?) { + // 开始朗读 + } + + override fun onDone(utteranceId: String?) { + // 朗读完成 + } + + override fun onError(utteranceId: String?) { + // 发生错误 + } + }) + } + } + + override fun onInit(status: Int) { + isInitialized = if (status == TextToSpeech.SUCCESS) { + setLanguage(currentLanguage) + true + } else { + false + } + + if (isInitialized) { + processPendingQueue() + } + } + + fun speak(text: String, flush: Boolean = true) { + if (!isInitialized || tts == null) { + pendingQueue.add(text) + return + } + + val utteranceId = System.currentTimeMillis().toString() + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + val params = Bundle().apply { + putString(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, utteranceId) + } + tts?.speak(text, + if (flush) TextToSpeech.QUEUE_FLUSH else TextToSpeech.QUEUE_ADD, + params, + utteranceId) + } else { + @Suppress("DEPRECATION") + val params = HashMap() + params[TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID] = utteranceId + tts?.speak(text, + if (flush) TextToSpeech.QUEUE_FLUSH else TextToSpeech.QUEUE_ADD, + params) + } + } + + fun setLanguage(locale: Locale): Boolean { + currentLanguage = locale + return if (isInitialized) { + tts?.setLanguage(locale) == TextToSpeech.LANG_COUNTRY_AVAILABLE + } else { + false + } + } + + fun stop() { + tts?.stop() + } + + fun pause() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + tts?.stop() + } + } + + fun resume() { + // 根据需要实现 + } + + fun setSpeechRate(rate: Float) { + tts?.setSpeechRate(rate) + } + + fun setPitch(pitch: Float) { + tts?.setPitch(pitch) + } + + private fun processPendingQueue() { + while (pendingQueue.isNotEmpty()) { + speak(pendingQueue.poll()) + } + } + + fun release() { + tts?.stop() + tts?.shutdown() + tts = null + isInitialized = false + instance = null + } +} \ No newline at end of file diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/utils/ViewBindUtil.kt b/BaseModule/src/main/java/com/xscm/moduleutil/utils/ViewBindUtil.kt new file mode 100644 index 00000000..c004c3be --- /dev/null +++ b/BaseModule/src/main/java/com/xscm/moduleutil/utils/ViewBindUtil.kt @@ -0,0 +1,57 @@ +package com.voice.lib_base.ext + +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.appcompat.app.AppCompatActivity +import androidx.databinding.ViewDataBinding +import androidx.fragment.app.Fragment +import androidx.viewbinding.ViewBinding +import java.lang.reflect.InvocationTargetException +import java.lang.reflect.ParameterizedType + +/** + * 作者 : QIngNing + * 时间 : 2021/12/21 + * 描述 : + */ + +@JvmName("inflateWithGeneric") +fun AppCompatActivity.inflateBindingWithGeneric(layoutInflater: LayoutInflater): VB = + withGenericBindingClass(this) { clazz -> + clazz.getMethod("inflate", LayoutInflater::class.java).invoke(null, layoutInflater) as VB + }.also { binding -> + if (binding is ViewDataBinding) { + binding.lifecycleOwner = this + } + } + +@JvmName("inflateWithGeneric") +fun Fragment.inflateBindingWithGeneric(layoutInflater: LayoutInflater, parent: ViewGroup?, attachToParent: Boolean): VB = + withGenericBindingClass(this) { clazz -> + clazz.getMethod("inflate", LayoutInflater::class.java, ViewGroup::class.java, Boolean::class.java) + .invoke(null, layoutInflater, parent, attachToParent) as VB + }.also { binding -> + if (binding is ViewDataBinding) { + binding.lifecycleOwner = viewLifecycleOwner + } + } + +private fun withGenericBindingClass(any: Any, block: (Class) -> VB): VB { + var genericSuperclass = any.javaClass.genericSuperclass + var superclass = any.javaClass.superclass + while (superclass != null) { + if (genericSuperclass is ParameterizedType) { + try { + return block.invoke(genericSuperclass.actualTypeArguments[0] as Class) + + } catch (e: NoSuchMethodException) { + } catch (e: ClassCastException) { + } catch (e: InvocationTargetException) { + throw e.targetException + } + } + genericSuperclass = superclass.genericSuperclass + superclass = superclass.superclass + } + throw IllegalArgumentException("There is no generic of ViewBinding.") +} \ No newline at end of file diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/utils/logger/DataLoggingInterceptor.java b/BaseModule/src/main/java/com/xscm/moduleutil/utils/logger/DataLoggingInterceptor.java index 4ba337ee..ca552633 100644 --- a/BaseModule/src/main/java/com/xscm/moduleutil/utils/logger/DataLoggingInterceptor.java +++ b/BaseModule/src/main/java/com/xscm/moduleutil/utils/logger/DataLoggingInterceptor.java @@ -9,6 +9,7 @@ import java.io.IOException; import java.net.URLDecoder; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import java.util.Arrays; import java.util.concurrent.TimeUnit; import okhttp3.Connection; @@ -54,7 +55,7 @@ public class DataLoggingInterceptor implements Interceptor { logger.reset(); logger.log(sLogStartFlag); - logger.log(sFormatLine); +// logger.log("2\n"+sFormatLine); RequestBody requestBody = request.body(); boolean hasRequestBody = requestBody != null; @@ -62,17 +63,17 @@ public class DataLoggingInterceptor implements Interceptor { Connection connection = chain.connection(); Protocol protocol = connection != null ? connection.protocol() : Protocol.HTTP_1_1; // request.url().encodedPath() 这是只展示最后的url地址,没有带有前面的https对应的域名,只是展示路径 - String requestStartMessage = request.method() + " " + request.url().encodedPath() + " " + protocol; - logger.log(requestStartMessage); + String requestStartMessage = request.method() + " " + Arrays.toString(request.url().encodedPath().split("/api/")) + " " + protocol; +// logger.log("3\n"+requestStartMessage); if (hasRequestBody) { // Request body headers are only present when installed as a network interceptor. Force // them to be included (when available) so there values are known. if (requestBody.contentType() != null) { - logger.log("Content-Type: " + requestBody.contentType()); +// logger.log("4\n"+ "Content-Type: " + requestBody.contentType()); } if (requestBody.contentLength() != -1) { - logger.log("Content-Length: " + requestBody.contentLength()); +// logger.log("5\n"+"Content-Length: " + requestBody.contentLength()); } } @@ -81,14 +82,14 @@ public class DataLoggingInterceptor implements Interceptor { String name = rHeaders.name(i); // Skip headers from the request body as they are explicitly logged above. if (!"Content-Type".equalsIgnoreCase(name) && !"Content-Length".equalsIgnoreCase(name)) { - logger.log(name + ": " + rHeaders.value(i)); +// logger.log("6\n"+name + ": " + rHeaders.value(i)); } } if (!hasRequestBody) { - logger.log("END " + request.method()); +// logger.log("7\n"+"END " + request.method()); } else if (bodyEncoded(request.headers())) { - logger.log("END " + request.method() + " (encoded body omitted)"); +// logger.log("8\n"+"END " + request.method() + " (encoded body omitted)"); } else { Buffer buffer = new Buffer(); requestBody.writeTo(buffer); @@ -100,35 +101,35 @@ public class DataLoggingInterceptor implements Interceptor { } if (charset != null) { - logger.log(sFormatLine); +// logger.log("9\n"+sFormatLine); if (isPlaintext(buffer)) { try { String requestStr = URLDecoder.decode(buffer.readString(charset), "UTF-8"); String[] strs = requestStr.split("&"); for (String str : strs) { - logger.log(str); +// logger.log("10\n"+str); } } catch (Exception e) { - logger.log(buffer.readString(charset)); + logger.log("11\n"+buffer.readString(charset)); } - logger.log("END " + request.method() - + " (" + requestBody.contentLength() + "-byte body)"); +// logger.log("12\n"+"END " + request.method() +// + " (" + requestBody.contentLength() + "-byte body)"); } else { - logger.log("END " + request.method() + " (binary " - + requestBody.contentLength() + "-byte body omitted)"); +// logger.log("13\n"+"END " + request.method() + " (binary " +// + requestBody.contentLength() + "-byte body omitted)"); } } } - logger.log(sFormatLine); +// logger.log("14\n"+sFormatLine); long startNs = System.nanoTime(); Response response; try { response = chain.proceed(request); } catch (Exception e) { - logger.log("HTTP FAILED: " + e); - logger.log(sLogEndFlag); + logger.log("15\n"+"HTTP FAILED: " + e); +// logger.log(sLogEndFlag); throw e; } @@ -137,21 +138,19 @@ public class DataLoggingInterceptor implements Interceptor { if (responseBody != null) { long contentLength = responseBody.contentLength(); String bodySize = contentLength != -1 ? contentLength + "-byte" : "unknown-length"; -// logger.log(response.code() + " " + response.message() + " " -// + response.request().url() + " (" + tookMs + "ms)"); - logger.log(response.code() + " " + response.message() + " " - + response.request().url().encodedPath() + " → " + response.networkResponse().request().url().encodedPath() + " (" + tookMs + "ms)"); + logger.log("17\n"+response.code() + " " + response.message() + " " + + Arrays.toString(response.request().url().encodedPath().split("/api/")) + " → " + Arrays.toString(response.networkResponse().request().url().encodedPath().split("/api/")) + " (" + tookMs + "ms)"); - Headers headers = response.headers(); - for (int i = 0, count = headers.size(); i < count; i++) { - logger.log(headers.name(i) + ": " + headers.value(i)); - } +// Headers headers = response.headers(); +// for (int i = 0, count = headers.size(); i < count; i++) { +// logger.log("18\n"+headers.name(i) + ": " + headers.value(i)); +// } if (!HttpHeaders.hasBody(response)) { - logger.log("END HTTP"); +// logger.log("19\n"+"END HTTP"); } else if (bodyEncoded(response.headers())) { - logger.log("END HTTP (encoded body omitted)"); +// logger.log("20\n"+"END HTTP (encoded body omitted)"); } else { BufferedSource source = responseBody.source(); if (source.isOpen()) { @@ -165,26 +164,26 @@ public class DataLoggingInterceptor implements Interceptor { } if (!isPlaintext(buffer)) { - logger.log("END HTTP (binary " + buffer.size() + "-byte body omitted)"); - logger.log(sFormatLine); +// logger.log("21\n"+"END HTTP (binary " + buffer.size() + "-byte body omitted)"); +// logger.log("22\n"+sFormatLine); logger.log(sLogEndFlag); return response; } if (contentLength != 0 && charset != null) { - logger.log(sFormatLine); +// logger.log("24\n"+sFormatLine); //这是展示返回的数据日志 // logger.log(buffer.clone().readString(charset)); } - logger.log("END HTTP (" + buffer.size() + "-byte body)"); +// logger.log("25\n"+"END HTTP (" + buffer.size() + "-byte body)"); } else { - logger.log("END HTTP"); +// logger.log("26\n"+"END HTTP"); } } } - logger.log(sFormatLine); + logger.log("27\n"+sFormatLine); logger.log(sLogEndFlag); return response; diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/widget/Constants.java b/BaseModule/src/main/java/com/xscm/moduleutil/widget/Constants.java index 6daa1fb0..34974d1b 100644 --- a/BaseModule/src/main/java/com/xscm/moduleutil/widget/Constants.java +++ b/BaseModule/src/main/java/com/xscm/moduleutil/widget/Constants.java @@ -273,6 +273,15 @@ public class Constants { public static final String GET_PIT_TIME = "/api/BarRoom/get_pit_time_list";//酒吧房麦位时长列表 public static final String POST_BLACK_ROOM_LIST = "/api/BarRoom/black_room_list";//小黑屋(酒吧房,交友小屋)列表 + //炼仙传说 + public static final String GET_MONSTER_INFO_BOX = "/api/Monster/get_monster_info";// + public static final String GET_OPEN_BEAT_MONSTER = "/api/monster/open_beat_monster";// + public static final String GET_MONSTER_BOX_LIST = "/api/monster/get_monster_box_list";// + public static final String GET_USER_MONSTER_LOG = "/api/monster/get_user_monster_log";// + public static final String GET_MONSTER_LOG = "/api/monster/get_monster_log";// + public static final String GET_MONSTER_NOTE = "/api/monster/get_monster_note";// + + public static final String UPDATEPASSWORD = "/api/room/setRoomPassword";//更新房间秘密啊 public static final String GET_ROOM_ONLINE = "/api/Room/room_online_list";//房间在线列表 public static final String GET_SJ_ROOM_NAME = "/api/Room/room_random_name";//随机房间名称 diff --git a/BaseModule/src/main/java/com/xscm/moduleutil/widget/ShapeRedTextView.java b/BaseModule/src/main/java/com/xscm/moduleutil/widget/ShapeRedTextView.java new file mode 100644 index 00000000..cdb02c9f --- /dev/null +++ b/BaseModule/src/main/java/com/xscm/moduleutil/widget/ShapeRedTextView.java @@ -0,0 +1,199 @@ +package com.xscm.moduleutil.widget; + +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.drawable.GradientDrawable; +import android.graphics.drawable.StateListDrawable; +import android.util.AttributeSet; +import android.view.Gravity; +import android.widget.TextView; + +import com.xscm.moduleutil.R; + + +/** + * 小熊猫展示的金额,是在炼仙传说中使用的 + */ + +public class ShapeRedTextView extends TextView { + private final int SHAPE_RECTANGEL = 0; + private final int SHAPE_OVAL = 1; + + private int shape; + private int solidNormalColor; + private int solidPressedColor; + private float cornersRadius; + private float cornersTopLeft; + private float cornersTopRight; + private float cornersBottomLeft; + private float cornersBottomRight; + + // 渐变颜色属性 + private int gradientNormalStartColor; + private int gradientNormalCenterColor; + private int gradientNormalEndColor; + + private int gradientPressedStartColor; + private int gradientPressedCenterColor; + private int gradientPressedEndColor; + + private int gradientOrientation; + + private float strokeWidth; + private int strokeColor; + + private int defaultColor = Color.parseColor("#00000000"); + private GradientDrawable.Orientation[] orientations; + + public ShapeRedTextView(Context context) { + this(context, null); + } + + public ShapeRedTextView(Context context, AttributeSet attrs) { + super(context, attrs); + + TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.ShapeTextView); + shape = array.getInteger(R.styleable.ShapeTextView_shape, SHAPE_RECTANGEL); + + + solidNormalColor = array.getColor(R.styleable.ShapeTextView_solidNormal, defaultColor); + solidPressedColor = array.getColor(R.styleable.ShapeTextView_solidPressed, defaultColor); + + + cornersRadius = array.getDimension(R.styleable.ShapeTextView_cornersRadius, 0); + + cornersTopLeft = array.getDimension(R.styleable.ShapeTextView_cornerTopLeft, 0); + cornersTopRight = array.getDimension(R.styleable.ShapeTextView_cornerTopRight, 0); + cornersBottomLeft = array.getDimension(R.styleable.ShapeTextView_cornerBottomLeft, 0); + cornersBottomRight = array.getDimension(R.styleable.ShapeTextView_cornerBottomRight, 0); + + strokeWidth = array.getDimension(R.styleable.ShapeTextView_strokeWidth, 0); + + strokeColor = array.getColor(R.styleable.ShapeTextView_strokeColor, defaultColor); + + gradientNormalStartColor = array.getColor(R.styleable.ShapeTextView_gradientNormalStartColor, defaultColor); + + gradientNormalCenterColor = array.getColor(R.styleable.ShapeTextView_gradientNormalCenterColor, defaultColor); + + gradientNormalEndColor = array.getColor(R.styleable.ShapeTextView_gradientNormalEndColor, defaultColor); + + + gradientPressedStartColor = array.getColor(R.styleable.ShapeTextView_gradientPressedStartColor, defaultColor); + gradientPressedCenterColor = array.getColor(R.styleable.ShapeTextView_gradientPressedCenterColor, defaultColor); + gradientPressedEndColor = array.getColor(R.styleable.ShapeTextView_gradientPressedEndColor, defaultColor); + + + TypedArray orientationArray = context.obtainStyledAttributes(attrs, R.styleable.ShapeTextView); + + gradientOrientation = orientationArray.getInteger(R.styleable.ShapeTextView_gradientOrientation, 6); + + array.recycle(); + + + orientations = new GradientDrawable.Orientation[]{ + GradientDrawable.Orientation.TOP_BOTTOM, + GradientDrawable.Orientation.TR_BL, + GradientDrawable.Orientation.RIGHT_LEFT, + GradientDrawable.Orientation.BR_TL, + GradientDrawable.Orientation.BOTTOM_TOP, + GradientDrawable.Orientation.BL_TR, + GradientDrawable.Orientation.LEFT_RIGHT, + GradientDrawable.Orientation.TL_BR + }; + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + setShape(); + } + + private void setShape() { + setGravity(Gravity.CENTER); + setClickable(true); + // normal state + GradientDrawable drawableNormal = new GradientDrawable(); + // 设置Shape + drawableNormal.setShape(shape); + // 设置圆角半径 + drawableNormal.setCornerRadius(cornersRadius); + // 圆角半径(每个圆角半径的值) + if (cornersRadius == 0) { + drawableNormal.setCornerRadii(new float[]{ + cornersTopLeft, cornersTopLeft, + cornersTopRight, cornersTopRight, + cornersBottomRight, cornersBottomRight, + cornersBottomLeft, cornersBottomLeft}); + } + //描边的宽度和颜色 + drawableNormal.setStroke((int) strokeWidth, strokeColor); + //设置填充色 + if (solidNormalColor != defaultColor) { + drawableNormal.setColor(solidNormalColor); + } else { +// 设置渐变色 + int[] gradientColors; + if (gradientNormalStartColor != defaultColor && gradientNormalEndColor != defaultColor) { + gradientColors = new int[]{gradientNormalStartColor, gradientNormalEndColor}; + if (gradientNormalCenterColor != defaultColor) { + gradientColors = new int[]{gradientNormalStartColor, gradientNormalCenterColor, gradientNormalEndColor}; + } + drawableNormal.setColors(gradientColors); + + + drawableNormal.setOrientation(orientations[gradientOrientation]); + } else { + drawableNormal.setColor(solidNormalColor); + } + + } + + + // pressed state + GradientDrawable drawablePressed = new GradientDrawable(); + drawablePressed.setShape(shape); + drawablePressed.setCornerRadius(cornersRadius); + if (cornersRadius == 0) { + drawablePressed.setCornerRadii(new float[]{ + cornersTopLeft, cornersTopLeft, + cornersTopRight, cornersTopRight, + cornersBottomRight, cornersBottomRight, + cornersBottomLeft, cornersBottomLeft}); + } + + drawablePressed.setStroke((int) strokeWidth, strokeColor); + + drawablePressed.setColor(solidPressedColor); + + // 设置背景选择器 + StateListDrawable stateListDrawable = new StateListDrawable(); + + if (solidPressedColor != defaultColor) { + stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, drawablePressed); + } + int[] gradientPressdColors; + if (gradientPressedStartColor != defaultColor && gradientPressedEndColor != defaultColor) { + gradientPressdColors = new int[]{gradientPressedStartColor, gradientPressedEndColor}; + if (gradientPressedCenterColor != defaultColor) { + gradientPressdColors = new int[]{gradientPressedStartColor, gradientPressedCenterColor, gradientPressedEndColor}; + } + + drawablePressed.setColors(gradientPressdColors); + drawablePressed.setOrientation(orientations[gradientOrientation]); + stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, drawablePressed); + + } + + if (isEnabled()) { + setAlpha(1.0f); + } else { + setAlpha(0.7f); + } + stateListDrawable.addState(new int[]{}, drawableNormal); + + setBackground(stateListDrawable); + + } +} \ No newline at end of file diff --git a/BaseModule/src/main/res/drawable/selector_box_multiple.xml b/BaseModule/src/main/res/drawable/selector_box_multiple.xml new file mode 100644 index 00000000..d53b443b --- /dev/null +++ b/BaseModule/src/main/res/drawable/selector_box_multiple.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/BaseModule/src/main/res/mipmap-xxhdpi/box_num_bg1.webp b/BaseModule/src/main/res/mipmap-xxhdpi/box_num_bg1.webp new file mode 100644 index 00000000..8cd42c8d Binary files /dev/null and b/BaseModule/src/main/res/mipmap-xxhdpi/box_num_bg1.webp differ diff --git a/BaseModule/src/main/res/mipmap-xxhdpi/box_num_bg2.webp b/BaseModule/src/main/res/mipmap-xxhdpi/box_num_bg2.webp new file mode 100644 index 00000000..89331aec Binary files /dev/null and b/BaseModule/src/main/res/mipmap-xxhdpi/box_num_bg2.webp differ diff --git a/BaseModule/src/main/res/mipmap-xxhdpi/lxcs_iocn.webp b/BaseModule/src/main/res/mipmap-xxhdpi/lxcs_iocn.webp new file mode 100644 index 00000000..03bf4d79 Binary files /dev/null and b/BaseModule/src/main/res/mipmap-xxhdpi/lxcs_iocn.webp differ diff --git a/BaseModule/src/main/res/values/attr.xml b/BaseModule/src/main/res/values/attr.xml index 140e3508..0689051d 100644 --- a/BaseModule/src/main/res/values/attr.xml +++ b/BaseModule/src/main/res/values/attr.xml @@ -531,4 +531,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BaseModule/src/main/res/values/styles.xml b/BaseModule/src/main/res/values/styles.xml index e9a01453..610ff357 100644 --- a/BaseModule/src/main/res/values/styles.xml +++ b/BaseModule/src/main/res/values/styles.xml @@ -331,5 +331,13 @@ false + \ No newline at end of file diff --git a/MainModule/src/main/java/com/xscm/modulemain/activity/room/presenter/RoomViewModel.kt b/MainModule/src/main/java/com/xscm/modulemain/activity/room/presenter/RoomViewModel.kt new file mode 100644 index 00000000..09d04d9f --- /dev/null +++ b/MainModule/src/main/java/com/xscm/modulemain/activity/room/presenter/RoomViewModel.kt @@ -0,0 +1,140 @@ +package com.xscm.modulemain.activity.room.presenter + +import androidx.lifecycle.MutableLiveData +import com.xscm.moduleutil.base.BaseViewModel +import com.xscm.moduleutil.bean.WalletBean +import com.xscm.moduleutil.bean.room.refining.BoxJiangChiBean +import com.xscm.moduleutil.bean.room.refining.MonsterInfoBean +import com.xscm.moduleutil.bean.room.refining.MonsterLogBean +import com.xscm.moduleutil.bean.room.refining.MonsterResultBean +import com.xscm.moduleutil.bean.room.refining.MonsterUserLogBean +import com.xscm.moduleutil.http.BaseObserver +import com.xscm.moduleutil.http.RetrofitClient +import io.reactivex.disposables.Disposable + +class RoomViewModel : BaseViewModel() { + var repository = RetrofitClient.getInstance() + + var moneyBean = MutableLiveData() + + val monsterInfo = MutableLiveData() + + val openBeatMonster = MutableLiveData() + + //奖池奖品列表 + var jiangChiBean: MutableLiveData> = MutableLiveData() + + // TODO:获取个人用户金币数 + fun getMoneyData() { + launchUI { + repository.wallet(object : BaseObserver() { + override fun onSubscribe(d: Disposable) { + } + + override fun onNext(t: WalletBean) { + moneyBean.value = t + } + + }) + } + } + + + fun get_monster_info_box() { + launchUI { + repository.get_monster_info_box(object : BaseObserver() { + override fun onSubscribe(d: Disposable) { + } + + override fun onNext(t: MonsterInfoBean) { + monsterInfo.value = t + } + + }) + } + } + + + fun open_beat_monster( + rid: String?, + type: String, + num: String + ) { + launchUI { + repository.open_beat_monster( + rid, + type, + num, + object : BaseObserver() { + override fun onSubscribe(d: Disposable) { + } + + override fun onNext(t: MonsterResultBean) { + openBeatMonster.value = t + } + + }) + } + } + + fun get_monster_box_list() { + launchUI { + repository.get_monster_box_list(object : BaseObserver>() { + override fun onSubscribe(d: Disposable) { + } + + override fun onNext(t: List) { + jiangChiBean.value = t as ArrayList + } + + }) + } + } + + val monsterUserLogList = MutableLiveData>() + fun get_user_monster_log(page: String) { + launchUI { + repository.get_user_monster_log( + page, + object : BaseObserver>() { + override fun onSubscribe(d: Disposable) { + } + + override fun onNext(t: List) { + monsterUserLogList.value = t as ArrayList + } + + }) + } + } + + var monsterLog = MutableLiveData>() + fun get_monster_log(page: String) { + launchUI { + repository.get_monster_log(page, object : BaseObserver>() { + override fun onSubscribe(d: Disposable) { + } + + override fun onNext(t: List) { + monsterLog.value = t as ArrayList + } + + }) + } + } + + val monsterNote = MutableLiveData() + fun get_monster_note_box() { + launchUI { + repository.get_monster_note(object : BaseObserver() { + override fun onSubscribe(d: Disposable) { + } + + override fun onNext(t: String) { + monsterNote.value = t + } + + }) + } + } +} \ No newline at end of file diff --git a/MainModule/src/main/java/com/xscm/modulemain/adapter/HorizontalListAdapter.java b/MainModule/src/main/java/com/xscm/modulemain/adapter/HorizontalListAdapter.java index 4ab35443..9b60ab7e 100644 --- a/MainModule/src/main/java/com/xscm/modulemain/adapter/HorizontalListAdapter.java +++ b/MainModule/src/main/java/com/xscm/modulemain/adapter/HorizontalListAdapter.java @@ -161,6 +161,8 @@ public class HorizontalListAdapter extends RecyclerView.Adapter(R.layout.item_box_jackpot_list2) { + override fun convert(helper: BaseViewHolder, item: BoxJiangChiBean) { + + item.let { + ImageUtils.loadHead(item.base_image,helper.getView(R.id.iv_cover)) + + helper.setText(R.id.tv_name, it.gift_name) + .setText(R.id.tv_num, item.gift_price) + } + + } + + +} \ No newline at end of file diff --git a/MainModule/src/main/java/com/xscm/modulemain/adapter/refining/BoxRankListAdapter2.kt b/MainModule/src/main/java/com/xscm/modulemain/adapter/refining/BoxRankListAdapter2.kt new file mode 100644 index 00000000..ee57f833 --- /dev/null +++ b/MainModule/src/main/java/com/xscm/modulemain/adapter/refining/BoxRankListAdapter2.kt @@ -0,0 +1,24 @@ +package com.xscm.modulemain.adapter.refining + +import android.content.Context +import android.view.ViewGroup +import com.blankj.utilcode.util.TimeUtils +import com.chad.library.adapter.base.BaseQuickAdapter +import com.chad.library.adapter.base.BaseViewHolder +import com.xscm.modulemain.R +import com.xscm.moduleutil.bean.room.refining.MonsterUserLogBean + +class BoxRankListAdapter2 : + BaseQuickAdapter(R.layout.item_box_rank_list2) { + override fun convert(helper: BaseViewHolder, item: MonsterUserLogBean) { + + helper.setText(R.id.tv_time,TimeUtils.millis2String(item.add_time.toLong() * 1000)) + .setText(R.id.tv_type_name,"炼仙传说:" + item.type_name) + .setText(R.id.tv_result,"第${item.mid}期 ${item.nick_name}中了${item.gift_name}(${item.gift_price})*${item.num}") + + + + } + + +} \ No newline at end of file diff --git a/MainModule/src/main/java/com/xscm/modulemain/adapter/refining/BoxRecordListAdapter2.kt b/MainModule/src/main/java/com/xscm/modulemain/adapter/refining/BoxRecordListAdapter2.kt new file mode 100644 index 00000000..73371198 --- /dev/null +++ b/MainModule/src/main/java/com/xscm/modulemain/adapter/refining/BoxRecordListAdapter2.kt @@ -0,0 +1,40 @@ +package com.xscm.modulemain.adapter.refining + +import com.blankj.utilcode.util.TimeUtils +import com.chad.library.adapter.base.BaseQuickAdapter +import com.chad.library.adapter.base.BaseViewHolder +import com.xscm.modulemain.R +import com.xscm.moduleutil.bean.room.refining.MonsterLogBean + +class BoxRecordListAdapter2 : + BaseQuickAdapter(R.layout.item_box_record_list2) { + override fun convert(helper: BaseViewHolder, item: MonsterLogBean) { + + + + item.let { + helper.setText(R.id.tv_time, TimeUtils.millis2String(item.add_time.toLong() * 1000)) + + when(item.is_join){ + // 1已中奖,2未中奖,3未参与 + 1->{ + helper.setText(R.id.tv_result,"第${it.id}期 炼仙传说 ${it.type_name} 获得 ${item.gift_name}(${item.gift_price})*${item.num}") + .setText(R.id.tv_join,"已中奖") + } + 2->{ + helper.setText(R.id.tv_result,"第${it.id}期 炼仙传说 ${it.type_name}") + .setText(R.id.tv_join,"未中奖") + } + 3->{ + helper.setText(R.id.tv_result,"第${it.id}期 炼仙传说 ${it.type_name}") + .setText(R.id.tv_join,"未参与") + } + else -> { + + } + } + } + } + + +} \ No newline at end of file diff --git a/MainModule/src/main/java/com/xscm/modulemain/dialog/RoomSettingFragment.java b/MainModule/src/main/java/com/xscm/modulemain/dialog/RoomSettingFragment.java index d9c04323..c7c1f7fa 100644 --- a/MainModule/src/main/java/com/xscm/modulemain/dialog/RoomSettingFragment.java +++ b/MainModule/src/main/java/com/xscm/modulemain/dialog/RoomSettingFragment.java @@ -1,5 +1,6 @@ package com.xscm.modulemain.dialog; +import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomBusinessLegend; import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomBusinessTime; import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomOrderMic; import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomTimeRedSound; @@ -31,6 +32,7 @@ import com.xscm.modulemain.adapter.HorizontalListAdapter; import com.xscm.modulemain.adapter.RoomSettingAdapter; import com.xscm.modulemain.databinding.DialogRoomSettingFragmentBinding; import com.xscm.modulemain.activity.WebViewActivity; +import com.xscm.modulemain.dialog.refining.BoxMainDialog2; import com.xscm.moduleutil.base.CommonAppContext; import com.xscm.moduleutil.base.WebUrlConstants; import com.xscm.moduleutil.bean.BlindBoxStatus; @@ -193,8 +195,6 @@ public class RoomSettingFragment extends BaseMvpDialogFragment= RoomSettingBean.QXRoomSettingTypeRoomLeave && type <= RoomSettingBean.QXRoomSettingTypeRoomReport || type == RoomSettingBean.QXRoomSettingTypeRoomFloatingRed || type == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears || - type == QXRoomSettingTypeRoomTimeSpace || type == QXRoomSettingTypeRoomTimeRedSound) { + type == QXRoomSettingTypeRoomTimeSpace || type == QXRoomSettingTypeRoomTimeRedSound || type == QXRoomSettingTypeRoomBusinessLegend) { return true; } else { @@ -814,7 +658,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment blindBoxStatus) { - for (int i = 0; i < blindBoxStatus.size(); i++) { - int giftBagId = blindBoxStatus.get(i).getGift_bag_id(); - int status = blindBoxStatus.get(i).getStatus(); - for (int j = 0; j < filteredList.size(); j++) { - for (int k = 0; k < filteredList.get(j).getChildren().size(); k++) { - - if ((giftBagId == 11 && filteredList.get(j).getChildren().get(k).getType() == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears) || - (giftBagId == 12 && filteredList.get(j).getChildren().get(k).getType() == RoomSettingBean.QXRoomSettingTypeRoomTimeSpace)) { - if (status != 1) { - filteredList.get(j).getChildren().remove(k); - }else { - if (SpUtil.getShelf() == 1) { - filteredList.get(j).getChildren().remove(k); - } - } + if (blindBoxStatus != null && !blindBoxStatus.isEmpty()) { + RoomSettingBean moreParent = new RoomSettingBean("活动", null, null, null, -1, read, isSelected, true, false); + List moreChildren = new ArrayList<>(); + for (int i = 0; i < blindBoxStatus.size(); i++) { + int giftBagId = blindBoxStatus.get(i).getGift_bag_id(); + int status = blindBoxStatus.get(i).getStatus(); + if (giftBagId == 11) { + if (status == 1) { + moreChildren.add(new RoomSettingBean("岁月之城", "the_city_years", null, null, RoomSettingBean.QXRoomSettingTypeRoomTheCityYears, read, isSelected, true, false)); + } + } else if (giftBagId == 12) { + if (status == 1) { + moreChildren.add(new RoomSettingBean("时空之巅", "time_space", null, null, QXRoomSettingTypeRoomTimeSpace, read, isSelected, true, false)); + } + }else if (giftBagId == 60) { + if (status == 1) { + moreChildren.add(new RoomSettingBean("炼仙传说", "legend", null, null, QXRoomSettingTypeRoomBusinessLegend, read, isSelected, true, redSound)); } } +// else { +// if (status == 1) { +// moreChildren.add(new RoomSettingBean("炼仙传说", "legend", null, null, QXRoomSettingTypeRoomBusinessLegend, read, isSelected, true, redSound)); +// } +// } } + moreParent.setChildren(moreChildren); + filteredList.add(moreParent); } adapter.notifyDataSetChanged(); } diff --git a/MainModule/src/main/java/com/xscm/modulemain/dialog/RoomUserInfoFragment.java b/MainModule/src/main/java/com/xscm/modulemain/dialog/RoomUserInfoFragment.java index cdddd247..8cd1aa5a 100644 --- a/MainModule/src/main/java/com/xscm/modulemain/dialog/RoomUserInfoFragment.java +++ b/MainModule/src/main/java/com/xscm/modulemain/dialog/RoomUserInfoFragment.java @@ -558,7 +558,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment { //跳转加入公会 diff --git a/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxInputMultipleDialog.kt b/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxInputMultipleDialog.kt new file mode 100644 index 00000000..9b0c648b --- /dev/null +++ b/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxInputMultipleDialog.kt @@ -0,0 +1,157 @@ +package com.yuyin.module_live.ui.baoxiang5 + +import android.os.Bundle +import android.view.View +import android.widget.TextView +import androidx.lifecycle.ViewModelProviders +import androidx.recyclerview.widget.GridLayoutManager +import com.chad.library.adapter.base.BaseQuickAdapter +import com.chad.library.adapter.base.BaseViewHolder +import com.google.android.gms.common.api.ApiException +import com.voice.lib_base.base.dialog.BaseFragmentDialog +import com.xscm.modulemain.R +import com.xscm.modulemain.activity.room.activity.RoomActivity +import com.xscm.modulemain.activity.room.presenter.RoomViewModel +import com.xscm.modulemain.databinding.DialogInputMultipleBinding +import com.xscm.moduleutil.bean.room.refining.MonsterInfoBean + +class BoxInputMultipleDialog() : + BaseFragmentDialog(R.layout.dialog_input_multiple) { + + lateinit var viewModel: RoomViewModel + lateinit var liveActivity: RoomActivity + var onSelectResultListener: OnSelectResultListener? = null + var multiple = "" + var numMultiple = 1 + var name = "" + private var money = "" + private lateinit var monsterInfoBean: MonsterInfoBean + + constructor(multiple: String, name: String, onSelectResultListener: OnSelectResultListener, liveActivity: RoomActivity, monsterInfoBean:MonsterInfoBean) : this() { + this.onSelectResultListener = onSelectResultListener + this.multiple = multiple + this.name = name + this.liveActivity=liveActivity + this.monsterInfoBean=monsterInfoBean + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) +// viewModel = liveActivity.viewModel + viewModel = ViewModelProviders.of(this)[RoomViewModel::class.java] + viewModel.getMoneyData() + viewModel.moneyBean.observe(liveActivity) { + money = it.coin +// if (ClickUtil.canClickRoom()) { +// viewModel.get_monster_info_box() +// } + + monsterInfoBean.let { + updateTextViews(it) + } + } +// viewModel.monsterInfo.observe(liveActivity) { +// updateTextViews(it) +// } + + viewModel.getError().observe(liveActivity) { + if (it is ApiException) { + } + } + setupMultipleImages() + setupRecyclerView() + setupClickListeners() + } + + private fun setupClickListeners() { + mBinding.minus.setOnClickListener { + updateNumber(-numMultiple) + } + + mBinding.add.setOnClickListener { + updateNumber(numMultiple) + } + + mBinding.btnConfirm.setOnClickListener { + onSelectResultListener?.result(mBinding.number.text.toString(), this) + } + + mBinding.btnCancel.setOnClickListener { + dismiss() + } + } + + private fun setupRecyclerView() { + mBinding.rvContainer.itemAnimator = null + mBinding.rvContainer.layoutManager = GridLayoutManager(requireContext(), 3) + val adapter = BoxInputMultipleAdapter() + adapter.setNewData(arrayListOf("1","10", "20", "30", "50", "100")) + adapter.setOnItemClickListener { _, _, position -> + adapter.setSelectPosition(position) + mBinding.number.setText(adapter.data[position]) + numMultiple = adapter.data[position].toInt() + updateIntegralText() + } + mBinding.rvContainer.adapter = adapter + mBinding.number.setText(adapter.data[0]) + } + + private fun updateIntegralText() { + val num = mBinding.number.text.toString().ifEmpty { "0" }.toIntOrNull() ?: 0 + viewModel.monsterInfo.value?.let { + mBinding.tvIntegral.text = "金币${(num * it.open_monster_price.toInt())}/$money" + } + } + + private fun updateTextViews(info: MonsterInfoBean) { + mBinding.tvTextNum.text = "${info.open_monster_price}金币/次" + mBinding.tvIntegral.text = "金币${(10 * info.open_monster_price.toInt())}/$money" + } + + private fun setupMultipleImages() { + when (multiple) { + "1" -> setMultipleImage("玉狮子", R.mipmap.anim_wealth1) + "2" -> setMultipleImage("乌骓马", R.mipmap.anim_wealth2) + "3" -> setMultipleImage("追风驹", R.mipmap.anim_wealth3) + "4" -> setMultipleImage("乌云驹", R.mipmap.anim_wealth4) + "5" -> setMultipleImage("黄彪马", R.mipmap.anim_wealth5) + "6" -> setMultipleImage("青鬃马", R.mipmap.anim_wealth6) + } + } + + private fun setMultipleImage(title: String, resourceId: Int) { + mBinding.tvTitle.text = title + mBinding.ivCover.setImageResource(resourceId) + } + + private fun updateNumber(delta: Int) { + val num = mBinding.number.text.toString().ifEmpty { "0" }.toIntOrNull() ?: 0 + val newNum = maxOf(num + delta, 0) + mBinding.number.setText(newNum.toString()) + updateIntegralText() + } +} + + +class BoxInputMultipleAdapter() : + BaseQuickAdapter(R.layout.item_box_select_multiple) { + + private var selectPosition = 0 + + fun setSelectPosition(index: Int) { + notifyItemChanged(selectPosition) + notifyItemChanged(index) + selectPosition = index + } + + override fun convert(helper: BaseViewHolder, item: String?) { + val isSelect = helper.layoutPosition == selectPosition + helper.getView(R.id.item_main).isSelected = isSelect + helper.setText(R.id.item_main, item) + } + +} + +interface OnSelectResultListener { + fun result(num: String, dialog: BoxInputMultipleDialog) +} \ No newline at end of file diff --git a/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxJackpotDialog2.kt b/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxJackpotDialog2.kt new file mode 100644 index 00000000..573566dd --- /dev/null +++ b/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxJackpotDialog2.kt @@ -0,0 +1,37 @@ +package com.xscm.modulemain.dialog.refining + +import android.os.Bundle +import android.view.View +import androidx.lifecycle.ViewModelProviders +import androidx.recyclerview.widget.GridLayoutManager +import com.xscm.moduleutil.base.BaseBottomFragmentDialog +import com.xscm.modulemain.R +import com.xscm.modulemain.activity.room.presenter.RoomViewModel +import com.xscm.modulemain.adapter.refining.BoxJackpotListAdapter2 +import com.xscm.modulemain.databinding.DialogBoxJackpot2Binding +/** +* @Author qx +* @Time 2026/1/28 10:11 +* @Description 炼仙传说奖池 +*/ +class BoxJackpotDialog2 : + BaseBottomFragmentDialog(R.layout.dialog_box_jackpot2) { + + val boxJackpotListAdapter2 = BoxJackpotListAdapter2() + lateinit var viewModel: RoomViewModel + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + viewModel = ViewModelProviders.of(this)[RoomViewModel::class.java] + + mBinding.rvContainer.layoutManager= GridLayoutManager(context, 3) + mBinding.rvContainer.adapter=boxJackpotListAdapter2 + viewModel.get_monster_box_list() + viewModel.jiangChiBean.observe(this) { + boxJackpotListAdapter2.setNewData(it) + } + + + } + +} \ No newline at end of file diff --git a/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxMainDialog2.kt b/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxMainDialog2.kt new file mode 100644 index 00000000..c118779b --- /dev/null +++ b/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxMainDialog2.kt @@ -0,0 +1,266 @@ +package com.xscm.modulemain.dialog.refining + +import android.content.DialogInterface +import android.os.Bundle +import android.view.View +import androidx.core.view.isVisible +import androidx.lifecycle.ViewModelProviders +import androidx.lifecycle.lifecycleScope +import com.blankj.utilcode.util.LogUtils +import com.xscm.moduleutil.base.BaseBottomFragmentDialog +import com.xscm.modulemain.R +import com.xscm.modulemain.activity.room.activity.RoomActivity +import com.xscm.modulemain.activity.room.presenter.RoomViewModel +import com.xscm.modulemain.databinding.DialogBoxMain2Binding +import com.xscm.moduleutil.bean.room.refining.MonsterEndBean +import com.xscm.moduleutil.bean.room.refining.MonsterInfoBean +import com.xscm.moduleutil.bean.room.refining.OpenMonsterBean +import com.xscm.moduleutil.utils.CountDownUtil +import com.xscm.moduleutil.utils.ImageUtils +import com.yuyin.module_live.ui.baoxiang5.BoxInputMultipleDialog +import com.yuyin.module_live.ui.baoxiang5.BoxRankDialog2 +import com.yuyin.module_live.ui.baoxiang5.OnSelectResultListener + +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.cancel +import org.greenrobot.eventbus.EventBus +import org.greenrobot.eventbus.Subscribe +/** +* @Author qx +* @Time 2026/1/28 10:08 +* @Description 炼仙传说游戏主页面 +*/ +class BoxMainDialog2() : BaseBottomFragmentDialog(R.layout.dialog_box_main2) { + + private lateinit var liveActivity: RoomActivity + + constructor(liveActivity: RoomActivity) : this() { + this.liveActivity = liveActivity + } + + + private lateinit var viewModel: RoomViewModel + + private var timeDownScope: CoroutineScope? = null + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + viewModel = ViewModelProviders.of(this)[RoomViewModel::class.java] + EventBus.getDefault().register(this) + viewModel.getMoneyData() + viewModel.moneyBean.observe(this) { + mBinding.tvYue.text = it.coin + } + viewModel.get_monster_info_box() + viewModel.monsterInfo.observe(this) { + LogUtils.e("倒计时时间22:${it.surplus_time}") + refreshData(it) + } + + + mBinding.GuiZe.setOnClickListener { + if (this::liveActivity.isInitialized){ + BoxRuleDialog2().show(liveActivity.supportFragmentManager, "规则2") + + } + } + + mBinding.ZJiLu.setOnClickListener { + if (this::liveActivity.isInitialized){ + BoxRankDialog2().show(liveActivity.supportFragmentManager, "榜单") + + } + + } + + mBinding.record.setOnClickListener { + if (this::liveActivity.isInitialized){ + BoxRecordDialog2(liveActivity).show(liveActivity.supportFragmentManager, "记录2") + + } + } + + mBinding.JiangChi.setOnClickListener { + if (this::liveActivity.isInitialized){ + BoxJackpotDialog2().show(liveActivity.supportFragmentManager, "奖池2") + } + } + + + mBinding.btnConfirm.setOnClickListener { + mBinding.llResult.visibility = View.GONE + } + + mBinding.btnConfirmFaile.setOnClickListener { + mBinding.llFial.visibility = View.GONE + } + + mBinding.dialogMain.setOnClickListener { + if (mBinding.llFial.isVisible) { + mBinding.llFial.visibility = View.GONE + } else if (mBinding.llResult.isVisible) { + mBinding.llResult.visibility = View.GONE + } else { + dismiss() + } + } + + mBinding.constraint.setOnClickListener { } + + + mBinding.llFial.setOnClickListener { + mBinding.llFial.visibility = View.GONE + } + + mBinding.tvYue.setOnClickListener { +// ARouter.getInstance().build(AroutUtil.MAIN_MY_MONEY).navigation() + } + + viewModel.openBeatMonster.observe(this) { + mBinding.tvYue.text = it.integral + when (it.type) { + "1" -> { + mBinding.tvMultiple1.text = "已投入:${it.num}" + } + + "2" -> { + mBinding.tvMultiple2.text = "已投入:${it.num}" + } + + "3" -> { + mBinding.tvMultiple3.text = "已投入:${it.num}" + } + + "4" -> { + mBinding.tvMultiple4.text = "已投入:${it.num}" + } + + "5" -> { + mBinding.tvMultiple5.text = "已投入:${it.num}" + } + "6" -> { + mBinding.tvMultiple6.text = "已投入:${it.num}" + } + } + } + } + + + private fun showBoxInputMultipleDialog(tag: String, multiple: String) { + viewModel.monsterInfo.value?.let { + BoxInputMultipleDialog(multiple, tag, object : OnSelectResultListener { + override fun result(num: String, dialog: BoxInputMultipleDialog) { + viewModel.open_beat_monster(liveActivity.roomId, multiple, num) + dialog.dismiss() + } + }, liveActivity, it).show(liveActivity.supportFragmentManager, tag) + } + + } + + + @Subscribe // 开始抽奖 + fun monsterInfo(monsterInfoBean: MonsterInfoBean) { + refreshData(monsterInfoBean) + } + + @Subscribe // 个人抽奖播报 + fun openMonster(openMonster: OpenMonsterBean) { + if (openMonster.is_win == 1) { + mBinding.llResult.visibility = View.VISIBLE + mBinding.tvTypeName.text = "中奖:${openMonster.type_name}" + ImageUtils.loadHead(openMonster.base_image,mBinding.ivGift) +// GlideUtil.loadImglogo(requireContext(), openMonster.base_image, mBinding.ivGift) + mBinding.tvGiftName.text = openMonster.gift_name+"*"+openMonster.num + mBinding.tvGiftPrice.text = openMonster.gift_price + } else { + mBinding.tvTypeName2.text = "中奖:${openMonster.type_name}" + mBinding.llFial.visibility = View.VISIBLE + } + } + + + @Subscribe // 抽奖结束播报 + fun monsterEnd(monsterEnd: MonsterEndBean) { + if (monsterEnd.is_finsh == 1) { +// mBinding.tvTypeName2.text = "中奖财神:${monsterEnd.win_type_name}" +// mBinding.llFial.visibility = View.VISIBLE + } + } + + + private fun refreshData(monsterInfo: MonsterInfoBean) { + mBinding.llFial.visibility = View.GONE + mBinding.llResult.visibility = View.GONE + val investedText = "已投入:" + val multipleList = monsterInfo.multiple_list.orEmpty() + + multipleList.take(6).forEachIndexed { index, item -> + val num = item.num + when (index) { + 0 -> { + mBinding.tvMultiple1.text = "$investedText$num" + mBinding.tvMul1.text = "x${item.multiple}倍" + mBinding.textView1.text = item.type_name + mBinding.tvMultiple1.setOnClickListener { showBoxInputMultipleDialog(item.type_name, "1") } + } + 1 -> { + mBinding.tvMultiple2.text = "$investedText$num" + mBinding.tvMul2.text = "x${item.multiple}倍" + mBinding.textView2.text = item.type_name + mBinding.tvMultiple2.setOnClickListener { showBoxInputMultipleDialog(item.type_name, "2") } + } + 2 ->{ + mBinding.tvMultiple3.text = "$investedText$num" + mBinding.tvMul3.text = "x${item.multiple}倍" + mBinding.textView3.text = item.type_name + mBinding.tvMultiple3.setOnClickListener { showBoxInputMultipleDialog(item.type_name, "3") } + } + 3 ->{ + mBinding.tvMultiple4.text = "$investedText$num" + mBinding.tvMul4.text = "x${item.multiple}倍" + mBinding.textView4.text = item.type_name + mBinding.tvMultiple4.setOnClickListener { showBoxInputMultipleDialog(item.type_name, "4") } + } + 4 ->{ + mBinding.tvMultiple5.text = "$investedText$num" + mBinding.tvMul5.text = "x${item.multiple}倍" + mBinding.textView5.text = item.type_name + mBinding.tvMultiple5.setOnClickListener { showBoxInputMultipleDialog(item.type_name, "5") } + } + 5 ->{ + mBinding.tvMultiple6.text = "$investedText$num" + mBinding.tvMul6.text = "x${item.multiple}倍" + mBinding.textView6.text = item.type_name + mBinding.tvMultiple6.setOnClickListener { showBoxInputMultipleDialog(item.type_name, "6") } + } + } + } + + timeDownScope?.cancel() + LogUtils.e("倒计时时间:${monsterInfo.surplus_time}") + CountDownUtil.countDown(lifecycleScope, monsterInfo.surplus_time, { scope -> + timeDownScope = scope + }, { + + }, { + mBinding.tvCountDownTime.text = + "倒计时:${CountDownUtil.formatCountDownTime(it.toLong())}" + }) + } + + + override fun onDismiss(dialog: DialogInterface) { + if (mBinding.llFial.isVisible) { + mBinding.llFial.visibility = View.GONE + } else if (mBinding.llResult.isVisible) { + mBinding.llResult.visibility = View.GONE + } else { + super.onDismiss(dialog) + EventBus.getDefault().unregister(this) + timeDownScope?.cancel() + } + } + + +} \ No newline at end of file diff --git a/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxRankDialog2.kt b/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxRankDialog2.kt new file mode 100644 index 00000000..5fd703e1 --- /dev/null +++ b/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxRankDialog2.kt @@ -0,0 +1,58 @@ +package com.yuyin.module_live.ui.baoxiang5 + +import android.os.Bundle +import android.view.View +import androidx.lifecycle.ViewModelProviders +import androidx.recyclerview.widget.LinearLayoutManager +import com.scwang.smartrefresh.layout.api.RefreshLayout +import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener +import com.xscm.moduleutil.base.BaseBottomFragmentDialog +import com.xscm.modulemain.R +import com.xscm.modulemain.activity.room.presenter.RoomViewModel +import com.xscm.modulemain.adapter.refining.BoxRankListAdapter2 +import com.xscm.modulemain.databinding.DialogBoxRank2Binding +/** +* @Author qx +* @Time 2026/1/28 10:09 +* @Description 炼仙传说榜单 +*/ +class BoxRankDialog2 : BaseBottomFragmentDialog(R.layout.dialog_box_rank2) { + lateinit var viewModel: RoomViewModel + + var boxRankListAdapter2 = BoxRankListAdapter2() + + var page = 1 + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + viewModel = ViewModelProviders.of(this)[RoomViewModel::class.java] + mBinding.rvContainer.layoutManager = LinearLayoutManager(context) + mBinding.rvContainer.adapter = boxRankListAdapter2 + + mBinding.smartRefresh.setOnRefreshLoadMoreListener(object : OnRefreshLoadMoreListener { + override fun onRefresh(refreshLayout: RefreshLayout) { + page = 1 + viewModel.get_user_monster_log(page.toString()) + + } + + override fun onLoadMore(refreshLayout: RefreshLayout) { + page++ + viewModel.get_user_monster_log(page.toString()) + + } + }) + + viewModel.get_user_monster_log(page.toString()) + viewModel.monsterUserLogList.observe(this) { + mBinding.smartRefresh.finishRefresh() + mBinding.smartRefresh.finishLoadMore() + if (page == 1) { + boxRankListAdapter2.setNewData(it) + } else { + boxRankListAdapter2.addData(it) + } + } + + } + +} \ No newline at end of file diff --git a/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxRecordDialog2.kt b/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxRecordDialog2.kt new file mode 100644 index 00000000..7325422c --- /dev/null +++ b/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxRecordDialog2.kt @@ -0,0 +1,71 @@ +package com.xscm.modulemain.dialog.refining + +import android.os.Bundle +import android.view.View +import androidx.lifecycle.ViewModelProviders +import androidx.recyclerview.widget.LinearLayoutManager +import com.scwang.smartrefresh.layout.api.RefreshLayout +import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener +import com.xscm.moduleutil.base.BaseBottomFragmentDialog +import com.xscm.modulemain.R +import com.xscm.modulemain.activity.room.activity.RoomActivity +import com.xscm.modulemain.activity.room.presenter.RoomViewModel +import com.xscm.modulemain.adapter.refining.BoxRecordListAdapter2 +import com.xscm.modulemain.databinding.DialogBoxRecord2Binding +/** +* @Author qx +* @Time 2026/1/28 10:10 +* @Description 炼仙传说记录 +*/ +class BoxRecordDialog2() : + BaseBottomFragmentDialog(R.layout.dialog_box_record2) { + + lateinit var liveActivity: RoomActivity + lateinit var viewModel: RoomViewModel + + var page = 1 + var boxRecordListAdapter2 = BoxRecordListAdapter2() + + + constructor(liveActivity: RoomActivity) : this() { + this.liveActivity = liveActivity + } + + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + viewModel = ViewModelProviders.of(this)[RoomViewModel::class.java] + mBinding.rvContainer.layoutManager = LinearLayoutManager(context) + mBinding.rvContainer.adapter= boxRecordListAdapter2 + + mBinding.smartRefresh.setOnRefreshLoadMoreListener(object : OnRefreshLoadMoreListener { + override fun onRefresh(refreshLayout: RefreshLayout) { + page = 1 + viewModel.get_monster_log(page.toString()) + + } + + override fun onLoadMore(refreshLayout: RefreshLayout) { + page++ + viewModel.get_monster_log(page.toString()) + + } + }) + + + viewModel.get_monster_log(page.toString()) + + viewModel.monsterLog.observe(this) { + mBinding.smartRefresh.finishRefresh() + mBinding.smartRefresh.finishLoadMore() + if (page == 1) { + boxRecordListAdapter2.setNewData(it) + } else { + boxRecordListAdapter2.addData(it) + } + } + + } +} + + diff --git a/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxRuleDialog2.kt b/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxRuleDialog2.kt new file mode 100644 index 00000000..fdb2828a --- /dev/null +++ b/MainModule/src/main/java/com/xscm/modulemain/dialog/refining/BoxRuleDialog2.kt @@ -0,0 +1,28 @@ +package com.xscm.modulemain.dialog.refining + +import android.os.Bundle +import android.view.View +import androidx.lifecycle.ViewModelProviders +import com.xscm.moduleutil.base.BaseBottomFragmentDialog +import com.xscm.modulemain.R +import com.xscm.modulemain.activity.room.presenter.RoomViewModel +import com.xscm.modulemain.databinding.DialogBoxRule2Binding +/** +* @Author qx +* @Time 2026/1/28 10:08 +* @Description 炼仙传说规则页面 +*/ +class BoxRuleDialog2 : BaseBottomFragmentDialog(R.layout.dialog_box_rule2) { + lateinit var viewModel: RoomViewModel + + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + viewModel = ViewModelProviders.of(this)[RoomViewModel::class.java] + viewModel.get_monster_note_box() + viewModel.monsterNote.observe(this) { + mBinding.tvContent.text = it + } + } + +} \ No newline at end of file diff --git a/MainModule/src/main/res/layout/dialog_box_jackpot2.xml b/MainModule/src/main/res/layout/dialog_box_jackpot2.xml new file mode 100644 index 00000000..b36039ed --- /dev/null +++ b/MainModule/src/main/res/layout/dialog_box_jackpot2.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + diff --git a/MainModule/src/main/res/layout/dialog_box_main2.xml b/MainModule/src/main/res/layout/dialog_box_main2.xml new file mode 100644 index 00000000..6a996717 --- /dev/null +++ b/MainModule/src/main/res/layout/dialog_box_main2.xml @@ -0,0 +1,529 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MainModule/src/main/res/layout/dialog_box_rank2.xml b/MainModule/src/main/res/layout/dialog_box_rank2.xml new file mode 100644 index 00000000..c1bf85bf --- /dev/null +++ b/MainModule/src/main/res/layout/dialog_box_rank2.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + diff --git a/MainModule/src/main/res/layout/dialog_box_record2.xml b/MainModule/src/main/res/layout/dialog_box_record2.xml new file mode 100644 index 00000000..d9f6aca8 --- /dev/null +++ b/MainModule/src/main/res/layout/dialog_box_record2.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + diff --git a/MainModule/src/main/res/layout/dialog_box_rule2.xml b/MainModule/src/main/res/layout/dialog_box_rule2.xml new file mode 100644 index 00000000..81b49456 --- /dev/null +++ b/MainModule/src/main/res/layout/dialog_box_rule2.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + diff --git a/MainModule/src/main/res/layout/dialog_input_multiple.xml b/MainModule/src/main/res/layout/dialog_input_multiple.xml new file mode 100644 index 00000000..f1e03a1c --- /dev/null +++ b/MainModule/src/main/res/layout/dialog_input_multiple.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MainModule/src/main/res/layout/fragment_room_user_info.xml b/MainModule/src/main/res/layout/fragment_room_user_info.xml index df181625..51e6da73 100644 --- a/MainModule/src/main/res/layout/fragment_room_user_info.xml +++ b/MainModule/src/main/res/layout/fragment_room_user_info.xml @@ -367,7 +367,7 @@ android:layout_height="@dimen/dp_20" android:layout_alignParentEnd="true" android:drawableEnd="@mipmap/room_rig_jt" - android:text="90天内累计收到200个礼物" + android:text="累计收到200个礼物" android:textColor="@color/color_FF999999" android:textSize="@dimen/sp_14" /> diff --git a/MainModule/src/main/res/layout/item_box_jackpot_list2.xml b/MainModule/src/main/res/layout/item_box_jackpot_list2.xml new file mode 100644 index 00000000..382863ad --- /dev/null +++ b/MainModule/src/main/res/layout/item_box_jackpot_list2.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/MainModule/src/main/res/layout/item_box_rank_list2.xml b/MainModule/src/main/res/layout/item_box_rank_list2.xml new file mode 100644 index 00000000..7aff9197 --- /dev/null +++ b/MainModule/src/main/res/layout/item_box_rank_list2.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + diff --git a/MainModule/src/main/res/layout/item_box_record_list2.xml b/MainModule/src/main/res/layout/item_box_record_list2.xml new file mode 100644 index 00000000..118f37f3 --- /dev/null +++ b/MainModule/src/main/res/layout/item_box_record_list2.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + diff --git a/MainModule/src/main/res/layout/item_box_select_multiple.xml b/MainModule/src/main/res/layout/item_box_select_multiple.xml new file mode 100644 index 00000000..c07d4131 --- /dev/null +++ b/MainModule/src/main/res/layout/item_box_select_multiple.xml @@ -0,0 +1,19 @@ + + + + + + + diff --git a/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth1.webp b/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth1.webp new file mode 100644 index 00000000..7120879b Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth1.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth2.webp b/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth2.webp new file mode 100644 index 00000000..ae5e9f65 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth2.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth3.webp b/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth3.webp new file mode 100644 index 00000000..4eed04be Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth3.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth4.webp b/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth4.webp new file mode 100644 index 00000000..1656cf9f Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth4.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth5.webp b/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth5.webp new file mode 100644 index 00000000..a605626f Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth5.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth6.webp b/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth6.webp new file mode 100644 index 00000000..e7272116 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/anim_wealth6.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/baoxiang_item_jiangchi.webp b/MainModule/src/main/res/mipmap-xxhdpi/baoxiang_item_jiangchi.webp new file mode 100644 index 00000000..b53cf814 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/baoxiang_item_jiangchi.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/baoxiang_item_jilu.webp b/MainModule/src/main/res/mipmap-xxhdpi/baoxiang_item_jilu.webp new file mode 100644 index 00000000..ce4eccbe Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/baoxiang_item_jilu.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/baoxiang_item_record.webp b/MainModule/src/main/res/mipmap-xxhdpi/baoxiang_item_record.webp new file mode 100644 index 00000000..3d2ef8c0 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/baoxiang_item_record.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/baoxiang_item_zuize.webp b/MainModule/src/main/res/mipmap-xxhdpi/baoxiang_item_zuize.webp new file mode 100644 index 00000000..aa9f83ae Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/baoxiang_item_zuize.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/bg_box2_balance.webp b/MainModule/src/main/res/mipmap-xxhdpi/bg_box2_balance.webp new file mode 100644 index 00000000..19fa5df1 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/bg_box2_balance.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/bg_box2_cancel.webp b/MainModule/src/main/res/mipmap-xxhdpi/bg_box2_cancel.webp new file mode 100644 index 00000000..2410ccd2 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/bg_box2_cancel.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/bg_box2_confirm.webp b/MainModule/src/main/res/mipmap-xxhdpi/bg_box2_confirm.webp new file mode 100644 index 00000000..64f406a2 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/bg_box2_confirm.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/box_bg.webp b/MainModule/src/main/res/mipmap-xxhdpi/box_bg.webp new file mode 100644 index 00000000..70056fb3 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/box_bg.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/box_bg1.webp b/MainModule/src/main/res/mipmap-xxhdpi/box_bg1.webp new file mode 100644 index 00000000..26a21cae Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/box_bg1.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/box_bg2.webp b/MainModule/src/main/res/mipmap-xxhdpi/box_bg2.webp new file mode 100644 index 00000000..ff2b86b9 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/box_bg2.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/box_bg3.webp b/MainModule/src/main/res/mipmap-xxhdpi/box_bg3.webp new file mode 100644 index 00000000..f707b9a6 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/box_bg3.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/box_bg4.webp b/MainModule/src/main/res/mipmap-xxhdpi/box_bg4.webp new file mode 100644 index 00000000..0393ec70 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/box_bg4.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/box_bg5.webp b/MainModule/src/main/res/mipmap-xxhdpi/box_bg5.webp new file mode 100644 index 00000000..f80a0f62 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/box_bg5.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/box_fail.webp b/MainModule/src/main/res/mipmap-xxhdpi/box_fail.webp new file mode 100644 index 00000000..c0cabd10 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/box_fail.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/box_fail1.webp b/MainModule/src/main/res/mipmap-xxhdpi/box_fail1.webp new file mode 100644 index 00000000..20367f26 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/box_fail1.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/box_gift.webp b/MainModule/src/main/res/mipmap-xxhdpi/box_gift.webp new file mode 100644 index 00000000..5834bd21 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/box_gift.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/box_success.webp b/MainModule/src/main/res/mipmap-xxhdpi/box_success.webp new file mode 100644 index 00000000..9723fe3f Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/box_success.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/cishu_bg1.webp b/MainModule/src/main/res/mipmap-xxhdpi/cishu_bg1.webp new file mode 100644 index 00000000..50e81106 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/cishu_bg1.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/daojishi_bg.webp b/MainModule/src/main/res/mipmap-xxhdpi/daojishi_bg.webp new file mode 100644 index 00000000..f35523d0 Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/daojishi_bg.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/ic_box_multiple_add.webp b/MainModule/src/main/res/mipmap-xxhdpi/ic_box_multiple_add.webp new file mode 100644 index 00000000..4988817d Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/ic_box_multiple_add.webp differ diff --git a/MainModule/src/main/res/mipmap-xxhdpi/ic_box_multiple_minus.webp b/MainModule/src/main/res/mipmap-xxhdpi/ic_box_multiple_minus.webp new file mode 100644 index 00000000..72dde71e Binary files /dev/null and b/MainModule/src/main/res/mipmap-xxhdpi/ic_box_multiple_minus.webp differ diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 62b9868e..d4cf88db 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -984,7 +984,18 @@ public static java.lang.String TABLENAME; -keep class com.xscm.moduleutil.utils.cos.Credentials { *; } +# 保留 ViewBinding 相关类 +-keep class * implements androidx.viewbinding.ViewBinding { *; } +-keep class * extends androidx.viewbinding.ViewBinding { *; } + +# 保留 DataBinding +-keep class androidx.databinding.** { *; } +-keep class * extends androidx.databinding.ViewDataBinding { *; } + +# 保留你的基类和子类 +-keep class com.xscm.moduleutil.base.** { *; } +-keep class * extends com.xscm.moduleutil.base.BaseBottomFragmentDialog { *; } # 保留核心属性,确保mapping.txt记录完整 -keepattributes SourceFile,LineNumberTable,InnerClasses,LocalVariableTable,LocalVariableTypeTable # 隐藏真实源文件名(可选,不影响还原,仅保护源码信息) diff --git a/gradle.properties b/gradle.properties index 92e2baac..831dcdc6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -28,8 +28,8 @@ isBuildModule=false #org.gradle.deamon=false android.injected.testOnly=false -APP_VERSION_NAME=1.0.9.7 -APP_VERSION_CODE=87 +APP_VERSION_NAME=1.0.9.8 +APP_VERSION_CODE=88 org.gradle.jvm.toolchain.useLegacyAdapters=false #org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15