parent
22825d1520
commit
40ff959289
|
@ -40,23 +40,37 @@ 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.price < 1) {
|
if (item.isOwned) {
|
||||||
binding.tvPrice.text = "무료"
|
binding.tvOwned.visibility = View.VISIBLE
|
||||||
binding.tvPrice.setCompoundDrawables(null, null, null, null)
|
} else if (item.isRented) {
|
||||||
|
binding.tvRented.visibility = View.VISIBLE
|
||||||
|
} else if (item.isSoldOut) {
|
||||||
|
binding.tvSoldOut.visibility = View.VISIBLE
|
||||||
} else {
|
} else {
|
||||||
binding.tvPrice.text = item.price.moneyFormat()
|
binding.tvPrice.visibility = View.VISIBLE
|
||||||
binding.tvPrice.setCompoundDrawablesWithIntrinsicBounds(
|
if (item.price < 1) {
|
||||||
R.drawable.ic_can,
|
binding.tvPrice.text = "무료"
|
||||||
0,
|
binding.tvPrice.setCompoundDrawables(null, null, null, null)
|
||||||
0,
|
} else {
|
||||||
0
|
binding.tvPrice.text = item.price.moneyFormat()
|
||||||
)
|
binding.tvPrice.setCompoundDrawablesWithIntrinsicBounds(
|
||||||
|
R.drawable.ic_can,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.root.setOnClickListener { onClickItem(item.contentId) }
|
binding.root.setOnClickListener { onClickItem(item.contentId) }
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue