라이브 - 호스트는 리스너로 변경 버튼이 보이지 않도록 수정

This commit is contained in:
klaus 2024-03-14 22:57:04 +09:00
parent 4ed97d4600
commit f4626a7cd5
1 changed files with 14 additions and 16 deletions

View File

@ -1082,14 +1082,13 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
agora.muteLocalAudioStream(false) agora.muteLocalAudioStream(false)
agora.setClientRole(io.agora.rtc2.Constants.CLIENT_ROLE_AUDIENCE) agora.setClientRole(io.agora.rtc2.Constants.CLIENT_ROLE_AUDIENCE)
handler.postDelayed({ handler.postDelayed({
binding.tvChangeListener.visibility = View.GONE
binding.tvChangeListener.setOnClickListener { }
binding.ivMicrophoneMute.setImageResource(R.drawable.ic_mic_on) binding.ivMicrophoneMute.setImageResource(R.drawable.ic_mic_on)
binding.flMicrophoneMute.visibility = View.GONE binding.flMicrophoneMute.visibility = View.GONE
binding.ivNotiMicrophoneMute.visibility = View.GONE binding.ivNotiMicrophoneMute.visibility = View.GONE
speakerListAdapter.muteSpeakers.remove(SharedPreferenceManager.userId.toInt()) speakerListAdapter.muteSpeakers.remove(SharedPreferenceManager.userId.toInt())
}, 100) }, 100)
binding.tvChangeListener.visibility = View.GONE
binding.tvChangeListener.setOnClickListener { }
} }
private fun setBroadcaster() { private fun setBroadcaster() {
@ -1101,19 +1100,6 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
binding.flMicrophoneMute.visibility = View.VISIBLE binding.flMicrophoneMute.visibility = View.VISIBLE
binding.ivNotiMicrophoneMute.visibility = View.GONE binding.ivNotiMicrophoneMute.visibility = View.GONE
}, 100) }, 100)
binding.tvChangeListener.visibility = View.VISIBLE
binding.tvChangeListener.setOnClickListener {
handler.post {
viewModel.setListener(
roomId,
SharedPreferenceManager.userId
) {
setAudience()
viewModel.getRoomInfo(roomId)
}
}
}
} }
private fun changeListenerMessage(peerId: Long, isFromManager: Boolean = false) { private fun changeListenerMessage(peerId: Long, isFromManager: Boolean = false) {
@ -1700,6 +1686,18 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
showDialog(content = "스피커가 되었어요!") showDialog(content = "스피커가 되었어요!")
setBroadcaster() setBroadcaster()
viewModel.getRoomInfo(roomId) viewModel.getRoomInfo(roomId)
binding.tvChangeListener.visibility = View.VISIBLE
binding.tvChangeListener.setOnClickListener {
handler.post {
viewModel.setListener(
roomId,
SharedPreferenceManager.userId
) {
setAudience()
viewModel.getRoomInfo(roomId)
}
}
}
} }
} }
} }