parent
fba11ae4b9
commit
0bbb1e070c
|
@ -389,18 +389,6 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
|||
setupCommentArea(it)
|
||||
setupCreatorOtherContentListArea(it.creatorOtherContentList)
|
||||
setupSameThemeOtherContentList(it.sameThemeOtherContentList)
|
||||
|
||||
isAlertPreview = it.creator.creatorId != SharedPreferenceManager.userId &&
|
||||
!it.existOrdered &&
|
||||
it.price > 0
|
||||
|
||||
binding.ivPlayOrPause.setImageResource(
|
||||
if (isAlertPreview) {
|
||||
R.drawable.btn_audio_content_preview_play
|
||||
} else {
|
||||
R.drawable.btn_audio_content_play
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
viewModel.isContentPlayLoopLiveData.observe(this) {
|
||||
|
@ -547,9 +535,17 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
|||
.apply(RequestOptions().override((screenWidth - 13.3f.dpToPx()).toInt()))
|
||||
.into(binding.ivCover)
|
||||
|
||||
binding.ivPlayOrPause.visibility = View.GONE
|
||||
binding.tvTotalDuration.text = " / ${response.duration}"
|
||||
|
||||
isAlertPreview = response.creator.creatorId != SharedPreferenceManager.userId &&
|
||||
!response.existOrdered &&
|
||||
response.price > 0
|
||||
|
||||
if (
|
||||
response.releaseDate == null ||
|
||||
response.creator.creatorId == SharedPreferenceManager.userId
|
||||
response.releaseDate == null &&
|
||||
!isAlertPreview ||
|
||||
(isAlertPreview && response.isActivePreview)
|
||||
) {
|
||||
binding.ivPlayOrPause.visibility = View.VISIBLE
|
||||
binding.ivPlayOrPause.setOnClickListener {
|
||||
|
@ -575,11 +571,15 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
|||
}
|
||||
)
|
||||
}
|
||||
} else {
|
||||
binding.ivPlayOrPause.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.tvTotalDuration.text = " / ${response.duration}"
|
||||
binding.ivPlayOrPause.setImageResource(
|
||||
if (!isAlertPreview) {
|
||||
R.drawable.btn_audio_content_play
|
||||
} else {
|
||||
R.drawable.btn_audio_content_preview_play
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
|
|
|
@ -15,6 +15,7 @@ data class GetAudioContentDetailResponse(
|
|||
@SerializedName("price") val price: Int,
|
||||
@SerializedName("duration") val duration: String,
|
||||
@SerializedName("releaseDate") val releaseDate: String?,
|
||||
@SerializedName("isActivePreview") val isActivePreview: Boolean,
|
||||
@SerializedName("isAdult") val isAdult: Boolean,
|
||||
@SerializedName("isMosaic") val isMosaic: Boolean,
|
||||
@SerializedName("isOnlyRental") val isOnlyRental: Boolean,
|
||||
|
|
Loading…
Reference in New Issue