콘텐츠 리스트

- 소장중 / 대여중 / Sold Out 표시
This commit is contained in:
klaus 2024-06-04 19:56:46 +09:00
parent 22825d1520
commit 40ff959289
3 changed files with 78 additions and 11 deletions

View File

@ -40,12 +40,25 @@ class AudioContentAdapter(
binding.tvLikeCount.text = item.likeCount.moneyFormat() binding.tvLikeCount.text = item.likeCount.moneyFormat()
binding.tvCommentCount.text = item.commentCount.moneyFormat() binding.tvCommentCount.text = item.commentCount.moneyFormat()
binding.tvPrice.visibility = View.GONE
binding.tvOwned.visibility = View.GONE
binding.tvRented.visibility = View.GONE
binding.tvSoldOut.visibility = View.GONE
binding.tvScheduledToOpen.visibility = if (item.isScheduledToOpen) { binding.tvScheduledToOpen.visibility = if (item.isScheduledToOpen) {
View.VISIBLE View.VISIBLE
} else { } else {
View.GONE View.GONE
} }
if (item.isOwned) {
binding.tvOwned.visibility = View.VISIBLE
} else if (item.isRented) {
binding.tvRented.visibility = View.VISIBLE
} else if (item.isSoldOut) {
binding.tvSoldOut.visibility = View.VISIBLE
} else {
binding.tvPrice.visibility = View.VISIBLE
if (item.price < 1) { if (item.price < 1) {
binding.tvPrice.text = "무료" binding.tvPrice.text = "무료"
binding.tvPrice.setCompoundDrawables(null, null, null, null) binding.tvPrice.setCompoundDrawables(null, null, null, null)
@ -58,6 +71,7 @@ class AudioContentAdapter(
0 0
) )
} }
}
binding.root.setOnClickListener { onClickItem(item.contentId) } binding.root.setOnClickListener { onClickItem(item.contentId) }
} }

View File

@ -81,7 +81,10 @@ data class GetAudioContentListItem(
@SerializedName("commentCount") val commentCount: Int, @SerializedName("commentCount") val commentCount: Int,
@SerializedName("isPin") val isPin: Boolean, @SerializedName("isPin") val isPin: Boolean,
@SerializedName("isAdult") val isAdult: Boolean, @SerializedName("isAdult") val isAdult: Boolean,
@SerializedName("isScheduledToOpen") val isScheduledToOpen: Boolean @SerializedName("isScheduledToOpen") val isScheduledToOpen: Boolean,
@SerializedName("isRented") val isRented: Boolean,
@SerializedName("isOwned") val isOwned: Boolean,
@SerializedName("isSoldOut") val isSoldOut: Boolean
) )
data class GetCreatorActivitySummary( data class GetCreatorActivitySummary(

View File

@ -168,6 +168,56 @@
app:layout_constraintTop_toTopOf="@+id/iv_cover" app:layout_constraintTop_toTopOf="@+id/iv_cover"
tools:text="300" /> tools:text="300" />
<TextView
android:id="@+id/tv_owned"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_round_corner_2_6_b1ef2c"
android:fontFamily="@font/gmarket_sans_medium"
android:paddingHorizontal="5.3dp"
android:paddingVertical="2.7dp"
android:text="소장중"
android:textColor="@color/color_111111"
android:textSize="13.3sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/iv_cover"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/iv_cover"
tools:ignore="RelativeOverlap" />
<TextView
android:id="@+id/tv_rented"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_round_corner_2_6_660fd4"
android:fontFamily="@font/gmarket_sans_medium"
android:paddingHorizontal="5.3dp"
android:paddingVertical="2.7dp"
android:text="대여중"
android:textColor="@color/white"
android:textSize="13.3sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/iv_cover"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/iv_cover"
tools:ignore="RelativeOverlap" />
<TextView
android:id="@+id/tv_sold_out"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_round_corner_2_6_transparent_d2d2d2"
android:fontFamily="@font/gmarket_sans_medium"
android:paddingHorizontal="5.3dp"
android:paddingVertical="3.3dp"
android:text="Sold Out"
android:textColor="@color/color_d2d2d2"
android:textSize="12sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/iv_cover"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/iv_cover" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0.5dp" android:layout_height="0.5dp"