签约房UI
This commit is contained in:
@@ -913,7 +913,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
override fun onSelfInfoUpdated(info: V2TIMUserFullInfo?) {}
|
||||
}
|
||||
|
||||
private fun setView(resp: RoomInfoResp?,isSwitchRoomType:Boolean = false) {
|
||||
private fun setView(resp: RoomInfoResp?, isSwitchRoomType: Boolean = false) {
|
||||
if (resp == null)
|
||||
return
|
||||
AppStateManager.getInstance().roomInfo = resp
|
||||
@@ -1048,7 +1048,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
fun getRoomInfoResp(): List<RoomPitBean>? {
|
||||
val roomPitBeans = mRoomInfoResp?.room_info?.pit_list.orEmpty().filter {
|
||||
it.user_id != null && it.user_id != "0" && it.user_id.isNotEmpty()&& it.user_id.toInt() != SpUtil.getUserId() && it.pit_number.toInt()<9
|
||||
it.user_id != null && it.user_id != "0" && it.user_id.isNotEmpty() && it.user_id.toInt() != SpUtil.getUserId() && it.pit_number.toInt() < 9
|
||||
}
|
||||
return roomPitBeans.ifEmpty { null }
|
||||
}
|
||||
@@ -1484,15 +1484,22 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeQXRoomMessageRedRemove) {
|
||||
qxRedPacketManager!!.removeRedPacket(messageEvent.text.redpacket_id)
|
||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSongerNum //房间点歌数量变化
|
||||
|| msgType ==EMMessageInfo.QXRoomMessageTypeSingerRoomCurrentSongDidChanged //点歌房当前歌曲发生变化
|
||||
||msgType == EMMessageInfo.QXRoomMessageTypeSingerRoomNextSongDidChanged) { //点歌房下一首歌曲发生变化
|
||||
|| msgType == EMMessageInfo.QXRoomMessageTypeSingerRoomCurrentSongDidChanged //点歌房当前歌曲发生变化
|
||||
|| msgType == EMMessageInfo.QXRoomMessageTypeSingerRoomNextSongDidChanged
|
||||
) { //点歌房下一首歌曲发生变化
|
||||
if (mRoomInfoResp != null && mRoomInfoResp!!.room_info != null) {
|
||||
roomFragment!!.handleRoomMessage(messageEvent)
|
||||
}
|
||||
}else if(msgType == EMMessageInfo.QXRoomMessageTypeCPText){
|
||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeCPText) {
|
||||
LogUtils.e("CPText", messageEvent.text.rights_icon)
|
||||
if(messageEvent.text.rights_icon.isNotEmpty()){
|
||||
QXGiftPlayerManager.getInstance(this).displayCPView(messageEvent.text.fromUserInfo.avatar,messageEvent.text.toUserInfo.avatar,messageEvent.text.fromUserInfo.nickname, messageEvent.text.toUserInfo.nickname,messageEvent.text.rights_icon)
|
||||
if (messageEvent.text.rights_icon.isNotEmpty()) {
|
||||
QXGiftPlayerManager.getInstance(this).displayCPView(
|
||||
messageEvent.text.fromUserInfo.avatar,
|
||||
messageEvent.text.toUserInfo.avatar,
|
||||
messageEvent.text.fromUserInfo.nickname,
|
||||
messageEvent.text.toUserInfo.nickname,
|
||||
messageEvent.text.rights_icon
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1769,7 +1776,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
mBinding!!.rlMore.visibility = View.GONE
|
||||
mBinding!!.rlMisc.visibility = View.GONE
|
||||
|
||||
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = getPitBean(messageEvent, 1)
|
||||
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] =
|
||||
getPitBean(messageEvent, 1)
|
||||
|
||||
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||
roomFragment!!.handleRoomMessage(messageEvent)
|
||||
@@ -1848,7 +1856,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
//TODO 下麦更换数据
|
||||
val labelId = mRoomInfoResp!!.room_info.label_id
|
||||
if ("1" == labelId) {
|
||||
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = RoomPitBean(pitNumber)
|
||||
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] =
|
||||
RoomPitBean(pitNumber)
|
||||
|
||||
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||
if (mRoomInfoResp!!.user_info.user_id == SpUtil.getUserId()) {
|
||||
@@ -1856,12 +1865,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RoomType.MUTUAL_ENTERTAINMENT -> {
|
||||
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = RoomPitBean(pitNumber)
|
||||
|
||||
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||
roomFragment!!.handleRoomMessage(messageEvent)
|
||||
}
|
||||
|
||||
else -> {
|
||||
roomFragment!!.updateSeatViewExchangedWithPitArray(mRoomInfoResp)
|
||||
}
|
||||
@@ -2532,8 +2543,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
mBinding!!.imVoive.setImageResource(com.xscm.moduleutil.R.mipmap.room_voice_kg)
|
||||
}
|
||||
AgoraManager.getInstance().muteSpeaker(voive)
|
||||
if(mRoomInfoResp?.pk_info != null) {
|
||||
if (!roomFragment?.singSongFragment?.pkMicIsOn!!){
|
||||
if (mRoomInfoResp?.pk_info != null) {
|
||||
if (!roomFragment?.singSongFragment?.pkMicIsOn!!) {
|
||||
AgoraManagerEx.getInstance().muteSpeaker(voive)
|
||||
}
|
||||
}
|
||||
@@ -2544,7 +2555,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
mRoomInfoResp?.room_info?.is_pk!!
|
||||
)
|
||||
|
||||
LogUtils.e("pk_info","id == R.id.rl_more ${mRoomInfoResp?.room_info?.is_pk!!}")
|
||||
LogUtils.e("pk_info", "id == R.id.rl_more ${mRoomInfoResp?.room_info?.is_pk!!}")
|
||||
fragment.show(supportFragmentManager, "RoomPkDialogFragment")
|
||||
addActiveDialogFragment(fragment) // 添加到管理列表
|
||||
} else if (id == R.id.rl_message) {
|
||||
@@ -3316,9 +3327,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
* @description: 初始化音频,初始的时候,当是在麦上,将用户设置为主持,在麦下,设置为观众, 默认关闭麦克风
|
||||
*/
|
||||
fun initializeAudio(isSwitchRoomType: Boolean) {
|
||||
if (isSwitchRoomType){
|
||||
if (isSwitchRoomType) {
|
||||
AgoraManager.getInstance().muteSpeaker(voive)
|
||||
}else{
|
||||
} else {
|
||||
if (mRoomUserBean!!.pit_number != 0) {
|
||||
AgoraManager.getInstance().ClientRole(true)
|
||||
AgoraManager.getInstance().muteLocalAudioStream(false)
|
||||
@@ -3767,7 +3778,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
this.mRoomInfoResp = resp
|
||||
|
||||
setView(resp,true)
|
||||
setView(resp, true)
|
||||
}
|
||||
|
||||
fun upHeight() {
|
||||
@@ -3847,6 +3858,17 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
QXRoomSeatViewType.JUKEBOX
|
||||
}
|
||||
|
||||
RoomType.SIGN_CONTRACT -> {
|
||||
if (mRoomInfoResp!!.room_info.room_background == null || mRoomInfoResp!!.room_info.room_background == "") {
|
||||
changeBackground(com.xscm.moduleutil.R.mipmap.jukebox_bj)
|
||||
} else {
|
||||
changeBackgroundColor(mRoomInfoResp!!.room_info.room_background)
|
||||
}
|
||||
|
||||
setvisibTop(true)
|
||||
QXRoomSeatViewType.SIGNCONTRACT
|
||||
}
|
||||
|
||||
null -> {
|
||||
LogUtils.e("@@@", "RoomType is null")
|
||||
QXRoomSeatViewType.NONE
|
||||
@@ -4400,10 +4422,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
}
|
||||
|
||||
private fun userPermissionChange(){
|
||||
if (getHostUser() < 4){
|
||||
private fun userPermissionChange() {
|
||||
if (getHostUser() < 4) {
|
||||
mBinding?.roomTop?.rl?.visibility = View.VISIBLE
|
||||
}else{
|
||||
} else {
|
||||
mBinding?.roomTop?.rl?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.xscm.modulemain.activity.room.contacts
|
||||
|
||||
import android.app.Activity
|
||||
import com.xscm.moduleutil.activity.IPresenter
|
||||
import com.xscm.moduleutil.activity.IView
|
||||
|
||||
class MentorShipContacts {
|
||||
|
||||
interface View : IView<Activity>{
|
||||
|
||||
}
|
||||
|
||||
interface Ipre : IPresenter{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,8 @@ import java.util.List;
|
||||
* @description:房间fragment
|
||||
*/
|
||||
public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBinding> implements RoomContacts.View {
|
||||
|
||||
|
||||
public static RoomFragment newInstance(RoomActivity roomActivity, RoomInfoResp resp) {
|
||||
Bundle args = new Bundle();
|
||||
RoomFragment fragment = new RoomFragment(roomActivity, resp);
|
||||
@@ -100,6 +102,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
|
||||
private RoomJukeboxFragment roomJukeboxFragment;//点唱房
|
||||
|
||||
private RoomMentorShipFragment mentorShipFragment;//签约
|
||||
public QXRoomSeatViewType qxRoomSeatViewType;
|
||||
|
||||
private void setRoomSeatViewType() {
|
||||
@@ -126,6 +129,8 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
qxRoomSeatViewType = QXRoomSeatViewType.CABIN;
|
||||
} else if (roomType == RoomType.JUKEBOX) {
|
||||
qxRoomSeatViewType = QXRoomSeatViewType.JUKEBOX;
|
||||
} else if (roomType == RoomType.SIGN_CONTRACT) {
|
||||
qxRoomSeatViewType = QXRoomSeatViewType.SIGNCONTRACT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,6 +305,10 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
if (roomJukeboxFragment != null && roomJukeboxFragment.isAdded()) {
|
||||
roomJukeboxFragment.roomInfoUpdate(mRoomInfoResp);
|
||||
}
|
||||
}else if (roomType == RoomType.SIGN_CONTRACT) {
|
||||
if (mentorShipFragment != null && mentorShipFragment.isAdded()) {
|
||||
mentorShipFragment.roomInfoUpdate(mRoomInfoResp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -419,6 +428,13 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
roomJukeboxFragment = RoomJukeboxFragment.newInstance(mRoomInfoResp);
|
||||
else roomJukeboxFragment.roomInfoUpdate(mRoomInfoResp);
|
||||
newFragment = roomJukeboxFragment;
|
||||
} else if (roomType == RoomType.SIGN_CONTRACT) {
|
||||
if(mentorShipFragment == null){
|
||||
mentorShipFragment = RoomMentorShipFragment.Companion.newInstance(mRoomInfoResp);
|
||||
}else{
|
||||
mentorShipFragment.roomInfoUpdate(mRoomInfoResp);
|
||||
}
|
||||
newFragment = mentorShipFragment;
|
||||
}
|
||||
|
||||
if (newFragment != null) {
|
||||
@@ -895,6 +911,10 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
if (roomJukeboxFragment != null) {
|
||||
handleJukeboxEvent(messageEvent);
|
||||
}
|
||||
case SIGNCONTRACT:
|
||||
if (mentorShipFragment != null) {
|
||||
handleMentorshipEvent(messageEvent);
|
||||
}
|
||||
|
||||
case CABIN:
|
||||
default:
|
||||
@@ -903,6 +923,10 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
}
|
||||
}
|
||||
|
||||
private void handleMentorshipEvent(RoomMessageEvent messageEvent) {
|
||||
|
||||
}
|
||||
|
||||
// TODO: 2025/11/17 点唱房
|
||||
private void handleJukeboxEvent(RoomMessageEvent messageEvent) {
|
||||
switch (messageEvent.getMsgType()) {
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.xscm.modulemain.activity.room.fragment
|
||||
|
||||
import com.blankj.utilcode.util.ActivityUtils
|
||||
import com.xscm.modulemain.R
|
||||
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.moduleutil.base.BaseMvpFragment
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp
|
||||
|
||||
/**
|
||||
* 签约房
|
||||
* 1234 5 9
|
||||
*/
|
||||
class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp) :
|
||||
BaseMvpFragment<MentorShipPresenter, FragmentMentorShipBinding>(), MentorShipContacts.View {
|
||||
|
||||
companion object {
|
||||
@Volatile
|
||||
private var INSTANCE: RoomMentorShipFragment? = null
|
||||
|
||||
fun newInstance(roomInfoResp: RoomInfoResp): RoomMentorShipFragment {
|
||||
return INSTANCE ?: synchronized(this) {
|
||||
INSTANCE ?: RoomMentorShipFragment(roomInfoResp).also { INSTANCE = it }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.fragment_mentor_ship
|
||||
}
|
||||
|
||||
override fun bindPresenter(): MentorShipPresenter {
|
||||
return MentorShipPresenter(ActivityUtils.getTopActivity(), this)
|
||||
}
|
||||
|
||||
|
||||
override fun initData() {
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
}
|
||||
|
||||
fun roomInfoUpdate(mRoomInfoResp: RoomInfoResp) {
|
||||
mRoomInfo = mRoomInfoResp
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.xscm.modulemain.activity.room.presenter
|
||||
|
||||
import android.content.Context
|
||||
import com.xscm.modulemain.activity.room.contacts.MentorShipContacts
|
||||
import com.xscm.moduleutil.presenter.BasePresenter
|
||||
|
||||
class MentorShipPresenter(context: Context, view: MentorShipContacts.View) :
|
||||
BasePresenter<MentorShipContacts.View>(view, context), MentorShipContacts.Ipre {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.xscm.modulemain.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.TypedArray
|
||||
import android.text.TextUtils
|
||||
import android.util.AttributeSet
|
||||
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) {
|
||||
|
||||
constructor(context: Context?, attrs: AttributeSet?) : this(context) {
|
||||
initPit(context, attrs)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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 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?) {
|
||||
var typedArray: TypedArray? = null
|
||||
try {
|
||||
typedArray = context!!.obtainStyledAttributes(
|
||||
attrs,
|
||||
com.xscm.moduleutil.R.styleable.RoomDefaultWheatView
|
||||
)
|
||||
pitNumber =
|
||||
typedArray.getString(com.xscm.moduleutil.R.styleable.RoomDefaultWheatView_room_wheat_number)
|
||||
} finally {
|
||||
typedArray?.recycle()
|
||||
}
|
||||
|
||||
mCharmView = findViewById(R.id.charm_view)
|
||||
mIvRipple = findViewById(R.id.iv_ripple)
|
||||
mIvFrame = findViewById(R.id.iv_frame)
|
||||
mIvShutup = findViewById(R.id.iv_shutup)
|
||||
mRiv = findViewById(R.id.riv)
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user