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