라이브

- 후원 메시지, 룰렛 결과 모든 유저에게 보이도록 수정
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" applicationId "kr.co.vividnext.sodalive"
minSdk 23 minSdk 23
targetSdk 33 targetSdk 33
versionCode 96 versionCode 97
versionName "1.15.1" versionName "1.15.2"
} }
buildTypes { buildTypes {

View File

@ -703,14 +703,10 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
View.GONE View.GONE
} }
if (
response.creatorId == SharedPreferenceManager.userId &&
SharedPreferenceManager.role == MemberRole.CREATOR.name
) {
binding.flDonationMessageList.visibility = View.VISIBLE
binding.flDonationMessageList.setOnClickListener { binding.flDonationMessageList.setOnClickListener {
LiveRoomDonationMessageDialog( LiveRoomDonationMessageDialog(
layoutInflater = LayoutInflater.from(this), layoutInflater = LayoutInflater.from(this),
creatorId = response.creatorId,
activity = this, activity = this,
donationMessageListLiveData = donationMessageViewModel donationMessageListLiveData = donationMessageViewModel
.donationMessageListLiveData, .donationMessageListLiveData,
@ -720,10 +716,15 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
donationMessageViewModel.getDonationMessageList(roomId = roomId) donationMessageViewModel.getDonationMessageList(roomId = roomId)
}, },
deleteDonationMessage = { deleteDonationMessage = {
if (
response.creatorId == SharedPreferenceManager.userId &&
SharedPreferenceManager.role == MemberRole.CREATOR.name
) {
donationMessageViewModel.deleteDonationMessage( donationMessageViewModel.deleteDonationMessage(
roomId = roomId, roomId = roomId,
uuid = it uuid = it
) )
}
}, },
copyMessage = { copyMessage = {
val clipboard = getSystemService(CLIPBOARD_SERVICE) as ClipboardManager val clipboard = getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
@ -732,9 +733,6 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
} }
).show() ).show()
} }
} else {
binding.flDonationMessageList.visibility = View.GONE
}
speakerListAdapter.managerId = response.creatorId speakerListAdapter.managerId = response.creatorId
speakerListAdapter.updateList( speakerListAdapter.updateList(
@ -1258,6 +1256,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
agora.muteAllRemoteAudioStreams(isSpeakerMute) agora.muteAllRemoteAudioStreams(isSpeakerMute)
} }
@SuppressLint("SetTextI18n")
private fun inputChat() { private fun inputChat() {
val nickname = viewModel.getUserNickname(SharedPreferenceManager.userId.toInt()) val nickname = viewModel.getUserNickname(SharedPreferenceManager.userId.toInt())
val profileUrl = viewModel.getUserProfileUrl(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.DiffUtil
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import kr.co.vividnext.sodalive.R 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.databinding.ItemLiveRoomDonationMessageBinding
import kr.co.vividnext.sodalive.settings.notification.MemberRole
class LiveRoomDonationMessageAdapter( class LiveRoomDonationMessageAdapter(
private val creatorId: Long,
private val onClickDeleteMessage: (String) -> Unit, private val onClickDeleteMessage: (String) -> Unit,
private val copyMessage: (String) -> Unit private val copyMessage: (String) -> Unit
) : RecyclerView.Adapter<LiveRoomDonationMessageAdapter.ViewHolder>() { ) : RecyclerView.Adapter<LiveRoomDonationMessageAdapter.ViewHolder>() {
@ -33,7 +36,16 @@ class LiveRoomDonationMessageAdapter(
binding.root.setBackgroundResource(R.drawable.bg_round_corner_5_3_ccc25264) binding.root.setBackgroundResource(R.drawable.bg_round_corner_5_3_ccc25264)
} }
binding.tvDonationMessage.text = "\"${item.donationMessage}\"" binding.tvDonationMessage.text = "\"${item.donationMessage}\""
if (
creatorId == SharedPreferenceManager.userId &&
SharedPreferenceManager.role == MemberRole.CREATOR.name
) {
binding.ivDelete.visibility = View.VISIBLE
binding.ivDelete.setOnClickListener { onClickDeleteMessage(item.uuid) } binding.ivDelete.setOnClickListener { onClickDeleteMessage(item.uuid) }
} else {
binding.ivDelete.visibility = View.GONE
}
binding.root.setOnClickListener { copyMessage(item.donationMessage) } binding.root.setOnClickListener { copyMessage(item.donationMessage) }
} }

View File

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

View File

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

View File

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