parent
04569f1e7e
commit
0e70ed2661
|
@ -3,8 +3,9 @@ package kr.co.vividnext.sodalive.audio_content.main.v2
|
|||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.MultiTransformation
|
||||
|
@ -16,6 +17,7 @@ import kr.co.vividnext.sodalive.R
|
|||
import kr.co.vividnext.sodalive.audio_content.main.GetAudioContentRankingItem
|
||||
import kr.co.vividnext.sodalive.databinding.ItemAudioContentMainTabPopularContentBinding
|
||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||
import kr.co.vividnext.sodalive.extensions.moneyFormat
|
||||
|
||||
class PopularContentByCreatorAdapter(
|
||||
private val itemWidth: Int,
|
||||
|
@ -31,7 +33,7 @@ class PopularContentByCreatorAdapter(
|
|||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
|
||||
fun bind(item: GetAudioContentRankingItem) {
|
||||
val lp = binding.ivCover.layoutParams as LinearLayout.LayoutParams
|
||||
val lp = binding.ivCover.layoutParams as ConstraintLayout.LayoutParams
|
||||
lp.width = itemWidth
|
||||
lp.height = itemWidth
|
||||
binding.ivCover.layoutParams = lp
|
||||
|
@ -64,6 +66,15 @@ class PopularContentByCreatorAdapter(
|
|||
binding.tvTitle.text = item.title
|
||||
binding.tvNickname.text = item.creatorNickname
|
||||
|
||||
if (item.price > 0) {
|
||||
binding.ivCan.visibility = View.VISIBLE
|
||||
binding.tvCan.text = item.price.moneyFormat()
|
||||
} else {
|
||||
binding.ivCan.visibility = View.GONE
|
||||
binding.tvCan.text = "무료"
|
||||
}
|
||||
|
||||
binding.tvTime.text = item.duration
|
||||
|
||||
binding.ivCover.setOnClickListener { onClickItem(item.contentId) }
|
||||
binding.ivCreator.setOnClickListener { onClickCreator(item.creatorId) }
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 588 B |
|
@ -1,21 +1,72 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
android:layout_gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@null"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@mipmap/ic_launcher" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2.7dp"
|
||||
android:layout_marginBottom="2.7dp"
|
||||
android:background="@drawable/bg_round_corner_10_b3333333"
|
||||
android:gravity="top"
|
||||
android:orientation="horizontal"
|
||||
android:padding="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_cover"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_cover">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_can"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_card_can_gray_32" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_can"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:gravity="bottom"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="SmallSp"
|
||||
tools:text="100000" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="2.7dp"
|
||||
android:layout_marginBottom="2.7dp"
|
||||
android:background="@drawable/bg_round_corner_10_b3333333"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:gravity="center"
|
||||
android:padding="4dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_cover"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_cover"
|
||||
tools:ignore="SmallSp"
|
||||
tools:text="00:00:30" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:ellipsize="end"
|
||||
|
@ -23,14 +74,20 @@
|
|||
android:maxLines="1"
|
||||
android:textColor="@color/color_d2d2d2"
|
||||
android:textSize="13.3sp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_cover"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_cover"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_cover"
|
||||
tools:text="콘텐츠 제목" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_title"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
|
@ -53,4 +110,4 @@
|
|||
tools:ignore="SmallSp"
|
||||
tools:text="크리에이터 닉네임" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
Loading…
Reference in New Issue