콘텐츠 상세
- 한정판이 매진된 경우 구매버튼 비활성화 및 '해당 콘텐츠가 매진되었습니다.' 문구 표시
This commit is contained in:
parent
2dd5e2d96c
commit
6786988e63
|
@ -481,6 +481,7 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
|||
if (response.releaseDate != null) {
|
||||
binding.llPurchase.visibility = View.VISIBLE
|
||||
binding.llPurchasePrice.visibility = View.GONE
|
||||
binding.tvPurchaseSoldOut.visibility = View.GONE
|
||||
binding.tvReleaseDate.visibility = View.VISIBLE
|
||||
binding.llPurchase.background = ContextCompat.getDrawable(
|
||||
applicationContext,
|
||||
|
@ -494,34 +495,50 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
|||
response.orderType == null &&
|
||||
response.creator.creatorId != SharedPreferenceManager.userId
|
||||
) {
|
||||
binding.tvReleaseDate.visibility = View.GONE
|
||||
binding.llPurchase.visibility = View.VISIBLE
|
||||
binding.llPurchasePrice.visibility = View.VISIBLE
|
||||
binding.tvPrice.text = response.price.toString()
|
||||
binding.llPurchase.background = ContextCompat.getDrawable(
|
||||
applicationContext,
|
||||
R.drawable.bg_round_corner_5_3_3bb9f1
|
||||
)
|
||||
|
||||
binding.tvStrPurchaseOrRental.text = if (response.isOnlyRental) {
|
||||
" 대여하기"
|
||||
if (
|
||||
response.totalContentCount != null && response.remainingContentCount != null &&
|
||||
response.remainingContentCount <= response.totalContentCount
|
||||
) {
|
||||
binding.llPurchase.visibility = View.GONE
|
||||
binding.tvPurchaseSoldOut.visibility = View.VISIBLE
|
||||
} else {
|
||||
" 구매하기"
|
||||
}
|
||||
binding.tvPurchaseSoldOut.visibility = View.GONE
|
||||
binding.tvReleaseDate.visibility = View.GONE
|
||||
binding.llPurchase.visibility = View.VISIBLE
|
||||
binding.llPurchasePrice.visibility = View.VISIBLE
|
||||
binding.tvPrice.text = response.price.toString()
|
||||
binding.llPurchase.background = ContextCompat.getDrawable(
|
||||
applicationContext,
|
||||
R.drawable.bg_round_corner_5_3_3bb9f1
|
||||
)
|
||||
|
||||
binding.llPurchase.setOnClickListener {
|
||||
if (response.totalContentCount != null && response.remainingContentCount != null) {
|
||||
showOrderConfirmDialog(
|
||||
audioContent = response,
|
||||
isOnlyRental = false,
|
||||
OrderType.KEEP
|
||||
)
|
||||
binding.tvStrPurchaseOrRental.text = if (response.isOnlyRental) {
|
||||
" 대여하기"
|
||||
} else {
|
||||
showOrderDialog(audioContent = response, isOnlyRental = response.isOnlyRental)
|
||||
" 구매하기"
|
||||
}
|
||||
|
||||
binding.llPurchase.setOnClickListener {
|
||||
if (
|
||||
response.totalContentCount != null &&
|
||||
response.remainingContentCount != null
|
||||
) {
|
||||
showOrderConfirmDialog(
|
||||
audioContent = response,
|
||||
isOnlyRental = false,
|
||||
OrderType.KEEP
|
||||
)
|
||||
} else {
|
||||
showOrderDialog(
|
||||
audioContent = response,
|
||||
isOnlyRental = response.isOnlyRental
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
binding.llPurchase.visibility = View.GONE
|
||||
binding.tvPurchaseSoldOut.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -477,6 +477,21 @@
|
|||
</RelativeLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_purchase_sold_out"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="13.3dp"
|
||||
android:layout_marginTop="18.3dp"
|
||||
android:background="@drawable/bg_round_corner_5_3_525252"
|
||||
android:fontFamily="@font/gmarket_sans_bold"
|
||||
android:gravity="center"
|
||||
android:paddingVertical="16dp"
|
||||
android:text="해당 콘텐츠가 매진되었습니다."
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13.3sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/ll_purchase"
|
||||
android:layout_width="match_parent"
|
||||
|
|
Loading…
Reference in New Issue