사용하지 않는 필드 제거

This commit is contained in:
klaus 2023-08-14 22:56:57 +09:00
parent 999f90ae80
commit 7e9bcb6c38
5 changed files with 30 additions and 46 deletions

View File

@ -106,7 +106,6 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
private var isMicrophoneMute = false private var isMicrophoneMute = false
private var isSpeaker = false private var isSpeaker = false
private var isSpeakerFold = false private var isSpeakerFold = false
private var isAvailableDonation = false
private val onBackPressedCallback = object : OnBackPressedCallback(true) { private val onBackPressedCallback = object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() { override fun handleOnBackPressed() {
@ -565,15 +564,8 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
placeholder(R.drawable.ic_logo) placeholder(R.drawable.ic_logo)
} }
isAvailableDonation = response.isAvailableDonation
binding.flDonation.visibility = if (response.isAvailableDonation) {
View.VISIBLE
} else {
View.GONE
}
if ( if (
response.managerId == SharedPreferenceManager.userId && response.creatorId == SharedPreferenceManager.userId &&
SharedPreferenceManager.role == MemberRole.CREATOR.name SharedPreferenceManager.role == MemberRole.CREATOR.name
) { ) {
binding.flDonationMessageList.visibility = View.VISIBLE binding.flDonationMessageList.visibility = View.VISIBLE
@ -605,10 +597,10 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
binding.flDonationMessageList.visibility = View.GONE binding.flDonationMessageList.visibility = View.GONE
} }
speakerListAdapter.managerId = response.managerId speakerListAdapter.managerId = response.creatorId
speakerListAdapter.updateList(response.speakerList) speakerListAdapter.updateList(response.speakerList)
if (response.managerId == SharedPreferenceManager.userId) { if (response.creatorId == SharedPreferenceManager.userId) {
binding.ivEdit.setOnClickListener { binding.ivEdit.setOnClickListener {
roomInfoEditDialog.setRoomInfo(response.title, response.notice) roomInfoEditDialog.setRoomInfo(response.title, response.notice)
roomInfoEditDialog.setCoverImageUrl(response.coverImageUrl) roomInfoEditDialog.setCoverImageUrl(response.coverImageUrl)
@ -676,41 +668,35 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
binding.tvParticipate.text = "${response.participantsCount}" binding.tvParticipate.text = "${response.participantsCount}"
setNoticeAndClickableUrl(binding.tvNotice, response.notice) setNoticeAndClickableUrl(binding.tvNotice, response.notice)
binding.tvCreatorNickname.text = response.managerNickname binding.tvCreatorNickname.text = response.creatorNickname
binding.ivCreatorProfile.load(response.managerProfileUrl) { binding.ivCreatorProfile.load(response.creatorProfileUrl) {
crossfade(true) crossfade(true)
placeholder(R.drawable.ic_logo) placeholder(R.drawable.ic_logo)
transformations(CircleCropTransformation()) transformations(CircleCropTransformation())
} }
binding.ivCreatorProfile.setOnClickListener { binding.ivCreatorProfile.setOnClickListener {
if (response.managerId != SharedPreferenceManager.userId) { if (response.creatorId != SharedPreferenceManager.userId) {
showLiveRoomUserProfileDialog(userId = response.managerId) showLiveRoomUserProfileDialog(userId = response.creatorId)
} }
} }
if (response.isAvailableDonation) { if (response.isFollowing) {
binding.ivCreatorFollow.visibility = View.VISIBLE binding.ivCreatorFollow.setImageResource(R.drawable.btn_following)
binding.ivCreatorFollow.setOnClickListener {
if (response.isFollowingManager) { viewModel.creatorUnFollow(
binding.ivCreatorFollow.setImageResource(R.drawable.btn_following) creatorId = response.creatorId,
binding.ivCreatorFollow.setOnClickListener { roomId = roomId
viewModel.creatorUnFollow( )
creatorId = response.managerId,
roomId = roomId
)
}
} else {
binding.ivCreatorFollow.setImageResource(R.drawable.btn_follow)
binding.ivCreatorFollow.setOnClickListener {
viewModel.creatorFollow(
creatorId = response.managerId,
roomId = roomId
)
}
} }
} else { } else {
binding.ivCreatorFollow.visibility = View.GONE binding.ivCreatorFollow.setImageResource(R.drawable.btn_follow)
binding.ivCreatorFollow.setOnClickListener {
viewModel.creatorFollow(
creatorId = response.creatorId,
roomId = roomId
)
}
} }
if (agora.rtmChannelIsNull()) { if (agora.rtmChannelIsNull()) {
@ -1190,7 +1176,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
} }
}, },
rtmChannelJoinSuccess = { rtmChannelJoinSuccess = {
if (userId == roomInfo.managerId) { if (userId == roomInfo.creatorId) {
setBroadcaster() setBroadcaster()
} else { } else {
setAudience() setAudience()

View File

@ -118,7 +118,7 @@ class LiveRoomViewModel(
} }
fun getManagerNickname(): String { fun getManagerNickname(): String {
return roomInfoResponse.managerNickname return roomInfoResponse.creatorNickname
} }
fun setSpeaker(roomId: Long, userId: Long, onSuccess: () -> Unit) { fun setSpeaker(roomId: Long, userId: Long, onSuccess: () -> Unit) {
@ -213,7 +213,7 @@ class LiveRoomViewModel(
} }
fun isEqualToHostId(memberId: Int): Boolean { fun isEqualToHostId(memberId: Int): Boolean {
return memberId == roomInfoResponse.managerId.toInt() return memberId == roomInfoResponse.creatorId.toInt()
} }
fun getMemberCan() { fun getMemberCan() {

View File

@ -10,17 +10,16 @@ data class GetRoomInfoResponse(
@SerializedName("channelName") val channelName: String, @SerializedName("channelName") val channelName: String,
@SerializedName("rtcToken") val rtcToken: String, @SerializedName("rtcToken") val rtcToken: String,
@SerializedName("rtmToken") val rtmToken: String, @SerializedName("rtmToken") val rtmToken: String,
@SerializedName("managerId") val managerId: Long, @SerializedName("creatorId") val creatorId: Long,
@SerializedName("managerNickname") val managerNickname: String, @SerializedName("creatorNickname") val creatorNickname: String,
@SerializedName("managerProfileUrl") val managerProfileUrl: String, @SerializedName("creatorProfileUrl") val creatorProfileUrl: String,
@SerializedName("isFollowingManager") val isFollowingManager: Boolean, @SerializedName("isFollowing") val isFollowing: Boolean,
@SerializedName("participantsCount") val participantsCount: Int, @SerializedName("participantsCount") val participantsCount: Int,
@SerializedName("totalAvailableParticipantsCount") val totalAvailableParticipantsCount: Int, @SerializedName("totalAvailableParticipantsCount") val totalAvailableParticipantsCount: Int,
@SerializedName("speakerList") val speakerList: List<LiveRoomMember>, @SerializedName("speakerList") val speakerList: List<LiveRoomMember>,
@SerializedName("listenerList") val listenerList: List<LiveRoomMember>, @SerializedName("listenerList") val listenerList: List<LiveRoomMember>,
@SerializedName("managerList") val managerList: List<LiveRoomMember>, @SerializedName("managerList") val managerList: List<LiveRoomMember>,
@SerializedName("donationRankingTop3UserIds") val donationRankingTop3UserIds: List<Long>, @SerializedName("donationRankingTop3UserIds") val donationRankingTop3UserIds: List<Long>,
@SerializedName("isAvailableDonation") val isAvailableDonation: Boolean = false,
@SerializedName("isPrivateRoom") val isPrivateRoom: Boolean, @SerializedName("isPrivateRoom") val isPrivateRoom: Boolean,
@SerializedName("password") val password: String? = null @SerializedName("password") val password: String? = null
) )

View File

@ -52,7 +52,7 @@ class LiveRoomProfileDialog(
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
private fun bindData() { private fun bindData() {
roomInfoLiveData.observe(activity) { roomInfoLiveData.observe(activity) {
adapter.managerId = it.managerId adapter.managerId = it.creatorId
adapter.totalUserCount = it.totalAvailableParticipantsCount adapter.totalUserCount = it.totalAvailableParticipantsCount
dialogView.tvParticipate.text = "${it.participantsCount}" dialogView.tvParticipate.text = "${it.participantsCount}"
dialogView.tvTotalPeoples.text = "/${it.totalAvailableParticipantsCount}" dialogView.tvTotalPeoples.text = "/${it.totalAvailableParticipantsCount}"

View File

@ -406,8 +406,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="13.3dp" android:layout_marginBottom="13.3dp"
android:background="@drawable/bg_round_corner_10_99525252" android:background="@drawable/bg_round_corner_10_99525252"
android:padding="11.7dp" android:padding="11.7dp">
android:visibility="visible">
<ImageView <ImageView
android:layout_width="26.7dp" android:layout_width="26.7dp"