라이브

- 후원 메시지, 룰렛 결과 모든 유저에게 보이도록 수정
This commit is contained in:
klaus 2024-08-14 18:33:51 +09:00
parent 63193c82a1
commit 62abd3c900
6 changed files with 44 additions and 32 deletions

View File

@ -40,8 +40,8 @@ android {
applicationId "kr.co.vividnext.sodalive"
minSdk 23
targetSdk 33
versionCode 96
versionName "1.15.1"
versionCode 97
versionName "1.15.2"
}
buildTypes {

View File

@ -703,37 +703,35 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
View.GONE
}
if (
response.creatorId == SharedPreferenceManager.userId &&
SharedPreferenceManager.role == MemberRole.CREATOR.name
) {
binding.flDonationMessageList.visibility = View.VISIBLE
binding.flDonationMessageList.setOnClickListener {
LiveRoomDonationMessageDialog(
layoutInflater = LayoutInflater.from(this),
activity = this,
donationMessageListLiveData = donationMessageViewModel
.donationMessageListLiveData,
donationMessageCountLiveData = donationMessageViewModel
.donationMessageCountLiveData,
getDonationMessageList = {
donationMessageViewModel.getDonationMessageList(roomId = roomId)
},
deleteDonationMessage = {
binding.flDonationMessageList.setOnClickListener {
LiveRoomDonationMessageDialog(
layoutInflater = LayoutInflater.from(this),
creatorId = response.creatorId,
activity = this,
donationMessageListLiveData = donationMessageViewModel
.donationMessageListLiveData,
donationMessageCountLiveData = donationMessageViewModel
.donationMessageCountLiveData,
getDonationMessageList = {
donationMessageViewModel.getDonationMessageList(roomId = roomId)
},
deleteDonationMessage = {
if (
response.creatorId == SharedPreferenceManager.userId &&
SharedPreferenceManager.role == MemberRole.CREATOR.name
) {
donationMessageViewModel.deleteDonationMessage(
roomId = roomId,
uuid = it
)
},
copyMessage = {
val clipboard = getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
clipboard.setPrimaryClip(ClipData.newPlainText(it, it))
showToast("후원 히스토리가 복사되었습니다.")
}
).show()
}
} else {
binding.flDonationMessageList.visibility = View.GONE
},
copyMessage = {
val clipboard = getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
clipboard.setPrimaryClip(ClipData.newPlainText(it, it))
showToast("후원 히스토리가 복사되었습니다.")
}
).show()
}
speakerListAdapter.managerId = response.creatorId
@ -1258,6 +1256,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
agora.muteAllRemoteAudioStreams(isSpeakerMute)
}
@SuppressLint("SetTextI18n")
private fun inputChat() {
val nickname = viewModel.getUserNickname(SharedPreferenceManager.userId.toInt())
val profileUrl = viewModel.getUserProfileUrl(SharedPreferenceManager.userId.toInt())

View File

@ -7,9 +7,12 @@ import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import kr.co.vividnext.sodalive.R
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
import kr.co.vividnext.sodalive.databinding.ItemLiveRoomDonationMessageBinding
import kr.co.vividnext.sodalive.settings.notification.MemberRole
class LiveRoomDonationMessageAdapter(
private val creatorId: Long,
private val onClickDeleteMessage: (String) -> Unit,
private val copyMessage: (String) -> Unit
) : RecyclerView.Adapter<LiveRoomDonationMessageAdapter.ViewHolder>() {
@ -33,7 +36,16 @@ class LiveRoomDonationMessageAdapter(
binding.root.setBackgroundResource(R.drawable.bg_round_corner_5_3_ccc25264)
}
binding.tvDonationMessage.text = "\"${item.donationMessage}\""
binding.ivDelete.setOnClickListener { onClickDeleteMessage(item.uuid) }
if (
creatorId == SharedPreferenceManager.userId &&
SharedPreferenceManager.role == MemberRole.CREATOR.name
) {
binding.ivDelete.visibility = View.VISIBLE
binding.ivDelete.setOnClickListener { onClickDeleteMessage(item.uuid) }
} else {
binding.ivDelete.visibility = View.GONE
}
binding.root.setOnClickListener { copyMessage(item.donationMessage) }
}

View File

@ -19,6 +19,7 @@ import kr.co.vividnext.sodalive.extensions.moneyFormat
class LiveRoomDonationMessageDialog(
layoutInflater: LayoutInflater,
creatorId: Long,
private val activity: FragmentActivity,
private val donationMessageListLiveData: LiveData<List<LiveRoomDonationMessage>>,
private val donationMessageCountLiveData: LiveData<Int>,
@ -29,6 +30,7 @@ class LiveRoomDonationMessageDialog(
private val alertDialog: AlertDialog
private val dialogView = DialogLiveRoomDonationMessageBinding.inflate(layoutInflater)
private val adapter = LiveRoomDonationMessageAdapter(
creatorId = creatorId,
onClickDeleteMessage = { deleteDonationMessage(it) },
copyMessage = copyMessage
)

View File

@ -526,7 +526,6 @@
android:id="@+id/fl_speaker_mute"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginBottom="40dp"
android:background="@drawable/bg_round_corner_10_99525252"
android:padding="10dp">
@ -614,8 +613,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="13.3dp"
android:background="@drawable/bg_round_corner_10_99525252"
android:padding="10dp"
android:visibility="gone">
android:padding="10dp">
<ImageView
android:id="@+id/iv_donation_message_list"

View File

@ -13,6 +13,7 @@
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@drawable/ic_close_white"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />