fix(content): 최근 댓글 오디오 카드 UI를 보정한다
This commit is contained in:
+15
-1
@@ -9,6 +9,7 @@ import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.databinding.ItemContentCommentedAudioBinding
|
||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||
import kr.co.vividnext.sodalive.extensions.loadUrl
|
||||
import kr.co.vividnext.sodalive.v2.main.content.model.ContentCommentedAudioUiModel
|
||||
|
||||
@@ -24,8 +25,11 @@ class ContentCommentedAudioAdapter(
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val binding = ItemContentCommentedAudioBinding.inflate(LayoutInflater.from(parent.context), parent, false).apply {
|
||||
root.layoutParams.width = parent.resources.displayMetrics.widthPixels - (CONTENT_HORIZONTAL_MARGIN_DP * 2).dpToPx().toInt()
|
||||
}
|
||||
return ViewHolder(
|
||||
ItemContentCommentedAudioBinding.inflate(LayoutInflater.from(parent.context), parent, false),
|
||||
binding,
|
||||
onAudioClick
|
||||
)
|
||||
}
|
||||
@@ -47,6 +51,12 @@ class ContentCommentedAudioAdapter(
|
||||
outline.setRoundRect(0, 0, view.width, view.height, view.resources.getDimension(R.dimen.radius_14))
|
||||
}
|
||||
}
|
||||
binding.ivContentCommentProfile.clipToOutline = true
|
||||
binding.ivContentCommentProfile.outlineProvider = object : ViewOutlineProvider() {
|
||||
override fun getOutline(view: View, outline: Outline) {
|
||||
outline.setOval(0, 0, view.width, view.height)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun bind(item: ContentCommentedAudioUiModel) = with(binding) {
|
||||
@@ -58,4 +68,8 @@ class ContentCommentedAudioAdapter(
|
||||
root.setOnClickListener { onAudioClick(item) }
|
||||
}
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val CONTENT_HORIZONTAL_MARGIN_DP = 14
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user