fix(creator): 채널 홈 카드 태그 크기를 보정한다

This commit is contained in:
2026-06-16 21:18:38 +09:00
parent ee4de78c6c
commit 9900ac02f5
3 changed files with 51 additions and 19 deletions

View File

@@ -171,8 +171,12 @@ class CreatorChannelHomeSectionAdapter(
R.string.creator_channel_donation_empty_title
}
)
donationButton?.setOnClickListener(if (isDonationButtonVisible) View.OnClickListener { onDonationClick() } else null)
donationEmptyButton?.setOnClickListener(if (isDonationEmptyButtonVisible) View.OnClickListener { onDonationClick() } else null)
donationButton?.setOnClickListener(
if (isDonationButtonVisible) View.OnClickListener { onDonationClick() } else null
)
donationEmptyButton?.setOnClickListener(
if (isDonationEmptyButtonVisible) View.OnClickListener { onDonationClick() } else null
)
val visibleDonations = item.donations.take(MAX_DONATION_ITEM_COUNT)
visibleDonations.forEachIndexed { index, donation ->
val row = LayoutInflater.from(itemView.context).inflate(
@@ -291,9 +295,17 @@ class CreatorChannelHomeSectionAdapter(
private fun bindAudioContents(item: CreatorChannelHomeSection.AudioContents) {
val visibleAudioContents = item.audioContents.take(MAX_AUDIO_ITEM_COUNT)
updateAudioContentsGridSpan(visibleAudioContents.size)
audioContentGridAdapter.submitItems(visibleAudioContents)
}
private fun updateAudioContentsGridSpan(itemCount: Int) {
(audioContentsRecyclerView?.layoutManager as? GridLayoutManager)?.spanCount = itemCount.coerceIn(
1,
AUDIO_GRID_SPAN_COUNT
)
}
private fun setupAudioContentsRecyclerView() {
audioContentsRecyclerView?.apply {
if (layoutManager == null) {
@@ -427,7 +439,7 @@ class CreatorChannelHomeSectionAdapter(
private fun bindActivity(item: CreatorChannelHomeSection.Activity) {
val activity = item.activity
activityDebutValue?.text = formatDebutActivityValue(activity.debutDateUtc, activity.dDay)
activityDebutValue?.text = formatCreatorChannelDebutActivityValue(activity.debutDateUtc, activity.dDay)
activityLiveCountValue?.text = itemView.context.getString(
R.string.creator_channel_activity_live_count_format,
activity.liveCount
@@ -473,15 +485,6 @@ class CreatorChannelHomeSectionAdapter(
}
}
private fun formatDebutActivityValue(debutDateUtc: String?, dDay: String): String {
val debutDate = debutDateUtc.orEmpty()
return if (debutDate.isBlank()) {
dDay
} else {
itemView.context.getString(R.string.creator_channel_activity_debut_format, debutDate, dDay)
}
}
private fun Int.dp(): Int = (this * itemView.resources.displayMetrics.density).toInt()
}
@@ -611,16 +614,41 @@ internal fun formatCreatorChannelScheduleTime(
locale: Locale = Locale.getDefault()
): String = formatCreatorChannelScheduleUtc(scheduledAtUtc, "a hh:mm", timeZone, locale)
internal fun formatCreatorChannelDebutActivityValue(
debutDateUtc: String?,
dDay: String,
timeZone: TimeZone = TimeZone.getDefault(),
locale: Locale = Locale.getDefault()
): String {
val debutDate = debutDateUtc?.takeIf(String::isNotBlank)?.let { dateUtc ->
formatCreatorChannelUtcOrNull(dateUtc, "yyyy.MM.dd", timeZone, locale)
}
return if (debutDate.isNullOrBlank()) {
dDay
} else {
"$debutDate($dDay)"
}
}
private fun formatCreatorChannelScheduleUtc(
scheduledAtUtc: String,
pattern: String,
timeZone: TimeZone,
locale: Locale
): String {
return formatCreatorChannelUtcOrNull(scheduledAtUtc, pattern, timeZone, locale).orEmpty()
}
private fun formatCreatorChannelUtcOrNull(
utc: String,
pattern: String,
timeZone: TimeZone,
locale: Locale
): String? {
val date = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US).apply {
this.timeZone = TimeZone.getTimeZone("UTC")
isLenient = false
}.parse(scheduledAtUtc) ?: return ""
}.runCatching { parse(utc) }.getOrNull() ?: return null
return SimpleDateFormat(pattern, locale).apply { this.timeZone = timeZone }.format(date)
}

View File

@@ -66,11 +66,13 @@
<TextView
android:id="@+id/tv_audio_content_free_tag"
style="@style/Typography.Body6"
android:layout_width="34dp"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:background="@drawable/bg_audio_content_tag_free"
android:gravity="center"
android:includeFontPadding="false"
android:minWidth="34dp"
android:paddingHorizontal="4dp"
android:text="@string/audio_content_tag_free"
android:textColor="@color/white" />
</LinearLayout>

View File

@@ -21,17 +21,19 @@
<FrameLayout
android:id="@+id/layout_series_original_tag"
android:layout_width="70dp"
android:layout_height="24dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|start"
android:background="@drawable/bg_series_original_tag">
android:background="@drawable/bg_series_original_tag"
android:minHeight="24dp"
android:paddingStart="8dp"
android:paddingEnd="8dp">
<ImageView
android:id="@+id/iv_series_original_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_gravity="start|center_vertical"
android:layout_marginStart="8dp"
android:contentDescription="@null"
android:src="@drawable/ic_series_original" />
@@ -39,7 +41,7 @@
android:id="@+id/tv_series_original_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="26dp"
android:layout_marginStart="18dp"
android:layout_marginTop="2dp"
android:fontFamily="@font/phosphate_solid"
android:text="Only"