fix(creator): 커뮤니티 리스트 표시를 보정한다
This commit is contained in:
@@ -5,8 +5,13 @@ import android.view.ViewGroup
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import coil.transform.CircleCropTransformation
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.databinding.ItemCreatorChannelCommunityListBinding
|
||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||
import kr.co.vividnext.sodalive.extensions.loadUrl
|
||||
import kr.co.vividnext.sodalive.extensions.moneyFormat
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.community.model.CreatorChannelCommunityPostUiModel
|
||||
@@ -54,7 +59,7 @@ class CreatorChannelCommunityListAdapter(
|
||||
}
|
||||
tvCreatorChannelCommunityListNickname.text = item.creatorNickname
|
||||
tvCreatorChannelCommunityListTime.text = item.createdAtText
|
||||
tvCreatorChannelCommunityListNotice.isVisible = item.showNotice
|
||||
layoutCreatorChannelCommunityListNotice.isVisible = item.showNotice
|
||||
tvCreatorChannelCommunityListBody.text = item.content
|
||||
tvCreatorChannelCommunityListCommentCount.text = item.commentCount.moneyFormat()
|
||||
tvCreatorChannelCommunityListCommentCount.isVisible = item.showComment
|
||||
@@ -66,8 +71,13 @@ class CreatorChannelCommunityListAdapter(
|
||||
visibleImageUrl != null || item.isLocked || item.showPlayButton
|
||||
ivCreatorChannelCommunityListImage.isVisible = visibleImageUrl != null
|
||||
if (visibleImageUrl != null) {
|
||||
ivCreatorChannelCommunityListImage.loadUrl(visibleImageUrl)
|
||||
Glide.with(ivCreatorChannelCommunityListImage)
|
||||
.load(visibleImageUrl)
|
||||
.placeholder(R.drawable.ic_place_holder)
|
||||
.apply(communityImageRequestOptions())
|
||||
.into(ivCreatorChannelCommunityListImage)
|
||||
} else {
|
||||
Glide.with(ivCreatorChannelCommunityListImage).clear(ivCreatorChannelCommunityListImage)
|
||||
ivCreatorChannelCommunityListImage.setImageDrawable(null)
|
||||
}
|
||||
layoutCreatorChannelCommunityListLockedOverlay.isVisible = item.isLocked
|
||||
@@ -81,10 +91,17 @@ class CreatorChannelCommunityListAdapter(
|
||||
ivCreatorChannelCommunityListPlay.setOnClickListener { onPlayClick(item) }
|
||||
|
||||
layoutCreatorChannelCommunityListTopActions.isVisible = item.showOwnerMore || item.showOwnerTopPrice
|
||||
tvCreatorChannelCommunityListTopPrice.isVisible = item.showOwnerTopPrice
|
||||
layoutCreatorChannelCommunityListTopPrice.isVisible = item.showOwnerTopPrice
|
||||
tvCreatorChannelCommunityListTopPrice.text = item.price.moneyFormat()
|
||||
ivCreatorChannelCommunityListOwnerMore.isVisible = item.showOwnerMore
|
||||
ivCreatorChannelCommunityListOwnerMore.setOnClickListener { onOwnerMoreClick(item) }
|
||||
}
|
||||
|
||||
private fun communityImageRequestOptions(): RequestOptions {
|
||||
return RequestOptions().transform(
|
||||
CenterCrop(),
|
||||
RoundedCorners(14f.dpToPx().toInt())
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user