小黑屋 填充数据。
This commit is contained in:
@@ -198,6 +198,7 @@ import java.util.stream.Collectors
|
||||
class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
RoomContacts.View, PermissionCallbacks, OnMessageReceivedListener,
|
||||
QXRedPacketManager.QXRedPacketManagerDelegate {
|
||||
|
||||
private var roomFragment: RoomFragment? = null
|
||||
|
||||
//房主信息
|
||||
@@ -1579,7 +1580,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}else if( msgType == EMMessageInfo.QXRoomMessageTypeFlirtatious){ //酒吧房撩ta推送的信息
|
||||
roomFragment?.handleRoomMessage(messageEvent)
|
||||
}else if (msgType == EMMessageInfo.QXRoomMessageTypeFlirtatiousRoom) {//酒吧房约她进入小黑屋
|
||||
|
||||
MvpPre?.postRoomInfo(messageEvent.text.room_id)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2888,6 +2889,23 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
}
|
||||
|
||||
fun setPrivateRoomShowBottom(){
|
||||
mBinding!!.rlPk.visibility =
|
||||
if (voive) View.GONE else View.GONE
|
||||
mBinding!!.rlMisc.visibility =
|
||||
if (voive) View.GONE else View.GONE
|
||||
mBinding!!.rlSett.visibility =
|
||||
if (voive) View.VISIBLE else View.GONE
|
||||
mBinding!!.rlGift.visibility =
|
||||
if (voive) View.VISIBLE else View.GONE
|
||||
mBinding!!.ivSoundEffects.visibility =
|
||||
if (voive) View.VISIBLE else View.GONE
|
||||
mBinding!!.ivWheatFeeding.visibility =
|
||||
if (voive) View.VISIBLE else View.GONE
|
||||
mBinding!!.clFirstCharge.visibility =
|
||||
if (voive) View.VISIBLE else View.GONE
|
||||
}
|
||||
|
||||
/** 进入小黑屋将所有的底部隐藏 */
|
||||
fun setviewyc(voive: Boolean) {
|
||||
mBinding!!.rlPk.visibility =
|
||||
@@ -3711,9 +3729,15 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
RoomType.BLACK_ROOM -> {
|
||||
changeBackground(com.xscm.moduleutil.R.mipmap.cabin_bj)
|
||||
setvisibTop(false)
|
||||
QXRoomSeatViewType.CABIN
|
||||
if ("11" == labelId){
|
||||
changeBackground(R.mipmap.icon_pri_bg)
|
||||
setvisibTop(false)
|
||||
QXRoomSeatViewType.PRIVATE
|
||||
}else{
|
||||
changeBackground(com.xscm.moduleutil.R.mipmap.cabin_bj)
|
||||
setvisibTop(false)
|
||||
QXRoomSeatViewType.CABIN
|
||||
}
|
||||
}
|
||||
|
||||
RoomType.JUKEBOX -> {
|
||||
|
||||
@@ -13,6 +13,8 @@ class PrivateContacts {
|
||||
|
||||
fun wallet(list:List<String>,walletBean: WalletBean?)
|
||||
|
||||
fun sendGiftResult(success:Boolean)
|
||||
|
||||
fun getGiftList(list: List<RoonGiftModel>)
|
||||
}
|
||||
|
||||
@@ -21,6 +23,10 @@ class PrivateContacts {
|
||||
|
||||
fun getGiftList(roomId: String)
|
||||
|
||||
fun sendGift(mRoomId:String,giftId: String,mUserId:String)
|
||||
|
||||
fun wallet(list:List<String>)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
|
||||
|
||||
boolean isSelfFirst = false;
|
||||
|
||||
// 判断当前用户是 user_id 还是 user_id1
|
||||
// 判断当前用户是 user_id 还是 user_id1
|
||||
if (cpUserBean != null) {
|
||||
if (currentUserId.equals(cpUserBean.getUser_id())) {
|
||||
// 当前用户是 user_id
|
||||
|
||||
@@ -126,7 +126,11 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
} else if (roomType == RoomType.MUTUAL_ENTERTAINMENT) {
|
||||
qxRoomSeatViewType = QXRoomSeatViewType.FRIEND;
|
||||
} else if (roomType == RoomType.BLACK_ROOM) {
|
||||
qxRoomSeatViewType = QXRoomSeatViewType.CABIN;
|
||||
if ("11".equals(labelId)){
|
||||
qxRoomSeatViewType = QXRoomSeatViewType.PRIVATE;
|
||||
}else {
|
||||
qxRoomSeatViewType = QXRoomSeatViewType.CABIN;
|
||||
}
|
||||
} else if (roomType == RoomType.JUKEBOX) {
|
||||
qxRoomSeatViewType = QXRoomSeatViewType.JUKEBOX;
|
||||
} else if (roomType == RoomType.SIGN_CONTRACT) {
|
||||
@@ -293,8 +297,14 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
break;
|
||||
}
|
||||
} else if (roomType == RoomType.BLACK_ROOM) {
|
||||
if (roomCabinFragment == currentFragment && roomCabinFragment.isAdded()) {
|
||||
roomCabinFragment.roomInfoUpdate(mRoomInfoResp);
|
||||
if (labelId.equals("11")){
|
||||
if (roomPrivateFragment == currentFragment && roomPrivateFragment.isAdded()) {
|
||||
roomPrivateFragment.roomInfoUpdate(mRoomInfoResp);
|
||||
}
|
||||
}else {
|
||||
if (roomCabinFragment == currentFragment && roomCabinFragment.isAdded()) {
|
||||
roomCabinFragment.roomInfoUpdate(mRoomInfoResp);
|
||||
}
|
||||
}
|
||||
} else if (roomType == RoomType.JUKEBOX) {
|
||||
if (roomJukeboxFragment == currentFragment && roomJukeboxFragment.isAdded()) {
|
||||
@@ -362,8 +372,11 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
|
||||
/// 小黑屋修改倒计时
|
||||
public void upCabinFragment(long time) {
|
||||
if (roomCabinFragment == currentFragment)
|
||||
if (roomCabinFragment == currentFragment) {
|
||||
roomCabinFragment.upCabinFragment(time);
|
||||
}else if (roomPrivateFragment == currentFragment){
|
||||
roomPrivateFragment.upCabinFragment(time);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadSubFragment(QXRoomSeatViewType qxRoomSeatViewType) {
|
||||
@@ -419,12 +432,20 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
};
|
||||
|
||||
} else if (roomType == RoomType.BLACK_ROOM) {
|
||||
if (roomCabinFragment == null)
|
||||
roomCabinFragment = RoomCabinFragment.newInstance(mRoomInfoResp);
|
||||
else roomCabinFragment.roomInfoUpdate(mRoomInfoResp);
|
||||
newFragment = roomCabinFragment;
|
||||
setviewyc();
|
||||
if ("11".equals(labelId)){
|
||||
if (roomPrivateFragment == null) {
|
||||
roomPrivateFragment = RoomPrivateFragment.Companion.newInstance(mRoomInfoResp);
|
||||
} else roomPrivateFragment.roomTypeSwitch(mRoomInfoResp);
|
||||
setPrivateRoomShowBottom();
|
||||
newFragment = roomPrivateFragment;
|
||||
}else {
|
||||
if (roomCabinFragment == null)
|
||||
roomCabinFragment = RoomCabinFragment.newInstance(mRoomInfoResp);
|
||||
else roomCabinFragment.roomInfoUpdate(mRoomInfoResp);
|
||||
|
||||
setviewyc();
|
||||
newFragment = roomCabinFragment;
|
||||
}
|
||||
} else if (roomType == RoomType.JUKEBOX) {
|
||||
if (roomJukeboxFragment == null)
|
||||
roomJukeboxFragment = RoomJukeboxFragment.newInstance(mRoomInfoResp);
|
||||
@@ -457,6 +478,12 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
setView();
|
||||
}
|
||||
|
||||
private void setPrivateRoomShowBottom() {
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).setPrivateRoomShowBottom();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void upHeight() {
|
||||
ConstraintLayout.LayoutParams params = new ConstraintLayout.LayoutParams(
|
||||
@@ -789,6 +816,8 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
public void handleMsgType1028(RoomMessageEvent messageEvent) {
|
||||
if (roomCabinFragment == currentFragment) {
|
||||
roomCabinFragment.handleMsgType1028(messageEvent);
|
||||
}else if (roomPrivateFragment == currentFragment){
|
||||
roomPrivateFragment.handleMsgType1028(messageEvent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +1,27 @@
|
||||
package com.xscm.modulemain.activity.room.fragment
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.res.Resources
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.os.CountDownTimer
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewGroup.LayoutParams
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.widget.ImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.blankj.utilcode.util.ActivityUtils
|
||||
import com.bumptech.glide.Glide
|
||||
import com.orhanobut.logger.Logger
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.room.contacts.PrivateContacts
|
||||
import com.xscm.modulemain.activity.room.presenter.PrivatePresenter
|
||||
import com.xscm.modulemain.databinding.FragmentRoomPrivateBinding
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel
|
||||
import com.xscm.moduleutil.bean.WalletBean
|
||||
import com.xscm.moduleutil.bean.room.RoomCpUserBean
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp
|
||||
import com.xscm.moduleutil.bean.room.RoomPitBean
|
||||
import com.xscm.moduleutil.bean.room.RoomUserBean
|
||||
import com.xscm.moduleutil.utils.ImageUtils
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import java.util.concurrent.TimeUnit
|
||||
@@ -53,8 +52,13 @@ class RoomPrivateFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
|
||||
private var giftList: MutableList<RoonGiftModel> = arrayListOf()
|
||||
|
||||
private var giftViewList:MutableList<ImageView> = arrayListOf()
|
||||
private var giftViewList: MutableList<ImageView> = arrayListOf()
|
||||
|
||||
private var mCountDownTimer: CountDownTimer? = null
|
||||
|
||||
private val cpUserBean: RoomCpUserBean? = mRoomInfoResp?.cp_user
|
||||
|
||||
private var currSendGiftImageView: ImageView? = null
|
||||
|
||||
override fun initData() {
|
||||
MvpPre?.getGiftList(mRoomId)
|
||||
@@ -71,42 +75,75 @@ class RoomPrivateFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
|
||||
giftViewList.forEach { it ->
|
||||
it.setOnClickListener {
|
||||
val showList = giftList.shuffled().take(1)
|
||||
for (i in 0 until showList.size) {
|
||||
val itemImage = it
|
||||
val price = showList[i].gift_price.toInt()
|
||||
// 根据价格设置不同的宽高
|
||||
val (width, height) = when {
|
||||
price > 500 -> Pair(64, 64)
|
||||
price > 100 -> Pair(52, 52)
|
||||
else -> Pair(40, 40)
|
||||
val sendGiftUserId =
|
||||
if (mUserInfo?.user_id!!.toString() == mBinding.rpwv1.pitBean.user_id) {
|
||||
mBinding.rpwv2.pitBean.user_id
|
||||
} else {
|
||||
mBinding.rpwv1.pitBean.user_id
|
||||
}
|
||||
// 设置布局参数(假设itemImage是ImageView)
|
||||
val layoutParams = itemImage.layoutParams
|
||||
layoutParams.width = width.dpToPx() // 需要实现dp转px的扩展函数
|
||||
layoutParams.height = height.dpToPx()
|
||||
itemImage.layoutParams = layoutParams
|
||||
|
||||
// 假设 padding 值(单位:dp)
|
||||
val paddingDp = 8
|
||||
val paddingPx = paddingDp.dpToPx() // 转换为 px
|
||||
// 设置 padding(左、上、右、下)
|
||||
itemImage.setPadding(paddingPx, paddingPx, paddingPx, paddingPx)
|
||||
|
||||
Glide.with(it)
|
||||
.load(showList[i].base_image)
|
||||
.into(it as ImageView)
|
||||
|
||||
}
|
||||
MvpPre.sendGift(mRoomId, it.tag.toString(), sendGiftUserId)
|
||||
it.visibility = View.INVISIBLE
|
||||
currSendGiftImageView = it as? ImageView
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mBinding?.tvHeartNum?.text = mRoomInfoResp?.room_info?.hot_value
|
||||
|
||||
mBinding?.tvBack?.setOnClickListener {
|
||||
//返回到上一个房间
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 定义两个 RoomPitBean 对象,分别用于显示在 roomMakeWheat1 和 roomMakeWheat2
|
||||
val selfBean = RoomPitBean() // 自己的 bean
|
||||
val otherBean = RoomPitBean() // 另一个用户的 bean
|
||||
|
||||
|
||||
// 判断当前用户是 user_id 还是 user_id1
|
||||
if (cpUserBean != null) {
|
||||
if (mUserInfo?.user_id.toString() == cpUserBean.user_id) {
|
||||
// 当前用户是 user_id
|
||||
selfBean.user_id = cpUserBean.user_id
|
||||
selfBean.user_code = cpUserBean.user_code
|
||||
selfBean.nickname = cpUserBean.nickname
|
||||
selfBean.avatar = cpUserBean.avatar
|
||||
selfBean.dress = cpUserBean.dress
|
||||
selfBean.pit_number = "000"
|
||||
|
||||
otherBean.user_id = cpUserBean.user_id1
|
||||
otherBean.user_code = cpUserBean.user_code1
|
||||
otherBean.nickname = cpUserBean.nickname1
|
||||
otherBean.avatar = cpUserBean.avatar1
|
||||
otherBean.dress = cpUserBean.dress1
|
||||
otherBean.pit_number = "000"
|
||||
} else if (mUserInfo?.user_id.toString() == cpUserBean.user_id1) {
|
||||
// 当前用户是 user_id1,则交换位置
|
||||
selfBean.user_id = cpUserBean.user_id1
|
||||
selfBean.user_code = cpUserBean.user_code1
|
||||
selfBean.nickname = cpUserBean.nickname1
|
||||
selfBean.avatar = cpUserBean.avatar1
|
||||
selfBean.dress = cpUserBean.dress1
|
||||
selfBean.pit_number = "000"
|
||||
|
||||
otherBean.user_id = cpUserBean.user_id
|
||||
otherBean.user_code = cpUserBean.user_code
|
||||
otherBean.nickname = cpUserBean.nickname
|
||||
otherBean.avatar = cpUserBean.avatar
|
||||
otherBean.dress = cpUserBean.dress
|
||||
otherBean.pit_number = "000"
|
||||
}
|
||||
mBinding?.rpwv1?.pitNumber = "000"
|
||||
mBinding?.rpwv1?.setData(selfBean)
|
||||
|
||||
mBinding?.rpwv2?.pitNumber = "000"
|
||||
mBinding?.rpwv2?.setData(otherBean)
|
||||
|
||||
countDownTime(cpUserBean.time_day.toLong())
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun roomInfoUpdate(roomInfoResp: RoomInfoResp) {
|
||||
@@ -124,10 +161,45 @@ class RoomPrivateFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
}
|
||||
|
||||
|
||||
fun handleMsgType1028(messageEvent: RoomMessageEvent) {
|
||||
mRoomInfoResp?.room_info?.hot_value = messageEvent.text.hot_value
|
||||
mBinding?.tvHeartNum?.text = mRoomInfoResp?.room_info?.hot_value
|
||||
}
|
||||
|
||||
|
||||
override fun wallet(list: List<String>, walletBean: WalletBean?) {
|
||||
|
||||
}
|
||||
|
||||
override fun sendGiftResult(success: Boolean) {
|
||||
// 随机选择一个礼物
|
||||
val showList = giftList.shuffled().take(1)
|
||||
val itemImage = currSendGiftImageView
|
||||
val price = showList[0].gift_price.toInt()
|
||||
// 根据价格设置不同的宽高
|
||||
val (width, height) = when {
|
||||
price > 500 -> Pair(64, 64)
|
||||
price > 100 -> Pair(52, 52)
|
||||
else -> Pair(40, 40)
|
||||
}
|
||||
// 设置布局参数(假设itemImage是ImageView)
|
||||
val layoutParams = itemImage?.layoutParams
|
||||
layoutParams?.width = width.dpToPx() // 需要实现dp转px的扩展函数
|
||||
layoutParams?.height = height.dpToPx()
|
||||
itemImage?.layoutParams = layoutParams
|
||||
|
||||
// 假设 padding 值(单位:dp)
|
||||
val paddingDp = 8
|
||||
val paddingPx = paddingDp.dpToPx() // 转换为 px
|
||||
// 设置 padding(左、上、右、下)
|
||||
itemImage?.setPadding(paddingPx, paddingPx, paddingPx, paddingPx)
|
||||
currSendGiftImageView?.tag = showList[0].gift_id
|
||||
Glide.with(itemImage!!)
|
||||
.load(showList[0].base_image)
|
||||
.into(itemImage)
|
||||
currSendGiftImageView?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun getGiftList(list: List<RoonGiftModel>) {
|
||||
if (giftList.isEmpty()) {
|
||||
giftList = list.toMutableList()
|
||||
@@ -136,6 +208,7 @@ class RoomPrivateFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
for (i in 0 until showList.size) {
|
||||
val itemImage = giftViewList[i]
|
||||
val price = showList[i].gift_price.toInt()
|
||||
itemImage.tag = showList[i].gift_id
|
||||
// 根据价格设置不同的宽高
|
||||
val (width, height) = when {
|
||||
price > 500 -> Pair(64, 64)
|
||||
@@ -157,11 +230,12 @@ class RoomPrivateFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
Glide.with(giftViewList[i])
|
||||
.load(showList[i].base_image)
|
||||
.into(giftViewList[i])
|
||||
Observable.timer(delay,TimeUnit.MILLISECONDS).observeOn(AndroidSchedulers.mainThread()).subscribe {
|
||||
startSmallFloatingAnimation(giftViewList[i]) // 延迟后执行动画
|
||||
}
|
||||
Observable.timer(delay, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread()).subscribe {
|
||||
startSmallFloatingAnimation(giftViewList[i]) // 延迟后执行动画
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
giftList.clear()
|
||||
giftList = list.toMutableList()
|
||||
}
|
||||
@@ -202,4 +276,91 @@ class RoomPrivateFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
return (this * Resources.getSystem().displayMetrics.density).toFloat()
|
||||
}
|
||||
|
||||
fun upCabinFragment(time: Long) {
|
||||
countDownTime(time)
|
||||
}
|
||||
|
||||
|
||||
// TODO: 2025/3/12 倒计时
|
||||
private fun countDownTime(time: Long) {
|
||||
try {
|
||||
if (time <= 0) {
|
||||
setTime(0)
|
||||
releaseCountDownTimer()
|
||||
return
|
||||
}
|
||||
releaseCountDownTimer()
|
||||
// 获取当前时间的毫秒值
|
||||
val currentTime = System.currentTimeMillis() / 1000L
|
||||
// 计算倒计时的总秒数
|
||||
val countDownTime = (time - currentTime)
|
||||
Logger.d("小黑屋", "countDownTime = $countDownTime")
|
||||
if (countDownTime <= 0) {
|
||||
setTime(0)
|
||||
releaseCountDownTimer()
|
||||
return
|
||||
}
|
||||
mCountDownTimer = object : CountDownTimer(countDownTime * 1000L, 1000L) {
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
val time1 = (millisUntilFinished / 1000).toInt()
|
||||
// pitBean.setCount_down(time1);
|
||||
setTime(time1)
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
setTime(0)
|
||||
}
|
||||
}
|
||||
mCountDownTimer?.start()
|
||||
} catch (e: Exception) {
|
||||
Logger.e("countDownTime", e)
|
||||
}
|
||||
}
|
||||
|
||||
private fun formatTime(totalSeconds: Int): String {
|
||||
val days = totalSeconds / (24 * 3600)
|
||||
var remaining = totalSeconds % (24 * 3600)
|
||||
|
||||
val hours = remaining / 3600
|
||||
remaining %= 3600
|
||||
|
||||
val minutes = remaining / 60
|
||||
val seconds = remaining % 60
|
||||
|
||||
val sb = StringBuilder()
|
||||
|
||||
if (days > 0) {
|
||||
sb.append(days).append("天")
|
||||
}
|
||||
|
||||
if (hours > 0 || days > 0) {
|
||||
sb.append(hours).append("小时")
|
||||
}
|
||||
|
||||
if (minutes > 0 || hours > 0 || days > 0) {
|
||||
sb.append(minutes).append("分")
|
||||
}
|
||||
|
||||
sb.append(seconds).append("秒")
|
||||
|
||||
return sb.toString()
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("DefaultLocale")
|
||||
fun setTime(time: Int) {
|
||||
if (time == 0) {
|
||||
mBinding.tvTopTime.text = "00:00:00"
|
||||
}
|
||||
val formattedTime = formatTime(time)
|
||||
mBinding.tvTopTime.text = "倒计时:$formattedTime"
|
||||
}
|
||||
|
||||
private fun releaseCountDownTimer() {
|
||||
if (mCountDownTimer != null) {
|
||||
mCountDownTimer?.cancel()
|
||||
mCountDownTimer = null
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import android.content.Context
|
||||
import com.xscm.modulemain.activity.room.contacts.MentorShipContacts
|
||||
import com.xscm.modulemain.activity.room.contacts.PrivateContacts
|
||||
import com.xscm.modulemain.activity.room.contacts.PubContacts
|
||||
import com.xscm.moduleutil.bean.RoomGiftData
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel
|
||||
import com.xscm.moduleutil.bean.WalletBean
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
@@ -28,6 +29,9 @@ class PrivatePresenter(context: Context, val view: PrivateContacts.View?) :
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
override fun getGiftList(roomId: String) {
|
||||
RetrofitClient.getInstance().getGiftList(5,roomId, object : BaseObserver<List<RoonGiftModel>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
@@ -44,6 +48,20 @@ class PrivatePresenter(context: Context, val view: PrivateContacts.View?) :
|
||||
})
|
||||
}
|
||||
|
||||
override fun sendGift(mRoomId:String,giftId: String,mUserId:String) {
|
||||
RetrofitClient.getInstance().roomGift(mRoomId,giftId,"1",mUserId,"1","","","",object : BaseObserver<RoomGiftData>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: RoomGiftData) {
|
||||
if (MvpRef == null) {
|
||||
MvpRef = WeakReference(view)
|
||||
}
|
||||
MvpRef.get()?.sendGiftResult(true)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
override fun wallet(list:List<String>) {
|
||||
RetrofitClient.getInstance().wallet(object : BaseObserver<WalletBean?>() {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_400"
|
||||
android:paddingTop="@dimen/dp_14"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingHorizontal="@dimen/dp_14">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
@@ -27,6 +28,13 @@
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.25" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guide_line_left_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.22" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guide_line_right"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -34,12 +42,19 @@
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.75" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guide_line_right_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.78" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guide_line_h_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.1" />
|
||||
app:layout_constraintGuide_percent="0.15" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
@@ -47,14 +62,14 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.2" />
|
||||
app:layout_constraintGuide_percent="0.26" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guide_line_h_midd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.38" />
|
||||
app:layout_constraintGuide_percent="0.435" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_back"
|
||||
@@ -83,20 +98,20 @@
|
||||
|
||||
<com.xscm.modulemain.widget.RoomPrivateWheatView
|
||||
android:id="@+id/rpwv_1"
|
||||
android:layout_width="@dimen/dp_85"
|
||||
android:layout_width="@dimen/dp_95"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintDimensionRatio="1:1.11"
|
||||
app:layout_constraintEnd_toEndOf="@id/guide_line_left"
|
||||
app:layout_constraintStart_toStartOf="@id/guide_line_left"
|
||||
app:layout_constraintEnd_toEndOf="@id/guide_line_left_2"
|
||||
app:layout_constraintStart_toStartOf="@id/guide_line_left_2"
|
||||
app:layout_constraintTop_toTopOf="@id/guide_line_h_2" />
|
||||
|
||||
<com.xscm.modulemain.widget.RoomPrivateWheatView
|
||||
android:id="@+id/rpwv_2"
|
||||
android:layout_width="@dimen/dp_85"
|
||||
android:layout_width="@dimen/dp_95"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintDimensionRatio="1:1.11"
|
||||
app:layout_constraintEnd_toEndOf="@id/guide_line_right"
|
||||
app:layout_constraintStart_toStartOf="@id/guide_line_right"
|
||||
app:layout_constraintEnd_toEndOf="@id/guide_line_right_2"
|
||||
app:layout_constraintStart_toStartOf="@id/guide_line_right_2"
|
||||
app:layout_constraintTop_toTopOf="@id/guide_line_h_2" />
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user