크리에이터 채널 시리즈
- 이미지 사이즈 가로 102 -> 116.7, 세로 144 -> 165 변경
This commit is contained in:
@@ -46,6 +46,7 @@ import kr.co.vividnext.sodalive.explorer.profile.donation.UserProfileDonationAda
|
||||
import kr.co.vividnext.sodalive.explorer.profile.donation.UserProfileDonationAllViewActivity
|
||||
import kr.co.vividnext.sodalive.explorer.profile.fantalk.UserProfileFantalkAllViewActivity
|
||||
import kr.co.vividnext.sodalive.explorer.profile.follow.UserFollowerListActivity
|
||||
import kr.co.vividnext.sodalive.explorer.profile.series.UserProfileSeriesListAdapter
|
||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||
import kr.co.vividnext.sodalive.extensions.loadUrl
|
||||
import kr.co.vividnext.sodalive.extensions.moneyFormat
|
||||
@@ -74,7 +75,7 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
|
||||
private lateinit var loadingDialog: LoadingDialog
|
||||
private lateinit var liveAdapter: UserProfileLiveAdapter
|
||||
private lateinit var audioContentAdapter: AudioContentAdapter
|
||||
private lateinit var seriesAdapter: SeriesListAdapter
|
||||
private lateinit var seriesAdapter: UserProfileSeriesListAdapter
|
||||
private lateinit var donationAdapter: UserProfileDonationAdapter
|
||||
private lateinit var cheersAdapter: UserProfileCheersAdapter
|
||||
|
||||
@@ -437,7 +438,7 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
|
||||
false
|
||||
)
|
||||
|
||||
seriesAdapter = SeriesListAdapter(
|
||||
seriesAdapter = UserProfileSeriesListAdapter(
|
||||
onClickItem = {
|
||||
startActivity(
|
||||
Intent(applicationContext, SeriesDetailActivity::class.java).apply {
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package kr.co.vividnext.sodalive.explorer.profile.series
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import coil.load
|
||||
import coil.transform.CircleCropTransformation
|
||||
import coil.transform.RoundedCornersTransformation
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.audio_content.series.GetSeriesListResponse
|
||||
import kr.co.vividnext.sodalive.databinding.ItemSeriesListBigBinding
|
||||
import kr.co.vividnext.sodalive.databinding.ItemSeriesListBinding
|
||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||
|
||||
class UserProfileSeriesListAdapter(
|
||||
private val onClickItem: (Long) -> Unit,
|
||||
private val onClickCreator: (Long) -> Unit,
|
||||
private val isVisibleCreator: Boolean
|
||||
) : RecyclerView.Adapter<UserProfileSeriesListAdapter.ViewHolder>() {
|
||||
|
||||
val items = mutableListOf<GetSeriesListResponse.SeriesListItem>()
|
||||
|
||||
inner class ViewHolder(
|
||||
private val binding: ItemSeriesListBigBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
@SuppressLint("SetTextI18n")
|
||||
fun bind(item: GetSeriesListResponse.SeriesListItem) {
|
||||
binding.ivCover.load(item.coverImage) {
|
||||
crossfade(true)
|
||||
placeholder(R.drawable.bg_placeholder)
|
||||
transformations(RoundedCornersTransformation(5f.dpToPx()))
|
||||
}
|
||||
|
||||
binding.tvTitle.text = item.title
|
||||
binding.tvSeriesContentCount.text = "총 ${item.numberOfContent}화"
|
||||
binding.tvPublishedDaysOfWeek.text = item.publishedDaysOfWeek
|
||||
|
||||
binding.tvNew.visibility = if (item.isNew) {
|
||||
View.VISIBLE
|
||||
} else {
|
||||
View.GONE
|
||||
}
|
||||
|
||||
binding.tvPopular.visibility = if (item.isPopular) {
|
||||
View.VISIBLE
|
||||
} else {
|
||||
View.GONE
|
||||
}
|
||||
|
||||
if (item.isComplete) {
|
||||
binding.tvNew.visibility = View.GONE
|
||||
binding.tvComplete.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.tvComplete.visibility = View.GONE
|
||||
}
|
||||
|
||||
if (isVisibleCreator) {
|
||||
binding.llCreator.visibility = View.VISIBLE
|
||||
binding.tvCreator.text = item.creator.nickname
|
||||
binding.ivCreator.load(item.creator.profileImage) {
|
||||
crossfade(true)
|
||||
placeholder(R.drawable.ic_place_holder)
|
||||
transformations(CircleCropTransformation())
|
||||
}
|
||||
binding.llCreator.setOnClickListener { onClickCreator(item.creator.creatorId) }
|
||||
} else {
|
||||
binding.llCreator.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.root.setOnClickListener { onClickItem(item.seriesId) }
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = ViewHolder(
|
||||
ItemSeriesListBigBinding.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(items: List<GetSeriesListResponse.SeriesListItem>) {
|
||||
this.items.addAll(items)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
fun clear() {
|
||||
this.items.clear()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user