From 241532f60ee0da50d8bb9b5d9a3585b8abb88aa8 Mon Sep 17 00:00:00 2001 From: klaus Date: Fri, 19 Jun 2026 19:10:58 +0900 Subject: [PATCH] =?UTF-8?q?feat(creator):=20=EC=B1=84=EB=84=90=20sort=20?= =?UTF-8?q?=EA=B3=B5=ED=86=B5=20=EB=AA=A8=EB=8D=B8=EC=9D=84=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../channel/model/CreatorChannelSortModels.kt | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/model/CreatorChannelSortModels.kt diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/model/CreatorChannelSortModels.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/model/CreatorChannelSortModels.kt new file mode 100644 index 00000000..a348e2ef --- /dev/null +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/model/CreatorChannelSortModels.kt @@ -0,0 +1,27 @@ +package kr.co.vividnext.sodalive.v2.creator.channel.model + +import androidx.annotation.StringRes +import kr.co.vividnext.sodalive.R +import kr.co.vividnext.sodalive.v2.common.data.ContentSort + +data class CreatorChannelSortOptionUiModel( + val sort: ContentSort, + @param:StringRes val labelResId: Int, + val isSelected: Boolean +) + +@StringRes +fun ContentSort.toLabelResId(): Int = when (this) { + ContentSort.LATEST -> R.string.screen_audio_content_sort_newest + ContentSort.POPULAR -> R.string.screen_audio_content_sort_popularity + ContentSort.OWNED -> R.string.creator_channel_live_sort_owned + ContentSort.PRICE_HIGH -> R.string.screen_audio_content_sort_price_high + ContentSort.PRICE_LOW -> R.string.screen_audio_content_sort_price_low +} + +fun ContentSort.toSortOptionUiModel(selectedSort: ContentSort): CreatorChannelSortOptionUiModel = + CreatorChannelSortOptionUiModel( + sort = this, + labelResId = toLabelResId(), + isSelected = this == selectedSort + )