지금 라이브 중 - 참여 가능 인원 표시
This commit is contained in:
parent
012d1d94d5
commit
e02ea116ff
|
@ -4,6 +4,7 @@ import android.annotation.SuppressLint
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import coil.transform.CircleCropTransformation
|
||||
import coil.transform.RoundedCornersTransformation
|
||||
|
@ -23,6 +24,7 @@ class LiveNowAdapter(
|
|||
private val binding: ItemLiveNowBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
fun bind(item: GetRoomListResponse) {
|
||||
binding.ivCover.loadUrl(item.coverImageUrl) {
|
||||
crossfade(true)
|
||||
|
@ -65,6 +67,17 @@ class LiveNowAdapter(
|
|||
transformations(CircleCropTransformation())
|
||||
}
|
||||
|
||||
if (item.numberOfPeople > item.numberOfParticipate) {
|
||||
binding.tvRemainingParticipantNumber.visibility = View.VISIBLE
|
||||
binding.tvRemainingParticipant.text = "잔여"
|
||||
binding.tvRemainingParticipantNumber.text =
|
||||
"${item.numberOfPeople - item.numberOfParticipate}"
|
||||
} else {
|
||||
binding.tvRemainingParticipantNumber.visibility = View.GONE
|
||||
binding.tvRemainingParticipant.text = "Sold out"
|
||||
binding.tvRemainingParticipantNumber.text = ""
|
||||
}
|
||||
|
||||
binding.root.setOnClickListener { onClick(item) }
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 824 B After Width: | Height: | Size: 621 B |
|
@ -0,0 +1,4 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/color_b3333333" />
|
||||
</shape>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/color_b3333333" />
|
||||
<corners android:radius="13.3dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/color_b3333333" />
|
||||
</shape>
|
|
@ -48,12 +48,49 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3.3dp"
|
||||
android:layout_marginEnd="3.3dp"
|
||||
android:background="@drawable/bg_circle_b3333333"
|
||||
android:contentDescription="@null"
|
||||
android:padding="2.7dp"
|
||||
android:src="@drawable/ic_lock"
|
||||
android:visibility="visible"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="3.3dp"
|
||||
android:layout_marginBottom="11dp"
|
||||
android:background="@drawable/bg_round_corner_13_3_b3333333"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:paddingVertical="3dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tv_title"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_remaining_participant"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:textColor="@color/color_eeeeee"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="SmallSp"
|
||||
tools:text="잔여" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_remaining_participant_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:textColor="@color/color_3bb9f1"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="SmallSp"
|
||||
tools:text="3" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="0dp"
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="13.3dp"
|
||||
android:layout_marginEnd="13.3dp"
|
||||
android:background="@drawable/bg_circle_b3333333"
|
||||
android:contentDescription="@null"
|
||||
android:padding="2.7dp"
|
||||
android:src="@drawable/ic_lock"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -64,7 +64,9 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="13.3dp"
|
||||
android:background="@drawable/bg_circle_b3333333"
|
||||
android:contentDescription="@null"
|
||||
android:padding="2.7dp"
|
||||
android:src="@drawable/ic_lock"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -83,7 +83,9 @@
|
|||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="13.3dp"
|
||||
android:layout_marginEnd="13.3dp"
|
||||
android:background="@drawable/bg_circle_b3333333"
|
||||
android:contentDescription="@null"
|
||||
android:padding="2.7dp"
|
||||
android:src="@drawable/ic_lock"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
|
Loading…
Reference in New Issue