From 6df7666cecd991755eaed042b937d2ae344f21e8 Mon Sep 17 00:00:00 2001 From: klaus Date: Fri, 19 Jun 2026 19:11:38 +0900 Subject: [PATCH] =?UTF-8?q?refactor(creator):=20=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=EB=B8=8C=20replay=20item=EC=9D=84=20=EA=B3=B5=ED=86=B5?= =?UTF-8?q?=ED=99=94=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/CreatorChannelLiveReplayAdapter.kt | 54 +++++++++---------- .../layout/fragment_creator_channel_live.xml | 2 +- ...=> item_creator_channel_audio_content.xml} | 28 +++++----- 3 files changed, 42 insertions(+), 42 deletions(-) rename app/src/main/res/layout/{item_creator_channel_live_replay.xml => item_creator_channel_audio_content.xml} (84%) diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/live/ui/CreatorChannelLiveReplayAdapter.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/live/ui/CreatorChannelLiveReplayAdapter.kt index 31f677a0..a4f2bf27 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/live/ui/CreatorChannelLiveReplayAdapter.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/live/ui/CreatorChannelLiveReplayAdapter.kt @@ -8,7 +8,7 @@ import android.view.ViewOutlineProvider import androidx.core.view.isVisible import androidx.recyclerview.widget.RecyclerView import kr.co.vividnext.sodalive.R -import kr.co.vividnext.sodalive.databinding.ItemCreatorChannelLiveReplayBinding +import kr.co.vividnext.sodalive.databinding.ItemCreatorChannelAudioContentBinding import kr.co.vividnext.sodalive.extensions.loadUrl import kr.co.vividnext.sodalive.extensions.moneyFormat import kr.co.vividnext.sodalive.v2.creator.channel.live.model.CreatorChannelLiveReplayStatus @@ -28,7 +28,7 @@ class CreatorChannelLiveReplayAdapter( override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { return ViewHolder( - ItemCreatorChannelLiveReplayBinding.inflate(LayoutInflater.from(parent.context), parent, false), + ItemCreatorChannelAudioContentBinding.inflate(LayoutInflater.from(parent.context), parent, false), onReplayClick ) } @@ -40,13 +40,13 @@ class CreatorChannelLiveReplayAdapter( override fun getItemCount(): Int = items.size class ViewHolder( - private val binding: ItemCreatorChannelLiveReplayBinding, + private val binding: ItemCreatorChannelAudioContentBinding, private val onReplayClick: (CreatorChannelLiveReplayUiModel) -> Unit ) : RecyclerView.ViewHolder(binding.root) { init { - binding.layoutCreatorChannelLiveReplayThumbnail.clipToOutline = true - binding.layoutCreatorChannelLiveReplayThumbnail.outlineProvider = object : ViewOutlineProvider() { + binding.layoutCreatorChannelAudioContentThumbnail.clipToOutline = true + binding.layoutCreatorChannelAudioContentThumbnail.outlineProvider = object : ViewOutlineProvider() { override fun getOutline(view: View, outline: Outline) { outline.setRoundRect( 0, @@ -60,16 +60,16 @@ class CreatorChannelLiveReplayAdapter( } fun bind(item: CreatorChannelLiveReplayUiModel) = with(binding) { - ivCreatorChannelLiveReplayThumbnail.loadUrl(item.imageUrl) - tvCreatorChannelLiveReplayTitle.text = item.title - tvCreatorChannelLiveReplayDuration.text = item.secondaryText.orEmpty() - tvCreatorChannelLiveReplayDuration.isVisible = !item.secondaryText.isNullOrBlank() - ivCreatorChannelLiveReplayAdultBadge.setImageResource(R.drawable.ic_new_shield_small) - ivCreatorChannelLiveReplayAdultBadge.isVisible = item.showAdultBadge - bindTag(ivCreatorChannelLiveReplayOriginalTag, AudioContentTag.Original, item.tags) - bindTag(ivCreatorChannelLiveReplayFirstTag, AudioContentTag.First, item.tags) - bindTag(ivCreatorChannelLiveReplayPointTag, AudioContentTag.Point, item.tags) - tvCreatorChannelLiveReplayFreeTag.isVisible = AudioContentTag.Free in item.tags + ivCreatorChannelAudioContentThumbnail.loadUrl(item.imageUrl) + tvCreatorChannelAudioContentTitle.text = item.title + tvCreatorChannelAudioContentSecondaryText.text = item.secondaryText.orEmpty() + tvCreatorChannelAudioContentSecondaryText.isVisible = !item.secondaryText.isNullOrBlank() + ivCreatorChannelAudioContentAdultBadge.setImageResource(R.drawable.ic_new_shield_small) + ivCreatorChannelAudioContentAdultBadge.isVisible = item.showAdultBadge + bindTag(ivCreatorChannelAudioContentOriginalTag, AudioContentTag.Original, item.tags) + bindTag(ivCreatorChannelAudioContentFirstTag, AudioContentTag.First, item.tags) + bindTag(ivCreatorChannelAudioContentPointTag, AudioContentTag.Point, item.tags) + tvCreatorChannelAudioContentFreeTag.isVisible = AudioContentTag.Free in item.tags bindStatus(item.status) root.setOnClickListener { onReplayClick(item) } } @@ -79,29 +79,29 @@ class CreatorChannelLiveReplayAdapter( } private fun bindStatus(status: CreatorChannelLiveReplayStatus) = with(binding) { - ivCreatorChannelLiveReplayPlay.setImageResource(R.drawable.ic_new_player_play) + ivCreatorChannelAudioContentPlay.setImageResource(R.drawable.ic_new_player_play) when (status) { CreatorChannelLiveReplayStatus.Play -> { - ivCreatorChannelLiveReplayPlay.isVisible = true - ivCreatorChannelLiveReplayCan.isVisible = false - layoutCreatorChannelLiveReplayActionText.isVisible = false + ivCreatorChannelAudioContentPlay.isVisible = true + ivCreatorChannelAudioContentCan.isVisible = false + layoutCreatorChannelAudioContentActionText.isVisible = false } CreatorChannelLiveReplayStatus.Owned -> bindTextStatus(R.string.audio_content_badge_owned) CreatorChannelLiveReplayStatus.Rented -> bindTextStatus(R.string.audio_content_badge_rented) is CreatorChannelLiveReplayStatus.Price -> { - ivCreatorChannelLiveReplayPlay.isVisible = false - layoutCreatorChannelLiveReplayActionText.isVisible = true - ivCreatorChannelLiveReplayCan.isVisible = true - tvCreatorChannelLiveReplayActionText.text = status.price.moneyFormat() + ivCreatorChannelAudioContentPlay.isVisible = false + layoutCreatorChannelAudioContentActionText.isVisible = true + ivCreatorChannelAudioContentCan.isVisible = true + tvCreatorChannelAudioContentActionText.text = status.price.moneyFormat() } } } private fun bindTextStatus(textResId: Int) = with(binding) { - ivCreatorChannelLiveReplayPlay.isVisible = true - layoutCreatorChannelLiveReplayActionText.isVisible = true - ivCreatorChannelLiveReplayCan.isVisible = false - tvCreatorChannelLiveReplayActionText.setText(textResId) + ivCreatorChannelAudioContentPlay.isVisible = true + layoutCreatorChannelAudioContentActionText.isVisible = true + ivCreatorChannelAudioContentCan.isVisible = false + tvCreatorChannelAudioContentActionText.setText(textResId) } } } diff --git a/app/src/main/res/layout/fragment_creator_channel_live.xml b/app/src/main/res/layout/fragment_creator_channel_live.xml index 5e043149..ca8f3977 100644 --- a/app/src/main/res/layout/fragment_creator_channel_live.xml +++ b/app/src/main/res/layout/fragment_creator_channel_live.xml @@ -193,7 +193,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/layout_creator_channel_live_current_card" tools:itemCount="3" - tools:listitem="@layout/item_creator_channel_live_replay" /> + tools:listitem="@layout/item_creator_channel_audio_content" />