한정판 콘텐츠 상세

- 해당 콘텐츠를 업로드 한 크리에이터가 콘텐츠 구매자를 볼 수 있는 UI 추가
This commit is contained in:
klaus 2025-04-14 15:03:58 +09:00
parent dfb2c903a4
commit c5a173138c
6 changed files with 130 additions and 6 deletions

View File

@ -35,7 +35,7 @@ android {
applicationId "kr.co.vividnext.sodalive"
minSdk 23
targetSdk 34
versionCode 158
versionCode 159
versionName "1.34.0"
}

View File

@ -0,0 +1,56 @@
package kr.co.vividnext.sodalive.audio_content.detail
import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import coil.load
import coil.transform.CircleCropTransformation
import kr.co.vividnext.sodalive.R
import kr.co.vividnext.sodalive.databinding.ItemLiveRoomDetailUserBinding
class AudioContentBuyerAdapter : RecyclerView.Adapter<AudioContentBuyerAdapter.ViewHolder>() {
private val items = mutableListOf<ContentBuyer>()
inner class ViewHolder(
private val binding: ItemLiveRoomDetailUserBinding
) : RecyclerView.ViewHolder(binding.root) {
fun bind(item: ContentBuyer) {
binding.tvNickname.text = item.nickname
binding.ivProfile.load(item.profileImageUrl) {
crossfade(true)
placeholder(R.drawable.ic_place_holder)
transformations(CircleCropTransformation())
}
}
}
override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int
): ViewHolder {
return ViewHolder(
ItemLiveRoomDetailUserBinding.inflate(
LayoutInflater.from(parent.context),
parent,
false
)
)
}
override fun onBindViewHolder(
holder: ViewHolder,
position: Int
) {
holder.bind(items[position])
}
override fun getItemCount() = items.count()
@SuppressLint("NotifyDataSetChanged")
fun addItems(buyerList: List<ContentBuyer>) {
items.addAll(buyerList)
notifyDataSetChanged()
}
}

View File

@ -81,6 +81,7 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
private var title = ""
private lateinit var activityResultLauncher: ActivityResultLauncher<Intent>
private lateinit var contentBuyerAdapter: AudioContentBuyerAdapter
private lateinit var audioContent: GetAudioContentDetailResponse
private lateinit var orderType: OrderType
private lateinit var imm: InputMethodManager
@ -298,6 +299,36 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
dialog.show(screenWidth - 26.7f.dpToPx().toInt())
}
setupBuyerList()
}
private fun setupBuyerList() {
val recyclerView = binding.rvBuyer
contentBuyerAdapter = AudioContentBuyerAdapter()
recyclerView.layoutManager = LinearLayoutManager(
this,
LinearLayoutManager.HORIZONTAL,
false
)
recyclerView.addItemDecoration(object : RecyclerView.ItemDecoration() {
override fun getItemOffsets(
outRect: Rect,
view: View,
parent: RecyclerView,
state: RecyclerView.State
) {
super.getItemOffsets(outRect, view, parent, state)
outRect.top = 6.7f.dpToPx().toInt()
outRect.bottom = 6.7f.dpToPx().toInt()
outRect.left = 6.7f.dpToPx().toInt()
outRect.right = 6.7f.dpToPx().toInt()
}
})
recyclerView.adapter = contentBuyerAdapter
}
private fun donation(can: Int, message: String) {
@ -924,8 +955,16 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
binding.tvRemainingCount.text = "${response.remainingContentCount}"
}
if (response.buyerList.isNotEmpty()) {
binding.rvBuyer.visibility = View.VISIBLE
binding.tvBuyerTitle.visibility = View.VISIBLE
contentBuyerAdapter.addItems(response.buyerList)
}
} else {
binding.rlLimitedEdition.visibility = View.GONE
binding.rvBuyer.visibility = View.GONE
binding.tvBuyerTitle.visibility = View.GONE
}
}

View File

@ -41,7 +41,8 @@ data class GetAudioContentDetailResponse(
@SerializedName("isAvailablePin") val isAvailablePin: Boolean,
@SerializedName("creator") val creator: AudioContentCreator,
@SerializedName("previousContent") val previousContent: OtherContentResponse?,
@SerializedName("nextContent") val nextContent: OtherContentResponse?
@SerializedName("nextContent") val nextContent: OtherContentResponse?,
@SerializedName("buyerList") val buyerList: List<ContentBuyer>
)
@Keep
@ -60,3 +61,9 @@ data class AudioContentCreator(
@SerializedName("isFollow") var isFollow: Boolean,
@SerializedName("isNotify") var isNotify: Boolean
)
@Keep
data class ContentBuyer(
@SerializedName("nickname") val nickname: String,
@SerializedName("profileImageUrl") val profileImageUrl: String
)

View File

@ -534,6 +534,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:fontFamily="@font/gmarket_sans_medium"
android:text="한정판"
android:textColor="@color/color_3bb9f1"
@ -543,6 +544,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:orientation="horizontal"
tools:ignore="RelativeOverlap">
@ -589,10 +591,31 @@
</LinearLayout>
</RelativeLayout>
<TextView
android:id="@+id/tv_buyer_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="13.3dp"
android:layout_marginTop="13.3dp"
android:fontFamily="@font/gmarket_sans_bold"
android:text="구매자"
android:textColor="@color/color_eeeeee"
android:textSize="18.3sp"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_buyer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="13.3dp"
android:layout_marginTop="13.3dp"
android:visibility="gone" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="13.3dp">
android:layout_marginHorizontal="13.3dp"
android:layout_marginTop="13.3dp">
<LinearLayout
android:layout_width="match_parent"
@ -603,7 +626,7 @@
android:id="@+id/tv_tag"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="13.3dp"
android:layout_marginBottom="8dp"
android:textColor="@color/color_3bb9f1"
android:textSize="12sp"
android:visibility="gone"
@ -613,7 +636,6 @@
android:id="@+id/tv_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:fontFamily="@font/gmarket_sans_medium"
android:lineSpacingExtra="5dp"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"