크리에이터 채널 - 함께 들으면 좋은 채널 제거
This commit is contained in:
@@ -7,8 +7,6 @@ data class GetCreatorProfileResponse(
|
||||
val creator: CreatorResponse,
|
||||
@SerializedName("userDonationRanking")
|
||||
val userDonationRanking: List<UserDonationRankingResponse>,
|
||||
@SerializedName("similarCreatorList")
|
||||
val similarCreatorList: List<SimilarCreatorResponse>,
|
||||
@SerializedName("liveRoomList")
|
||||
val liveRoomList: List<LiveRoomResponse>,
|
||||
@SerializedName("contentList")
|
||||
@@ -45,13 +43,6 @@ data class UserDonationRankingResponse(
|
||||
@SerializedName("donationCan") val donationCan: Int
|
||||
)
|
||||
|
||||
data class SimilarCreatorResponse(
|
||||
@SerializedName("userId") val userId: Long,
|
||||
@SerializedName("nickname") val nickname: String,
|
||||
@SerializedName("profileImage") val profileImage: String,
|
||||
@SerializedName("tags") val tags: List<String>
|
||||
)
|
||||
|
||||
data class LiveRoomResponse(
|
||||
@SerializedName("roomId") val roomId: Long,
|
||||
@SerializedName("title") val title: String,
|
||||
|
@@ -63,7 +63,6 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
|
||||
private lateinit var liveAdapter: UserProfileLiveAdapter
|
||||
private lateinit var audioContentAdapter: AudioContentAdapter
|
||||
private lateinit var donationAdapter: UserProfileDonationAdapter
|
||||
private lateinit var similarCreatorAdapter: UserProfileSimilarCreatorAdapter
|
||||
private lateinit var cheersAdapter: UserProfileCheersAdapter
|
||||
|
||||
private lateinit var noticeWriteLauncher: ActivityResultLauncher<Intent>
|
||||
@@ -122,7 +121,6 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
|
||||
|
||||
setupLiveView()
|
||||
setupDonationView()
|
||||
setupSimilarCreatorView()
|
||||
setupFanTalkView()
|
||||
setupAudioContentListView()
|
||||
}
|
||||
@@ -310,51 +308,6 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
|
||||
recyclerView.adapter = donationAdapter
|
||||
}
|
||||
|
||||
private fun setupSimilarCreatorView() {
|
||||
val recyclerView = binding.layoutUserProfileSimilarCreator.rvSimilarCreator
|
||||
similarCreatorAdapter = UserProfileSimilarCreatorAdapter {
|
||||
val intent = Intent(applicationContext, UserProfileActivity::class.java)
|
||||
intent.putExtra(Constants.EXTRA_USER_ID, it.userId)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
recyclerView.layoutManager = LinearLayoutManager(
|
||||
applicationContext,
|
||||
LinearLayoutManager.VERTICAL,
|
||||
false
|
||||
)
|
||||
|
||||
recyclerView.addItemDecoration(object : RecyclerView.ItemDecoration() {
|
||||
override fun getItemOffsets(
|
||||
outRect: Rect,
|
||||
view: View,
|
||||
parent: RecyclerView,
|
||||
state: RecyclerView.State
|
||||
) {
|
||||
super.getItemOffsets(outRect, view, parent, state)
|
||||
|
||||
when (parent.getChildAdapterPosition(view)) {
|
||||
0 -> {
|
||||
outRect.top = 0
|
||||
outRect.bottom = 10f.dpToPx().toInt()
|
||||
}
|
||||
|
||||
similarCreatorAdapter.itemCount - 1 -> {
|
||||
outRect.top = 10f.dpToPx().toInt()
|
||||
outRect.bottom = 0
|
||||
}
|
||||
|
||||
else -> {
|
||||
outRect.top = 10f.dpToPx().toInt()
|
||||
outRect.bottom = 10f.dpToPx().toInt()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
recyclerView.adapter = similarCreatorAdapter
|
||||
}
|
||||
|
||||
private fun setupFanTalkView() {
|
||||
binding.layoutUserProfileFanTalk.tvAll.setOnClickListener {
|
||||
val intent = Intent(
|
||||
@@ -559,7 +512,6 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
|
||||
setCreatorNotice(it.notice, it.creator.creatorId)
|
||||
setAudioContentList(it.contentList)
|
||||
setLiveRoomList(it.liveRoomList)
|
||||
setSimilarCreatorList(it.similarCreatorList)
|
||||
setUserDonationRanking(it.userDonationRanking)
|
||||
setActivitySummary(it.activitySummary)
|
||||
}
|
||||
@@ -748,18 +700,6 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun setSimilarCreatorList(similarCreatorList: List<SimilarCreatorResponse>) {
|
||||
if (similarCreatorList.isEmpty()) {
|
||||
binding.llUserProfileSimilarCreator.visibility = View.GONE
|
||||
} else {
|
||||
binding.llUserProfileSimilarCreator.visibility = View.VISIBLE
|
||||
similarCreatorAdapter.items.clear()
|
||||
similarCreatorAdapter.items.addAll(similarCreatorList)
|
||||
similarCreatorAdapter.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun setUserDonationRanking(userDonationRanking: List<UserDonationRankingResponse>) {
|
||||
if (userDonationRanking.isEmpty()) {
|
||||
|
@@ -1,46 +0,0 @@
|
||||
package kr.co.vividnext.sodalive.explorer.profile
|
||||
|
||||
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.ItemUserProfileSimilarCreatorBinding
|
||||
|
||||
class UserProfileSimilarCreatorAdapter(
|
||||
private val onClickItem: (SimilarCreatorResponse) -> Unit
|
||||
) : RecyclerView.Adapter<UserProfileSimilarCreatorAdapter.ViewHolder>() {
|
||||
|
||||
val items = mutableListOf<SimilarCreatorResponse>()
|
||||
|
||||
inner class ViewHolder(
|
||||
private val binding: ItemUserProfileSimilarCreatorBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
fun bind(item: SimilarCreatorResponse) {
|
||||
binding.ivProfile.load(item.profileImage) {
|
||||
crossfade(true)
|
||||
placeholder(R.drawable.ic_place_holder)
|
||||
transformations(CircleCropTransformation())
|
||||
}
|
||||
|
||||
binding.tvNickname.text = item.nickname
|
||||
binding.tvTags.text = item.tags.joinToString(" ") { "#$it" }
|
||||
binding.root.setOnClickListener { onClickItem(item) }
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = ViewHolder(
|
||||
ItemUserProfileSimilarCreatorBinding.inflate(
|
||||
LayoutInflater.from(parent.context),
|
||||
parent,
|
||||
false
|
||||
)
|
||||
)
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
holder.bind(items[position])
|
||||
}
|
||||
|
||||
override fun getItemCount() = items.count()
|
||||
}
|
Reference in New Issue
Block a user