사용하지 않는 필드 제거

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

View File

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

View File

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

View File

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

View File

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