parent
be46893555
commit
0556d5a067
|
@ -433,7 +433,11 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
|||
}
|
||||
|
||||
private fun setupCommentArea(response: GetAudioContentDetailResponse) {
|
||||
if (response.isCommentAvailable) {
|
||||
if (
|
||||
response.isCommentAvailable &&
|
||||
response.contentUrl.isNotBlank() &&
|
||||
response.releaseDate == null
|
||||
) {
|
||||
binding.llDonation.visibility = View.VISIBLE
|
||||
binding.llComment.visibility = View.VISIBLE
|
||||
binding.tvCommentCount.text = "${response.commentCount}"
|
||||
|
@ -657,45 +661,54 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
|||
binding.tvTag.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.ivLike.setImageResource(
|
||||
if (response.isLike) {
|
||||
R.drawable.ic_audio_content_heart_pressed
|
||||
} else {
|
||||
R.drawable.ic_audio_content_heart_normal
|
||||
}
|
||||
)
|
||||
|
||||
binding.tvLike.text = "${response.likeCount}"
|
||||
binding.llLike.setOnClickListener {
|
||||
viewModel.likeContent(contentId = audioContentId) {
|
||||
val likeCount = binding.tvLike.text.toString().toInt()
|
||||
if (it) {
|
||||
binding.tvLike.text = "${likeCount + 1}"
|
||||
binding.ivLike.setImageResource(R.drawable.ic_audio_content_heart_pressed)
|
||||
if (response.contentUrl.isNotBlank() && response.releaseDate == null) {
|
||||
binding.svActionButtons.visibility = View.VISIBLE
|
||||
binding.llLike.visibility = View.VISIBLE
|
||||
binding.ivLike.setImageResource(
|
||||
if (response.isLike) {
|
||||
R.drawable.ic_audio_content_heart_pressed
|
||||
} else {
|
||||
binding.tvLike.text = if (likeCount - 1 < 0) {
|
||||
"0"
|
||||
R.drawable.ic_audio_content_heart_normal
|
||||
}
|
||||
)
|
||||
|
||||
binding.tvLike.text = "${response.likeCount}"
|
||||
binding.llLike.setOnClickListener {
|
||||
viewModel.likeContent(contentId = audioContentId) {
|
||||
val likeCount = binding.tvLike.text.toString().toInt()
|
||||
if (it) {
|
||||
binding.tvLike.text = "${likeCount + 1}"
|
||||
binding.ivLike.setImageResource(R.drawable.ic_audio_content_heart_pressed)
|
||||
} else {
|
||||
"${likeCount - 1}"
|
||||
binding.tvLike.text = if (likeCount - 1 < 0) {
|
||||
"0"
|
||||
} else {
|
||||
"${likeCount - 1}"
|
||||
}
|
||||
binding.ivLike.setImageResource(R.drawable.ic_audio_content_heart_normal)
|
||||
}
|
||||
binding.ivLike.setImageResource(R.drawable.ic_audio_content_heart_normal)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
binding.tvShare.setOnClickListener {
|
||||
viewModel.shareAudioContent(
|
||||
audioContentId = audioContentId,
|
||||
contentImage = response.coverImageUrl,
|
||||
contentTitle = "${response.title} - ${response.creator.nickname}"
|
||||
) {
|
||||
val intent = Intent(Intent.ACTION_SEND)
|
||||
intent.type = "text/plain"
|
||||
intent.putExtra(Intent.EXTRA_TEXT, it)
|
||||
binding.tvShare.visibility = View.VISIBLE
|
||||
binding.tvShare.setOnClickListener {
|
||||
viewModel.shareAudioContent(
|
||||
audioContentId = audioContentId,
|
||||
contentImage = response.coverImageUrl,
|
||||
contentTitle = "${response.title} - ${response.creator.nickname}"
|
||||
) {
|
||||
val intent = Intent(Intent.ACTION_SEND)
|
||||
intent.type = "text/plain"
|
||||
intent.putExtra(Intent.EXTRA_TEXT, it)
|
||||
|
||||
val shareIntent = Intent.createChooser(intent, "오디오콘텐츠 공유")
|
||||
startActivity(shareIntent)
|
||||
val shareIntent = Intent.createChooser(intent, "오디오콘텐츠 공유")
|
||||
startActivity(shareIntent)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
binding.svActionButtons.visibility = View.GONE
|
||||
binding.llLike.visibility = View.GONE
|
||||
binding.tvShare.visibility = View.GONE
|
||||
}
|
||||
|
||||
if (response.totalContentCount != null && response.remainingContentCount != null) {
|
||||
|
|
|
@ -295,6 +295,7 @@
|
|||
tools:text="매버릭 팔레트 (feat. J-DRAGON)" />
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/sv_action_buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="13.3dp">
|
||||
|
|
Loading…
Reference in New Issue