fix(content): 최근 댓글 오디오 카드 UI를 보정한다
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/gray_800" />
|
||||
<corners android:radius="@dimen/radius_14" />
|
||||
</shape>
|
||||
@@ -1,9 +1,11 @@
|
||||
<?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="310dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:background="@drawable/bg_feed_card"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/spacing_14">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -46,8 +48,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/spacing_12"
|
||||
android:background="@drawable/bg_content_commented_audio_comment"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/spacing_12">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_content_comment_profile"
|
||||
@@ -66,8 +70,9 @@
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
android:lineSpacingMultiplier="1.45"
|
||||
android:maxLines="2"
|
||||
android:textColor="@color/gray_500"
|
||||
android:textColor="@color/white"
|
||||
tools:text="최근 댓글 내용" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user