1:添加酒吧房各个弹框,只有界面
This commit is contained in:
@@ -8,6 +8,7 @@ import com.xscm.modulemain.activity.room.activity.RoomActivity
|
||||
import com.xscm.modulemain.activity.room.presenter.PubPresenter
|
||||
import com.xscm.modulemain.databinding.FragmentPubRoomBinding
|
||||
import com.xscm.modulemain.dialog.RoomUserInfoFragment
|
||||
import com.xscm.modulemain.dialog.barRoom.RoomDurationDialog
|
||||
import com.xscm.modulemain.widget.RoomPubWheatView
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent
|
||||
@@ -127,6 +128,10 @@ class RoomPubFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mBinding.ivSetTime.setOnClickListener {
|
||||
RoomDurationDialog(ActivityUtils.getTopActivity(),mRoomId).show()
|
||||
}
|
||||
}
|
||||
|
||||
fun roomInfoUpdate(roomInfoResp: RoomInfoResp) {
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.xscm.modulemain.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils
|
||||
import com.xscm.moduleutil.utils.ColorManager
|
||||
import com.xscm.moduleutil.utils.ImageUtils
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/5 10:57
|
||||
* 用途:
|
||||
*/
|
||||
class RoomGiftGivingAdapter(private val dataList: List<RoonGiftModel>,
|
||||
private val onItemSelectedListener: (RoonGiftModel, Int) -> Unit
|
||||
) : RecyclerView.Adapter<RoomGiftGivingAdapter.ViewHolder>() {
|
||||
|
||||
private var selectedPosition = -1 // 默认没有选中项
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_gift_giving, parent, false)
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val item = dataList[position]
|
||||
holder.bind(item, position)
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = dataList.size
|
||||
|
||||
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
private val iv_gift_pic: ImageView = itemView.findViewById(R.id.iv_gift_pic)
|
||||
private val tv_gift_name: TextView = itemView.findViewById(R.id.tv_gift_name)
|
||||
private val tv_gift_price: TextView = itemView.findViewById(R.id.tv_gift_price)
|
||||
|
||||
private val tv_gift_desc: TextView = itemView.findViewById(R.id.tv_gift_desc)
|
||||
private val tv_wheat_qd: TextView = itemView.findViewById(R.id.tv_wheat_qd)
|
||||
|
||||
fun bind(item: RoonGiftModel, position: Int) {
|
||||
tv_gift_name.text = item.gift_name
|
||||
tv_gift_price.text = item.gift_price
|
||||
// viewHolder.item_layout.setTag(R.id.id_gift_tag, giftModel);
|
||||
|
||||
//加载礼物图片
|
||||
ImageUtils.loadImageView(item.base_image, iv_gift_pic)
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(
|
||||
tv_wheat_qd,
|
||||
ColorManager.getInstance().primaryColorInt,
|
||||
53
|
||||
)
|
||||
tv_wheat_qd.setTextColor(ColorManager.getInstance().buttonColorInt)
|
||||
|
||||
tv_wheat_qd.setOnClickListener {
|
||||
// 回调选中的值和位置
|
||||
onItemSelectedListener(item, position)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置选中的位置
|
||||
*/
|
||||
fun setSelectedPosition(position: Int) {
|
||||
if (position in 0 until itemCount && position != selectedPosition) {
|
||||
val previousPosition = selectedPosition
|
||||
selectedPosition = position
|
||||
|
||||
if (previousPosition != -1) {
|
||||
notifyItemChanged(previousPosition)
|
||||
}
|
||||
|
||||
notifyItemChanged(position)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前选中的位置
|
||||
*/
|
||||
fun getSelectedPosition(): Int = selectedPosition
|
||||
|
||||
/**
|
||||
* 获取当前选中的值
|
||||
*/
|
||||
fun getSelectedValue(): RoonGiftModel? {
|
||||
return if (selectedPosition in 0 until itemCount) {
|
||||
dataList[selectedPosition]
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,6 +110,8 @@ public class RoomSettingAdapter extends BaseQuickAdapter<RoomSettingBean, BaseVi
|
||||
return com.xscm.moduleutil.R.mipmap.icon_liang;
|
||||
case RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT:
|
||||
return com.xscm.moduleutil.R.mipmap.icon_sign_contract;
|
||||
case RoomSettingBean.QXRoomSettingTypeRoomTypePUBROOM:
|
||||
return com.xscm.moduleutil.R.mipmap.icon_liang;
|
||||
// 常用工具
|
||||
case RoomSettingBean.QXRoomSettingTypeRoomSubsidy:
|
||||
return com.xscm.moduleutil.R.mipmap.ic_subsidy;
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.xscm.modulemain.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel
|
||||
import com.xscm.moduleutil.utils.ImageUtils
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/5 9:36
|
||||
* 用途:
|
||||
*/
|
||||
class RoomWishGiftAdapter(private val dataList: List<RoonGiftModel>,
|
||||
private val onItemSelectedListener: (RoonGiftModel, Int) -> Unit
|
||||
) : RecyclerView.Adapter<RoomWishGiftAdapter.ViewHolder>() {
|
||||
|
||||
private var selectedPosition = -1 // 默认没有选中项
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_wish_gift, parent, false)
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val item = dataList[position]
|
||||
holder.bind(item, position)
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = dataList.size
|
||||
|
||||
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
private val iv_gift_pic: ImageView = itemView.findViewById(R.id.iv_gift_pic)
|
||||
private val tv_gift_name: TextView = itemView.findViewById(R.id.tv_gift_name)
|
||||
private val tv_gift_price: TextView = itemView.findViewById(R.id.tv_gift_price)
|
||||
private val cl_iv_down_on: ConstraintLayout = itemView.findViewById(R.id.cl_iv_down_on)
|
||||
private val iv_down_on: ImageView = itemView.findViewById(R.id.iv_down_on)
|
||||
|
||||
fun bind(item: RoonGiftModel, position: Int) {
|
||||
tv_gift_name.text = item.gift_name
|
||||
tv_gift_price.text = item.gift_price
|
||||
// viewHolder.item_layout.setTag(R.id.id_gift_tag, giftModel);
|
||||
|
||||
//加载礼物图片
|
||||
ImageUtils.loadImageView(item.getBase_image(), iv_gift_pic)
|
||||
|
||||
|
||||
// //设置选中后的样式
|
||||
// if (item.isSelected()) { //被选中
|
||||
// cl_iv_down_on.setBackgroundResource(com.xscm.moduleutil.R.mipmap.room_gift_bjx)
|
||||
// iv_down_on.setVisibility(View.GONE)
|
||||
// } else {
|
||||
// iv_down_on.setVisibility(View.GONE)
|
||||
// cl_iv_down_on.setBackgroundResource(0)
|
||||
// }
|
||||
|
||||
// 设置选中状态
|
||||
if (position == selectedPosition) {
|
||||
cl_iv_down_on.setBackgroundResource(com.xscm.moduleutil.R.mipmap.room_gift_bjx)
|
||||
} else {
|
||||
cl_iv_down_on.setBackgroundResource(0)
|
||||
}
|
||||
|
||||
// 设置点击事件
|
||||
itemView.setOnClickListener {
|
||||
// 如果点击的是已选中的项,不做处理
|
||||
if (position == selectedPosition) return@setOnClickListener
|
||||
|
||||
// 更新选中位置
|
||||
val previousPosition = selectedPosition
|
||||
selectedPosition = position
|
||||
|
||||
// 通知之前选中的项更新背景
|
||||
if (previousPosition != -1) {
|
||||
notifyItemChanged(previousPosition)
|
||||
}
|
||||
|
||||
// 通知当前选中的项更新背景
|
||||
notifyItemChanged(position)
|
||||
|
||||
// 回调选中的值和位置
|
||||
onItemSelectedListener(item, position)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置选中的位置
|
||||
*/
|
||||
fun setSelectedPosition(position: Int) {
|
||||
if (position in 0 until itemCount && position != selectedPosition) {
|
||||
val previousPosition = selectedPosition
|
||||
selectedPosition = position
|
||||
|
||||
if (previousPosition != -1) {
|
||||
notifyItemChanged(previousPosition)
|
||||
}
|
||||
|
||||
notifyItemChanged(position)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前选中的位置
|
||||
*/
|
||||
fun getSelectedPosition(): Int = selectedPosition
|
||||
|
||||
/**
|
||||
* 获取当前选中的值
|
||||
*/
|
||||
fun getSelectedValue(): RoonGiftModel? {
|
||||
return if (selectedPosition in 0 until itemCount) {
|
||||
dataList[selectedPosition]
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.xscm.modulemain.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils
|
||||
import com.xscm.moduleutil.utils.ColorManager
|
||||
import com.xscm.moduleutil.utils.ImageUtils
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/5 11:23
|
||||
* 用途:
|
||||
*/
|
||||
class SetupCustomGiftAdapter(private val dataList: List<RoonGiftModel>,
|
||||
private val onItemSelectedListener: (RoonGiftModel, Int) -> Unit
|
||||
) : RecyclerView.Adapter<SetupCustomGiftAdapter.ViewHolder>() {
|
||||
|
||||
private var selectedPosition = -1 // 默认没有选中项
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_setup_custom_gift, parent, false)
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val item = dataList[position]
|
||||
holder.bind(item, position)
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = dataList.size
|
||||
|
||||
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
private val iv_gift_pic: ImageView = itemView.findViewById(R.id.iv_gift_pic)
|
||||
private val tv_gift_name: TextView = itemView.findViewById(R.id.tv_gift_name)
|
||||
private val tv_gift_price: TextView = itemView.findViewById(R.id.tv_gift_price)
|
||||
private val tv_gift_desc: TextView = itemView.findViewById(R.id.tv_gift_desc)
|
||||
private val tv_wheat_sz: TextView = itemView.findViewById(R.id.tv_wheat_sz)
|
||||
|
||||
fun bind(item: RoonGiftModel, position: Int) {
|
||||
tv_gift_name.text = item.gift_name
|
||||
tv_gift_price.text = item.gift_price
|
||||
|
||||
//加载礼物图片
|
||||
ImageUtils.loadImageView(item.getBase_image(), iv_gift_pic)
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(
|
||||
tv_wheat_sz,
|
||||
ColorManager.getInstance().primaryColorInt,
|
||||
53
|
||||
)
|
||||
tv_wheat_sz.setTextColor(ColorManager.getInstance().buttonColorInt)
|
||||
|
||||
tv_wheat_sz.setOnClickListener {
|
||||
onItemSelectedListener(item, position)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置选中的位置
|
||||
*/
|
||||
fun setSelectedPosition(position: Int) {
|
||||
if (position in 0 until itemCount && position != selectedPosition) {
|
||||
val previousPosition = selectedPosition
|
||||
selectedPosition = position
|
||||
|
||||
if (previousPosition != -1) {
|
||||
notifyItemChanged(previousPosition)
|
||||
}
|
||||
|
||||
notifyItemChanged(position)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前选中的位置
|
||||
*/
|
||||
fun getSelectedPosition(): Int = selectedPosition
|
||||
|
||||
/**
|
||||
* 获取当前选中的值
|
||||
*/
|
||||
fun getSelectedValue(): RoonGiftModel? {
|
||||
return if (selectedPosition in 0 until itemCount) {
|
||||
dataList[selectedPosition]
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -160,6 +160,8 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
roomTypeChildren.add(new RoomSettingBean("互娱", "ic_jiaoy", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU, read, isSelected, false, false));
|
||||
// roomTypeChildren.add(new RoomSettingBean("练歌房", "ic_liang", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeLianG, read, isSelected, false, false));
|
||||
roomTypeChildren.add(new RoomSettingBean("签约", "sing_contract", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT, read, isSelected, false, false));
|
||||
roomTypeChildren.add(new RoomSettingBean("酒吧房", "rub_room", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypePUBROOM, read, isSelected, false, false));
|
||||
|
||||
roomTypeParent.setChildren(roomTypeChildren);
|
||||
parentList.add(roomTypeParent);
|
||||
|
||||
@@ -395,7 +397,10 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
// }
|
||||
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT) {
|
||||
queren("10");
|
||||
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
|
||||
}else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypePUBROOM) {
|
||||
queren("11");
|
||||
}
|
||||
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
|
||||
if (roomInfoResp != null) {
|
||||
ARouter.getInstance().build(ARouteConstants.CREATED_ROOM).withSerializable("roomInfoResp", roomInfoResp).navigation();
|
||||
} else {
|
||||
@@ -661,7 +666,9 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
(type.equals("7") ? "互娱" :
|
||||
(type.equals("9") ? "点唱" :
|
||||
(type.equals("-1") ? "练歌房" :
|
||||
(type.equals("10") ? "签约房" : "")
|
||||
(type.equals("10") ? "签约房" :
|
||||
(type.equals("11") ? "酒吧房" : "")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -718,6 +725,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy || type == RoomSettingBean.QXRoomSettingTypeRoomSetting ||
|
||||
type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy || type == RoomSettingBean.QXRoomSettingTypeRoomMyDress ||
|
||||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG || type == RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT ||
|
||||
type == RoomSettingBean.QXRoomSettingTypeRoomTypePUBROOM ||
|
||||
type == RoomSettingBean.QXRoomSettingTypeRoomClearMessage || type == QXRoomSettingTypeRoomOrderMic || type == RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen
|
||||
|| type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomBgImage || type == -1) {
|
||||
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.xscm.modulemain.dialog.barRoom
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import com.blankj.utilcode.util.ActivityUtils.startActivity
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.user.activity.RechargeActivity
|
||||
import com.xscm.modulemain.databinding.DialogAboutRoomBinding
|
||||
import com.xscm.modulemain.databinding.DialogFlirtatiousBinding
|
||||
import com.xscm.moduleutil.bean.WalletBean
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.utils.ColorManager
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/5 15:36
|
||||
* 用途:撩他提示框
|
||||
*/
|
||||
class FlirtatiousDialog(context: Context) :
|
||||
BaseDialog<DialogFlirtatiousBinding>(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
// 定义回调接口
|
||||
private var onConfirmCallback: ((String) -> Unit)? = null
|
||||
|
||||
// 设置回调接口的方法
|
||||
fun setOnConfirmListener(callback: (String) -> Unit): FlirtatiousDialog {
|
||||
onConfirmCallback = callback
|
||||
return this
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_flirtatious
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
setupWindow()
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(
|
||||
mBinding.tvConfirm,
|
||||
ColorManager.getInstance().primaryColorInt,
|
||||
53
|
||||
)
|
||||
mBinding.tvConfirm.setTextColor(ColorManager.getInstance().buttonColorInt)
|
||||
// 设置点击事件
|
||||
mBinding.ivClose.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
mBinding.tvConfirm.setOnClickListener {
|
||||
onConfirmCallback?.invoke("")
|
||||
dismiss()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
// 初始化数据,如果需要的话
|
||||
RetrofitClient.getInstance().wallet(object : BaseObserver<WalletBean>(){
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: WalletBean) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
val window = window ?: return
|
||||
window.setGravity(Gravity.CENTER)
|
||||
window.setLayout(
|
||||
(ScreenUtils.getScreenWidth() * 315f / 375).toInt(),
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
window.setBackgroundDrawableResource(android.R.color.transparent)
|
||||
|
||||
val params = window.attributes
|
||||
params.windowAnimations = com.xscm.moduleutil.R.style.BaseDialogStyleH
|
||||
window.attributes = params
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.xscm.modulemain.dialog.barRoom
|
||||
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.adapter.RoomGiftGivingAdapter
|
||||
import com.xscm.modulemain.databinding.DialogGiftGivingBinding
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/5 10:41
|
||||
* 用途:酒吧房赠送自定义礼物
|
||||
*/
|
||||
class GiftGivingDialog (context: Context, val roomId: String) :
|
||||
BaseDialog<DialogGiftGivingBinding>(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
var adapter: RoomGiftGivingAdapter? = null
|
||||
var time: MutableList<String> = mutableListOf()
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_gift_giving
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
setupWindow()
|
||||
|
||||
val layoutManager = GridLayoutManager(context, 4)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
|
||||
|
||||
override fun initData() {
|
||||
// TODO: 这里调用的事设置插队礼物接口
|
||||
RetrofitClient.getInstance().getGiftList(1,roomId,object : BaseObserver<MutableList<RoonGiftModel>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: MutableList<RoonGiftModel>) {
|
||||
if (t.isNotEmpty()) {
|
||||
adapter = RoomGiftGivingAdapter(t) { selectedValue, position ->
|
||||
// 处理选中事件
|
||||
LogUtils.e("选中了: $selectedValue, 位置: $position")
|
||||
}
|
||||
|
||||
// 设置GridLayoutManager,每行显示4个item
|
||||
val layoutManager =
|
||||
GridLayoutManager(context, 4)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
val window = window ?: return
|
||||
window.setGravity(Gravity.BOTTOM)
|
||||
window.setLayout(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
(ScreenUtils.getAppScreenHeight() * 348f / 812).toInt()
|
||||
)
|
||||
window.setBackgroundDrawableResource(android.R.color.transparent)
|
||||
|
||||
val params = window.attributes
|
||||
params.windowAnimations = com.xscm.moduleutil.R.style.BaseDialogStyleH
|
||||
window.attributes = params
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.xscm.modulemain.dialog.barRoom
|
||||
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.databinding.DialogPerformInputBinding
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils
|
||||
import com.xscm.moduleutil.utils.ColorManager
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/5 11:33
|
||||
* 用途:表演内容输入对话框
|
||||
*/
|
||||
class PerformInputDialog(context: Context) :
|
||||
BaseDialog<DialogPerformInputBinding>(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
// 定义回调接口
|
||||
private var onConfirmCallback: ((String) -> Unit)? = null
|
||||
|
||||
// 设置回调接口的方法
|
||||
fun setOnConfirmListener(callback: (String) -> Unit): PerformInputDialog {
|
||||
onConfirmCallback = callback
|
||||
return this
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_perform_input
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
setupWindow()
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(
|
||||
mBinding.tvConfirm,
|
||||
ColorManager.getInstance().primaryColorInt,
|
||||
53
|
||||
)
|
||||
mBinding.tvConfirm.setTextColor(ColorManager.getInstance().buttonColorInt)
|
||||
// 设置点击事件
|
||||
mBinding.ivClose.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
mBinding.tvCancel.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
mBinding.tvConfirm.setOnClickListener {
|
||||
val inputText = mBinding.etInput.text.toString().trim()
|
||||
onConfirmCallback?.invoke(inputText)
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
// 初始化数据,如果需要的话
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
val window = window ?: return
|
||||
window.setGravity(Gravity.CENTER)
|
||||
window.setLayout(
|
||||
(ScreenUtils.getScreenWidth() * 315f / 375).toInt(),
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
window.setBackgroundDrawableResource(android.R.color.transparent)
|
||||
|
||||
val params = window.attributes
|
||||
params.windowAnimations = com.xscm.moduleutil.R.style.BaseDialogStyleH
|
||||
window.attributes = params
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.xscm.modulemain.dialog.barRoom
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import com.blankj.utilcode.util.ActivityUtils.startActivity
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.user.activity.RechargeActivity
|
||||
import com.xscm.modulemain.databinding.DialogAboutRoomBinding
|
||||
import com.xscm.moduleutil.bean.WalletBean
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.utils.ColorManager
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/5 14:18
|
||||
* 用途:酒吧房约她弹框
|
||||
*/
|
||||
class RoomAboutDialog (context: Context) :
|
||||
BaseDialog<DialogAboutRoomBinding>(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
// 定义回调接口
|
||||
private var onConfirmCallback: ((String) -> Unit)? = null
|
||||
|
||||
// 设置回调接口的方法
|
||||
fun setOnConfirmListener(callback: (String) -> Unit): RoomAboutDialog {
|
||||
onConfirmCallback = callback
|
||||
return this
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_about_room
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
setupWindow()
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(
|
||||
mBinding.tvConfirm,
|
||||
ColorManager.getInstance().primaryColorInt,
|
||||
53
|
||||
)
|
||||
mBinding.tvConfirm.setTextColor(ColorManager.getInstance().buttonColorInt)
|
||||
// 设置点击事件
|
||||
mBinding.ivClose.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
mBinding.tvConfirm.setOnClickListener {
|
||||
onConfirmCallback?.invoke("")
|
||||
dismiss()
|
||||
}
|
||||
|
||||
mBinding.tvRecharge.setOnClickListener {
|
||||
//充值
|
||||
startActivity(Intent(context, RechargeActivity::class.java))
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
// 初始化数据,如果需要的话
|
||||
RetrofitClient.getInstance().wallet(object : BaseObserver<WalletBean>(){
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: WalletBean) {
|
||||
mBinding.tvBalance.text = t.coin ?: "0"
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
val window = window ?: return
|
||||
window.setGravity(Gravity.CENTER)
|
||||
window.setLayout(
|
||||
(ScreenUtils.getScreenWidth() * 315f / 375).toInt(),
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
window.setBackgroundDrawableResource(android.R.color.transparent)
|
||||
|
||||
val params = window.attributes
|
||||
params.windowAnimations = com.xscm.moduleutil.R.style.BaseDialogStyleH
|
||||
window.attributes = params
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.xscm.modulemain.dialog.barRoom
|
||||
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.hjq.toast.ToastUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.adapter.RoomTalentAdapter
|
||||
import com.xscm.modulemain.databinding.DialogRoomDurationBinding
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/4 18:57
|
||||
* 用途:酒吧房设置时长
|
||||
*/
|
||||
class RoomDurationDialog (context: Context, val roomId: String) :
|
||||
BaseDialog<DialogRoomDurationBinding>(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
var adapter: RoomTalentAdapter? = null
|
||||
var time: MutableList<String> = mutableListOf()
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_room_duration
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
setupWindow()
|
||||
mBinding.tvQx.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
mBinding.tvQd.setOnClickListener {
|
||||
if (adapter?.getSelectedValue()?.isEmpty() == true || adapter?.getSelectedValue()==null) {
|
||||
ToastUtils.show("请选择时间")
|
||||
} else {//确定
|
||||
// var messageEvent =
|
||||
// RoomInputEvent(SpUtil.getUserInfo().nickname + "选择了" + adapter?.getSelectedValue() + "时间")
|
||||
// (ActivityUtils.getTopActivity() as? RoomActivity)?.let { roomActivity ->
|
||||
// roomActivity.dialogMessage(messageEvent)
|
||||
// }
|
||||
dismiss()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
val layoutManager = GridLayoutManager(context, 3)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
|
||||
|
||||
override fun initData() {
|
||||
time= mutableListOf()
|
||||
time.clear()
|
||||
time.add("5分钟")
|
||||
time.add("10分钟")
|
||||
time.add("15分钟")
|
||||
time.add("20分钟")
|
||||
time.add("25分钟")
|
||||
time.add("30分钟")
|
||||
adapter = RoomTalentAdapter(time) { selectedValue, position ->
|
||||
// 处理选中事件
|
||||
LogUtils.e("选中了: $selectedValue, 位置: $position")
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
val window = window ?: return
|
||||
window.setGravity(Gravity.BOTTOM)
|
||||
window.setLayout(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
(ScreenUtils.getAppScreenHeight() * 348f / 812).toInt()
|
||||
)
|
||||
window.setBackgroundDrawableResource(android.R.color.transparent)
|
||||
|
||||
val params = window.attributes
|
||||
params.windowAnimations = com.xscm.moduleutil.R.style.BaseDialogStyleH
|
||||
window.attributes = params
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.xscm.modulemain.dialog.barRoom
|
||||
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.hjq.toast.ToastUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.adapter.RoomWishGiftAdapter
|
||||
import com.xscm.modulemain.adapter.SetupCustomGiftAdapter
|
||||
import com.xscm.modulemain.databinding.DialogSetupCustomGiftBinding
|
||||
import com.xscm.modulemain.databinding.DialogWishGiftBinding
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/5 11:13
|
||||
* 用途:酒吧房设置自定义礼物
|
||||
*/
|
||||
class SetupCustomGiftDialog(context: Context, val roomId: String) :
|
||||
BaseDialog<DialogSetupCustomGiftBinding>(
|
||||
context,
|
||||
com.xscm.moduleutil.R.style.BaseDialogStyleH
|
||||
) {
|
||||
|
||||
var adapter: SetupCustomGiftAdapter? = null
|
||||
var time: MutableList<String> = mutableListOf()
|
||||
|
||||
var performInputDialog: PerformInputDialog? = null
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_setup_custom_gift
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
setupWindow()
|
||||
|
||||
val layoutManager = GridLayoutManager(context, 4)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
|
||||
|
||||
override fun initData() {
|
||||
// TODO: 这里调用的事设置插队礼物接口
|
||||
RetrofitClient.getInstance()
|
||||
.getGiftList(1, roomId, object : BaseObserver<MutableList<RoonGiftModel>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: MutableList<RoonGiftModel>) {
|
||||
if (t.isNotEmpty()) {
|
||||
adapter = SetupCustomGiftAdapter(t) { selectedValue, position ->
|
||||
// 处理选中事件
|
||||
LogUtils.e("选中了: $selectedValue, 位置: $position")
|
||||
if (performInputDialog == null) {
|
||||
performInputDialog = PerformInputDialog(context)
|
||||
}
|
||||
performInputDialog?.show()
|
||||
performInputDialog?.setOnConfirmListener { content ->
|
||||
// TODO: 这里表演内容的回调
|
||||
ToastUtils.show(content)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 设置GridLayoutManager,每行显示4个item
|
||||
val layoutManager =
|
||||
GridLayoutManager(context, 4)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
val window = window ?: return
|
||||
window.setGravity(Gravity.BOTTOM)
|
||||
window.setLayout(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
(ScreenUtils.getAppScreenHeight() * 348f / 812).toInt()
|
||||
)
|
||||
window.setBackgroundDrawableResource(android.R.color.transparent)
|
||||
|
||||
val params = window.attributes
|
||||
params.windowAnimations = com.xscm.moduleutil.R.style.BaseDialogStyleH
|
||||
window.attributes = params
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.xscm.modulemain.dialog.barRoom
|
||||
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.hjq.toast.ToastUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.adapter.RoomWishGiftAdapter
|
||||
import com.xscm.modulemain.databinding.DialogWishGiftBinding
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/5 9:14
|
||||
* 用途:酒吧房选择心愿礼物
|
||||
*/
|
||||
class WishGiftDialog(context: Context, val roomId: String) :
|
||||
BaseDialog<DialogWishGiftBinding>(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
var adapter: RoomWishGiftAdapter? = null
|
||||
var time: MutableList<String> = mutableListOf()
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_wish_gift
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
setupWindow()
|
||||
mBinding.tvQx.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
mBinding.tvQd.setOnClickListener {
|
||||
if ( adapter?.getSelectedValue()==null) {
|
||||
ToastUtils.show("请心愿礼物")
|
||||
} else {//确定
|
||||
// var messageEvent =
|
||||
// RoomInputEvent(SpUtil.getUserInfo().nickname + "选择了" + adapter?.getSelectedValue() + "时间")
|
||||
// (ActivityUtils.getTopActivity() as? RoomActivity)?.let { roomActivity ->
|
||||
// roomActivity.dialogMessage(messageEvent)
|
||||
// }
|
||||
dismiss()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
val layoutManager = GridLayoutManager(context, 4)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
|
||||
|
||||
override fun initData() {
|
||||
// TODO: 这里调用的事设置插队礼物接口
|
||||
RetrofitClient.getInstance().getGiftList(1,roomId,object : BaseObserver<MutableList<RoonGiftModel>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: MutableList<RoonGiftModel>) {
|
||||
if (t.isNotEmpty()) {
|
||||
adapter = RoomWishGiftAdapter(t) { selectedValue, position ->
|
||||
// 处理选中事件
|
||||
LogUtils.e("选中了: $selectedValue, 位置: $position")
|
||||
}
|
||||
|
||||
// 设置GridLayoutManager,每行显示4个item
|
||||
val layoutManager =
|
||||
GridLayoutManager(context, 4)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
val window = window ?: return
|
||||
window.setGravity(Gravity.BOTTOM)
|
||||
window.setLayout(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
(ScreenUtils.getAppScreenHeight() * 348f / 812).toInt()
|
||||
)
|
||||
window.setBackgroundDrawableResource(android.R.color.transparent)
|
||||
|
||||
val params = window.attributes
|
||||
params.windowAnimations = com.xscm.moduleutil.R.style.BaseDialogStyleH
|
||||
window.attributes = params
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user