签约上下麦
This commit is contained in:
@@ -1789,7 +1789,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
roomFragment?.handleRoomMessage(messageEvent)
|
||||
}
|
||||
|
||||
RoomType.SIGN_CONTRACT -> {
|
||||
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] =
|
||||
getPitBean(messageEvent, 1)
|
||||
roomFragment?.upRoomInfo(mRoomInfoResp)
|
||||
mBinding!!.rlMore.visibility = View.GONE
|
||||
mBinding!!.rlMisc.visibility = View.GONE
|
||||
roomFragment?.handleRoomMessage(messageEvent)
|
||||
}
|
||||
else -> {
|
||||
roomFragment!!.updateSeatViewExchangedWithPitArray(mRoomInfoResp)
|
||||
}
|
||||
@@ -1872,6 +1879,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||
roomFragment!!.handleRoomMessage(messageEvent)
|
||||
}
|
||||
RoomType.SIGN_CONTRACT -> {
|
||||
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = RoomPitBean(pitNumber)
|
||||
|
||||
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||
roomFragment!!.handleRoomMessage(messageEvent)
|
||||
}
|
||||
|
||||
else -> {
|
||||
roomFragment!!.updateSeatViewExchangedWithPitArray(mRoomInfoResp)
|
||||
|
||||
@@ -11,6 +11,10 @@ class MentorShipContacts {
|
||||
}
|
||||
|
||||
interface Ipre : IPresenter{
|
||||
fun applyPit(roomId:String,pitNumber:String)
|
||||
|
||||
fun setMutePit(roomId:String,pitNumber:String,isMute:String)
|
||||
|
||||
fun setLockPit(roomId:String,pitNumber:String,isLock:String)
|
||||
}
|
||||
}
|
||||
@@ -922,7 +922,21 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
}
|
||||
|
||||
private void handleMentorshipEvent(RoomMessageEvent messageEvent) {
|
||||
|
||||
mentorShipFragment.roomInfoUpdate(mRoomInfoResp);
|
||||
switch (messageEvent.getMsgType()) {
|
||||
case 1003:
|
||||
mentorShipFragment.event1003(messageEvent);
|
||||
break;
|
||||
case 1004:
|
||||
mentorShipFragment.event1004(messageEvent);
|
||||
break;
|
||||
case 1035:
|
||||
mentorShipFragment.event1035(messageEvent);
|
||||
break;
|
||||
case 1059:
|
||||
mentorShipFragment.event1039(messageEvent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: 2025/11/17 点唱房
|
||||
|
||||
@@ -1,18 +1,32 @@
|
||||
package com.xscm.modulemain.activity.room.fragment
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.PopupWindow
|
||||
import android.widget.Switch
|
||||
import android.widget.TextView
|
||||
import com.blankj.utilcode.util.ActivityUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.room.activity.RoomActivity
|
||||
import com.xscm.modulemain.activity.room.contacts.MentorShipContacts
|
||||
import com.xscm.modulemain.activity.room.presenter.MentorShipPresenter
|
||||
import com.xscm.modulemain.databinding.FragmentMentorShipBinding
|
||||
import com.xscm.modulemain.dialog.RoomOnlineDialogFragment
|
||||
import com.xscm.modulemain.dialog.RoomUserInfoFragment
|
||||
import com.xscm.modulemain.widget.RoomMentorShipWheatView
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp
|
||||
import com.xscm.moduleutil.bean.room.RoomPitBean
|
||||
import com.xscm.moduleutil.utils.ClickUtils
|
||||
|
||||
/**
|
||||
* 签约房
|
||||
* 1234 5 9
|
||||
*/
|
||||
class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp) :
|
||||
class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
||||
BaseMvpFragment<MentorShipPresenter, FragmentMentorShipBinding>(), MentorShipContacts.View {
|
||||
|
||||
companion object {
|
||||
@@ -24,9 +38,17 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp) :
|
||||
INSTANCE ?: RoomMentorShipFragment(roomInfoResp).also { INSTANCE = it }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private var viewList: MutableList<RoomMentorShipWheatView> = mutableListOf()
|
||||
private val indexList: MutableList<String> = mutableListOf("9", "1", "2", "3", "4", "5")
|
||||
private var popupWindow: PopupWindow? = null
|
||||
|
||||
private var pitBean: RoomPitBean? = null
|
||||
private var roomId: String = mRoomInfo?.room_info?.room_id!!
|
||||
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.fragment_mentor_ship
|
||||
}
|
||||
@@ -35,16 +57,217 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp) :
|
||||
return MentorShipPresenter(ActivityUtils.getTopActivity(), this)
|
||||
}
|
||||
|
||||
|
||||
override fun initData() {
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
initPopupWindow()
|
||||
|
||||
viewList.add(mBinding.rmsw1)
|
||||
viewList.add(mBinding.rmswMidd)
|
||||
viewList.add(mBinding.rmswLeft)
|
||||
viewList.add(mBinding.rmswRightLeft)
|
||||
viewList.add(mBinding.rmswRightMidd)
|
||||
viewList.add(mBinding.rmswRightRight)
|
||||
|
||||
for ((idx, view) in viewList.withIndex()) {
|
||||
if (mRoomInfo?.room_info?.pit_list!!.size > indexList[idx].toInt() - 1) {
|
||||
view.setRoomWheatNumber(indexList[idx])
|
||||
view.setData(mRoomInfo?.room_info?.pit_list!![indexList[idx].toInt() - 1])
|
||||
view.setOnClickListener { v ->
|
||||
if (ClickUtils.isFastDoubleClick(v)) {
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
if (!view.getUserId().equals("") && !view.getUserId().equals("0")) {
|
||||
RoomUserInfoFragment.show(
|
||||
mRoomInfo?.room_info?.room_id,
|
||||
view.getUserId(),
|
||||
view.pitNumber,
|
||||
getHostUser(),
|
||||
false,
|
||||
2,
|
||||
isNumberWhether(),
|
||||
childFragmentManager
|
||||
)
|
||||
} else {
|
||||
if (getHostUser() == 4) {
|
||||
MvpPre!!.applyPit(mRoomInfo?.room_info?.room_id!!, "")
|
||||
} else {
|
||||
when (indexList[idx]) {
|
||||
"9" -> {
|
||||
MvpPre.applyPit(mRoomInfo?.room_info?.room_id!!, "9")
|
||||
}
|
||||
|
||||
"2" -> {
|
||||
|
||||
}
|
||||
|
||||
"1", "3", "4", "5" -> {
|
||||
pitBean =
|
||||
mRoomInfo?.room_info?.pit_list!![indexList[idx].toInt() - 1]
|
||||
|
||||
showPopupMenu(view)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun roomInfoUpdate(mRoomInfoResp: RoomInfoResp) {
|
||||
mRoomInfo = mRoomInfoResp
|
||||
}
|
||||
|
||||
private fun setPitData() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
fun event1003(messageEvent: RoomMessageEvent) {
|
||||
val fromUserInfo = messageEvent.text.fromUserInfo ?: return
|
||||
|
||||
val pitNumber = messageEvent.text.pit_number
|
||||
val userId = fromUserInfo.user_id
|
||||
|
||||
if (indexList.contains(pitNumber)) {
|
||||
val viewPos = indexList.indexOf(pitNumber)
|
||||
viewList[viewPos].setData(mRoomInfo?.room_info?.pit_list!![pitNumber.toInt() - 1])
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun event1004(messageEvent: RoomMessageEvent) {
|
||||
val fromUserInfo = messageEvent.text.fromUserInfo ?: return
|
||||
|
||||
val pitNumber = messageEvent.text.pit_number
|
||||
val userId = fromUserInfo.user_id
|
||||
|
||||
if (indexList.contains(pitNumber)) {
|
||||
val viewPos = indexList.indexOf(pitNumber)
|
||||
viewList[viewPos].setData(mRoomInfo?.room_info?.pit_list!![pitNumber.toInt() - 1])
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun event1035(messageEvent: RoomMessageEvent) {
|
||||
|
||||
}
|
||||
|
||||
fun event1039(messageEvent: RoomMessageEvent) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private fun initPopupWindow() {
|
||||
// 加载弹出视图布局
|
||||
val popupView = LayoutInflater.from(context).inflate(R.layout.popup_menu, null, false)
|
||||
|
||||
// 创建 PopupWindow
|
||||
val displayMetrics = resources.displayMetrics
|
||||
// 设置固定宽高(单位是像素)
|
||||
val screenWidth = displayMetrics.widthPixels
|
||||
val screenHeight = displayMetrics.heightPixels
|
||||
|
||||
val popupWidth = (screenWidth * 0.25).toInt() // 屏幕宽度的 60%
|
||||
val popupHeight = (screenHeight * 0.13).toInt() // 屏幕高度的 40%
|
||||
|
||||
popupWindow = PopupWindow(popupView, popupWidth, popupHeight, true)
|
||||
|
||||
// 必须设置背景,否则布局会压缩
|
||||
popupWindow?.setBackgroundDrawable(resources.getDrawable(com.xscm.moduleutil.R.drawable.bg_r16_fff))
|
||||
|
||||
// 设置动画效果(可选)
|
||||
popupWindow?.animationStyle = com.xscm.moduleutil.R.style.PopupAnimation
|
||||
|
||||
// 设置点击外部区域时自动关闭
|
||||
popupWindow?.isOutsideTouchable = true
|
||||
popupWindow?.isFocusable = true
|
||||
|
||||
// 设置弹出视图中的点击事件
|
||||
setPopupMenuClickListener(popupView, null)
|
||||
}
|
||||
|
||||
private fun showPopupMenu(anchorView: View) {
|
||||
if (popupWindow != null && !popupWindow?.isShowing!!) {
|
||||
// 获取锚点视图的坐标
|
||||
val location = IntArray(2)
|
||||
anchorView.getLocationOnScreen(location)
|
||||
|
||||
// 设置弹出位置
|
||||
popupWindow?.showAtLocation(
|
||||
anchorView, Gravity.NO_GRAVITY,
|
||||
location[0], location[1] + anchorView.height
|
||||
)
|
||||
|
||||
popupWindow?.contentView?.let { setPopupMenuClickListener(it, anchorView) }
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("UseSwitchCompatOrMaterialCode")
|
||||
private fun setPopupMenuClickListener(popupView: View, view: View?) {
|
||||
val tvHugMic = popupView.findViewById<TextView>(R.id.tv_hug_mic)
|
||||
val switchCloseMic = popupView.findViewById<Switch>(R.id.sw_close_mic)
|
||||
val switchLockMic = popupView.findViewById<Switch>(R.id.sw_lock_mic)
|
||||
if (view != null) {
|
||||
switchCloseMic.isChecked = pitBean?.is_mute == 1 //是否禁麦
|
||||
switchLockMic.isChecked = pitBean?.is_lock == 1 //是否闭麦
|
||||
}
|
||||
switchCloseMic.setOnCheckedChangeListener { compoundButton, b ->
|
||||
MvpPre.setMutePit(
|
||||
roomId,
|
||||
pitBean?.pit_number!!,
|
||||
if (b) "2" else "4"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
switchLockMic.setOnCheckedChangeListener { compoundButton, b ->
|
||||
MvpPre.setLockPit(
|
||||
roomId,
|
||||
pitBean?.pit_number!!,
|
||||
if (b) "1" else "0"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
tvHugMic.setOnClickListener { v: View? ->
|
||||
// 处理抱麦逻辑
|
||||
RoomOnlineDialogFragment.show(
|
||||
roomId, pitBean?.pit_number, mRoomInfo?.user_info, mRoomInfo,
|
||||
childFragmentManager
|
||||
)
|
||||
popupWindow!!.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun getHostUser(): Int {
|
||||
return if (mRoomInfo?.user_info?.is_room_owner == 1) {
|
||||
1
|
||||
} else if (mRoomInfo?.user_info?.is_management == 1) {
|
||||
2
|
||||
} else if (mRoomInfo?.user_info?.is_host == 1) {
|
||||
3
|
||||
} else {
|
||||
4
|
||||
}
|
||||
}
|
||||
|
||||
private fun isNumberWhether(): Int {
|
||||
if (mRoomInfo?.user_info?.pit_number == 9) {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
viewList.clear()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,53 @@
|
||||
package com.xscm.modulemain.activity.room.presenter
|
||||
|
||||
import android.content.Context
|
||||
import com.xscm.modulemain.activity.room.contacts.JukeboxContacts
|
||||
import com.xscm.modulemain.activity.room.contacts.MentorShipContacts
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.presenter.BasePresenter
|
||||
import io.reactivex.disposables.Disposable
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
class MentorShipPresenter(context: Context, view: MentorShipContacts.View) :
|
||||
|
||||
class MentorShipPresenter(context: Context, val view: MentorShipContacts.View) :
|
||||
BasePresenter<MentorShipContacts.View>(view, context), MentorShipContacts.Ipre {
|
||||
override fun applyPit(roomId: String, pitNumber: String) {
|
||||
RetrofitClient.getInstance().applyPit(roomId, pitNumber, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(s: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun setMutePit(roomId: String, pitNumber: String, isMute: String) {
|
||||
RetrofitClient.getInstance()
|
||||
.setMutePit(roomId, pitNumber, isMute, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(string: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun setLockPit(roomId: String, pitNumber: String, isLock: String) {
|
||||
RetrofitClient.getInstance()
|
||||
.setLockPit(roomId, pitNumber, isLock, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(string: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import com.xscm.moduleutil.presenter.BasePresenter
|
||||
import io.reactivex.disposables.Disposable
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
class HeartCpPresenter(view: HeartCpContact.View, context: Context) :
|
||||
class HeartCpPresenter(val view: HeartCpContact.View, context: Context) :
|
||||
BasePresenter<HeartCpContact.View>(view, context), HeartCpContact.IPre {
|
||||
override fun getHeartCpData(userId: Int) {
|
||||
api.getCpRoom(userId.toString(), object : BaseObserver<HeartCpBean>() {
|
||||
|
||||
@@ -4,89 +4,30 @@ import android.content.Context
|
||||
import android.content.res.TypedArray
|
||||
import android.text.TextUtils
|
||||
import android.util.AttributeSet
|
||||
import android.widget.ImageView
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.moduleutil.bean.room.RoomPitBean
|
||||
import com.xscm.moduleutil.utils.ImageUtils
|
||||
import com.xscm.moduleutil.widget.BaseWheatView
|
||||
|
||||
class RoomMentorShipWheatView(context: Context?) : BaseWheatView(context) {
|
||||
class RoomMentorShipWheatView : BaseWheatView {
|
||||
private var iv_tag_type: ImageView? = null
|
||||
|
||||
constructor(context: Context?, attrs: AttributeSet?) : this(context) {
|
||||
initPit(context, attrs)
|
||||
}
|
||||
constructor(context: Context?) : super(context)
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.layout_room_mentorship_wheat
|
||||
}
|
||||
|
||||
// 提供一个方法来设置这个属性,便于在代码中动态更改
|
||||
fun setRoomWheatNumber(number: String?) {
|
||||
this.pitNumber = number
|
||||
}
|
||||
|
||||
override fun setPitData(bean: RoomPitBean?) {
|
||||
if (bean == null) return
|
||||
|
||||
pitBean = bean // 统一使用参数 bean
|
||||
stopAndClearAnimation() // 清理之前的动画资源
|
||||
|
||||
if (isOn) {
|
||||
handleOnState(bean)
|
||||
} else {
|
||||
handleOffState(bean)
|
||||
}
|
||||
}
|
||||
|
||||
private fun stopAndClearAnimation() {
|
||||
if (mIvRipple != null) {
|
||||
mIvRipple.stopAnimation(true)
|
||||
}
|
||||
}
|
||||
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
|
||||
|
||||
|
||||
private fun handleOnState(bean: RoomPitBean) {
|
||||
mIvRipple.visibility = VISIBLE
|
||||
mTvName.visibility = VISIBLE
|
||||
mTvName.text = bean.nickname
|
||||
ImageUtils.loadHeadCC(bean.avatar, mRiv)
|
||||
mCharmView.visibility = VISIBLE
|
||||
if (TextUtils.isEmpty(bean.dress)) {
|
||||
mIvFrame.stopAll()
|
||||
mIvFrame.visibility = INVISIBLE
|
||||
} else {
|
||||
mIvFrame.visibility = VISIBLE
|
||||
mIvFrame.setSource(bean.dress, 3)
|
||||
}
|
||||
}
|
||||
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
private fun handleOffState(bean: RoomPitBean) {
|
||||
if (bean.pit_number == "9") {
|
||||
mTvName.visibility = GONE
|
||||
} else {
|
||||
mTvName.visibility = VISIBLE
|
||||
mTvName.setText(getPitNumberText())
|
||||
}
|
||||
mCharmView.visibility = GONE
|
||||
mRiv.visibility = VISIBLE
|
||||
mRiv.setImageResource(R.mipmap.jukebox_room_mask)
|
||||
mIvShutup.visibility = GONE
|
||||
mIvFrame.stopAll()
|
||||
mIvFrame.visibility = GONE
|
||||
mIvRipple.visibility = GONE
|
||||
}
|
||||
|
||||
|
||||
private fun getPitNumberText(): String {
|
||||
if ("-1" == pitNumber) return ""
|
||||
if ("9" == pitNumber) return ""
|
||||
if ("10" == pitNumber) return "老板"
|
||||
return pitNumber + "号麦"
|
||||
}
|
||||
|
||||
override fun initPit(context: Context?, attrs: AttributeSet?) {
|
||||
override fun initPit(context: Context, attrs: AttributeSet) {
|
||||
var typedArray: TypedArray? = null
|
||||
try {
|
||||
typedArray = context!!.obtainStyledAttributes(
|
||||
typedArray = context.obtainStyledAttributes(
|
||||
attrs,
|
||||
com.xscm.moduleutil.R.styleable.RoomDefaultWheatView
|
||||
)
|
||||
@@ -101,26 +42,104 @@ class RoomMentorShipWheatView(context: Context?) : BaseWheatView(context) {
|
||||
mIvFrame = findViewById(R.id.iv_frame)
|
||||
mIvShutup = findViewById(R.id.iv_shutup)
|
||||
mRiv = findViewById(R.id.riv)
|
||||
iv_tag_type = findViewById(R.id.iv_tag_type)
|
||||
}
|
||||
|
||||
override fun onRemoteSoundLevelUpdate(userId: String?, soundLevel: Int) {
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.layout_room_mentorship_wheat
|
||||
}
|
||||
|
||||
// 提供一个方法来设置这个属性,便于在代码中动态更改
|
||||
fun setRoomWheatNumber(number: String?) {
|
||||
this.pitNumber = number
|
||||
}
|
||||
|
||||
public override fun setPitData(bean: RoomPitBean) {
|
||||
pitBean = bean // 统一使用参数 bean
|
||||
stopAndClearAnimation() // 清理之前的动画资源
|
||||
|
||||
if (pitBean.pit_number == "9" || pitBean.pit_number == "1") {
|
||||
mCharmView.visibility = VISIBLE
|
||||
}else{
|
||||
mCharmView.visibility = INVISIBLE
|
||||
}
|
||||
|
||||
if (isOn) {
|
||||
handleOnState(bean)
|
||||
} else {
|
||||
handleOffState(bean)
|
||||
}
|
||||
|
||||
iv_tag_type!!.visibility = if (bean.isImageType) VISIBLE else GONE
|
||||
iv_tag_type!!.setImageResource(com.xscm.moduleutil.R.mipmap.mu_yc)
|
||||
}
|
||||
|
||||
fun setSex(value: String?, format: Boolean) {
|
||||
mCharmView.setSex("", "", value, format)
|
||||
}
|
||||
|
||||
fun setImageType(b: Boolean) {
|
||||
if (b) {
|
||||
iv_tag_type!!.visibility = VISIBLE
|
||||
} else iv_tag_type!!.visibility = GONE
|
||||
}
|
||||
|
||||
private fun handleOnState(bean: RoomPitBean) {
|
||||
mIvRipple.visibility = VISIBLE
|
||||
mTvName.visibility = VISIBLE
|
||||
mTvName.text = bean.nickname
|
||||
ImageUtils.loadHeadCC(bean.avatar, mRiv)
|
||||
mCharmView.visibility = VISIBLE
|
||||
|
||||
if (TextUtils.isEmpty(bean.dress)) {
|
||||
mIvFrame.stopAll()
|
||||
mIvFrame.visibility = INVISIBLE
|
||||
} else {
|
||||
mIvFrame.visibility = VISIBLE
|
||||
mIvFrame.setSource(bean.dress, 3)
|
||||
}
|
||||
}
|
||||
|
||||
private val pitNumberText: String
|
||||
get() {
|
||||
return "虚位以待"
|
||||
}
|
||||
|
||||
private fun handleOffState(bean: RoomPitBean) {
|
||||
mTvName.text = pitNumberText
|
||||
mCharmView.visibility = GONE
|
||||
mRiv.visibility = VISIBLE
|
||||
mRiv.setImageResource(com.xscm.moduleutil.R.mipmap.room_ic_wheat_default)
|
||||
mIvShutup.visibility = GONE
|
||||
iv_tag_type!!.visibility = GONE
|
||||
// ImageUtils.loadRes(com.xscm.moduleutil.R.mipmap.room_microphone_off, mIvShutup);
|
||||
mIvFrame.stopAll()
|
||||
mIvFrame.visibility = GONE
|
||||
mIvRipple.visibility = GONE
|
||||
}
|
||||
|
||||
private fun stopAndClearAnimation() {
|
||||
if (mIvRipple != null) {
|
||||
// mIvRipple.stopAnimation();
|
||||
mIvRipple.stopAnimation(true)
|
||||
// 清理SVGA资源,避免内存泄漏
|
||||
// mIvRipple.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onRemoteSoundLevelUpdate(userId: String, soundLevel: Int) {
|
||||
}
|
||||
|
||||
override fun onLocalSoundLevelUpdate(volume: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun userJoined(userId: Int, elapsd: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun userOffline(userId: Int, reason: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun pkOffSide(userId: Int) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
android:layout_width="@dimen/dp_36"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
app:layout_constraintDimensionRatio="1:1.4.4"
|
||||
app:layout_constraintDimensionRatio="1:1.4"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/gl_top" />
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/fly_bottom"
|
||||
app:layout_constraintDimensionRatio="1:1.4"
|
||||
app:layout_constraintDimensionRatio="1:1.2"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_left_bg"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_left_bg"
|
||||
app:layout_constraintTop_toTopOf="@id/fly_bottom" />
|
||||
@@ -220,46 +220,82 @@
|
||||
app:layout_constraintGuide_percent="0.86" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_right_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:src="@mipmap/icon_mentor_right_bg"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/fly_bottom_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.62" />
|
||||
<ImageView
|
||||
android:id="@+id/iv_right_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:src="@mipmap/icon_mentor_right_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
|
||||
<com.xscm.modulemain.widget.RoomMentorShipWheatView
|
||||
android:id="@+id/rmsw_right_left"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="@id/fly_bottom"
|
||||
app:layout_constraintDimensionRatio="1:1.4"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_right_bg"
|
||||
app:layout_constraintTop_toTopOf="@id/fly_bottom" />
|
||||
|
||||
<com.xscm.modulemain.widget.RoomMentorShipWheatView
|
||||
android:id="@+id/rmsw_right_midd"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/fly_bottom"
|
||||
app:layout_constraintDimensionRatio="1:1.4"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_right_bg"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_right_bg"
|
||||
app:layout_constraintTop_toTopOf="@id/fly_bottom" />
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_right_1"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_right_2"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_right_3"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<com.xscm.modulemain.widget.RoomMentorShipWheatView
|
||||
android:id="@+id/rmsw_right_left"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="@id/fly_bottom_2"
|
||||
app:layout_constraintDimensionRatio="1:1.2"
|
||||
app:layout_constraintEnd_toEndOf="@id/gl_right_1"
|
||||
app:layout_constraintStart_toStartOf="@id/gl_right_1"
|
||||
app:layout_constraintTop_toTopOf="@id/fly_bottom_2" />
|
||||
|
||||
<com.xscm.modulemain.widget.RoomMentorShipWheatView
|
||||
android:id="@+id/rmsw_right_midd"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/fly_bottom_2"
|
||||
app:layout_constraintDimensionRatio="1:1.2"
|
||||
app:layout_constraintEnd_toEndOf="@id/gl_right_2"
|
||||
app:layout_constraintStart_toStartOf="@id/gl_right_2"
|
||||
app:layout_constraintTop_toTopOf="@id/fly_bottom_2" />
|
||||
|
||||
<com.xscm.modulemain.widget.RoomMentorShipWheatView
|
||||
android:id="@+id/rmsw_right_right"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="@id/fly_bottom_2"
|
||||
app:layout_constraintDimensionRatio="1:1.2"
|
||||
app:layout_constraintEnd_toEndOf="@id/gl_right_3"
|
||||
app:layout_constraintStart_toStartOf="@id/gl_right_3"
|
||||
app:layout_constraintTop_toTopOf="@id/fly_bottom_2" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<com.xscm.modulemain.widget.RoomMentorShipWheatView
|
||||
android:id="@+id/rmsw_right_right"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="@id/fly_bottom"
|
||||
app:layout_constraintDimensionRatio="1:1.4"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_right_bg"
|
||||
app:layout_constraintStart_toStartOf="@id/rmsw_right_midd"
|
||||
app:layout_constraintTop_toTopOf="@id/fly_bottom" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -17,7 +17,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintDimensionRatio="1:1.4"
|
||||
app:layout_constraintDimensionRatio="0dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:clipChildren="false"
|
||||
@@ -116,7 +116,7 @@
|
||||
android:paddingLeft="@dimen/dp_5"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:singleLine="true"
|
||||
android:text="麦位1"
|
||||
android:text="虚位以待"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintBottom_toTopOf="@id/charm_view"
|
||||
@@ -133,7 +133,7 @@
|
||||
android:layout_height="@dimen/dp_12"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:visibility="invisible"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
@@ -148,6 +148,18 @@
|
||||
app:layout_constraintHeight_percent="0.2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/gl_center" />
|
||||
|
||||
<!-- 角色标签 - 头像下方覆盖部分头像 -->
|
||||
<ImageView
|
||||
android:id="@+id/iv_tag_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_13"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/mu_yc"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/riv"
|
||||
app:layout_constraintEnd_toEndOf="@id/riv"
|
||||
app:layout_constraintStart_toStartOf="@id/riv" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/dp_152"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxWidth="@dimen/dp_152"
|
||||
android:background="@drawable/bg_r16_fff"
|
||||
android:padding="@dimen/dp_12">
|
||||
android:padding="@dimen/dp_10"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_close_mic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="闭麦"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="@color/color_FF333333"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/sw_close_mic"
|
||||
@@ -27,44 +27,45 @@
|
||||
android:layout_alignParentEnd="true"
|
||||
android:background="@drawable/room_tuner_selector_switch"
|
||||
android:thumb="@android:color/transparent"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.005"
|
||||
tools:ignore="UseSwitchCompatOrMaterialXml"
|
||||
android:visibility="gone"/>
|
||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_lock_mic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="锁麦"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:paddingVertical="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_close_mic"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_close_mic" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/sw_lock_mic"
|
||||
android:layout_width="@dimen/dp_37"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/room_tuner_selector_switch"
|
||||
android:layout_marginVertical="@dimen/dp_10"
|
||||
android:thumb="@android:color/transparent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_lock_mic"
|
||||
app:layout_constraintVertical_bias="0.005"
|
||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hug_mic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="@dimen/dp_10"
|
||||
android:text="抱麦"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_21"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_lock_mic"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_lock_mic" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
Reference in New Issue
Block a user