fix(creator): 채널 홈 카드 태그 크기를 보정한다
This commit is contained in:
@@ -171,8 +171,12 @@ class CreatorChannelHomeSectionAdapter(
|
|||||||
R.string.creator_channel_donation_empty_title
|
R.string.creator_channel_donation_empty_title
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
donationButton?.setOnClickListener(if (isDonationButtonVisible) View.OnClickListener { onDonationClick() } else null)
|
donationButton?.setOnClickListener(
|
||||||
donationEmptyButton?.setOnClickListener(if (isDonationEmptyButtonVisible) View.OnClickListener { onDonationClick() } else null)
|
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)
|
val visibleDonations = item.donations.take(MAX_DONATION_ITEM_COUNT)
|
||||||
visibleDonations.forEachIndexed { index, donation ->
|
visibleDonations.forEachIndexed { index, donation ->
|
||||||
val row = LayoutInflater.from(itemView.context).inflate(
|
val row = LayoutInflater.from(itemView.context).inflate(
|
||||||
@@ -291,9 +295,17 @@ class CreatorChannelHomeSectionAdapter(
|
|||||||
|
|
||||||
private fun bindAudioContents(item: CreatorChannelHomeSection.AudioContents) {
|
private fun bindAudioContents(item: CreatorChannelHomeSection.AudioContents) {
|
||||||
val visibleAudioContents = item.audioContents.take(MAX_AUDIO_ITEM_COUNT)
|
val visibleAudioContents = item.audioContents.take(MAX_AUDIO_ITEM_COUNT)
|
||||||
|
updateAudioContentsGridSpan(visibleAudioContents.size)
|
||||||
audioContentGridAdapter.submitItems(visibleAudioContents)
|
audioContentGridAdapter.submitItems(visibleAudioContents)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun updateAudioContentsGridSpan(itemCount: Int) {
|
||||||
|
(audioContentsRecyclerView?.layoutManager as? GridLayoutManager)?.spanCount = itemCount.coerceIn(
|
||||||
|
1,
|
||||||
|
AUDIO_GRID_SPAN_COUNT
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
private fun setupAudioContentsRecyclerView() {
|
private fun setupAudioContentsRecyclerView() {
|
||||||
audioContentsRecyclerView?.apply {
|
audioContentsRecyclerView?.apply {
|
||||||
if (layoutManager == null) {
|
if (layoutManager == null) {
|
||||||
@@ -427,7 +439,7 @@ class CreatorChannelHomeSectionAdapter(
|
|||||||
|
|
||||||
private fun bindActivity(item: CreatorChannelHomeSection.Activity) {
|
private fun bindActivity(item: CreatorChannelHomeSection.Activity) {
|
||||||
val activity = item.activity
|
val activity = item.activity
|
||||||
activityDebutValue?.text = formatDebutActivityValue(activity.debutDateUtc, activity.dDay)
|
activityDebutValue?.text = formatCreatorChannelDebutActivityValue(activity.debutDateUtc, activity.dDay)
|
||||||
activityLiveCountValue?.text = itemView.context.getString(
|
activityLiveCountValue?.text = itemView.context.getString(
|
||||||
R.string.creator_channel_activity_live_count_format,
|
R.string.creator_channel_activity_live_count_format,
|
||||||
activity.liveCount
|
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()
|
private fun Int.dp(): Int = (this * itemView.resources.displayMetrics.density).toInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -611,16 +614,41 @@ internal fun formatCreatorChannelScheduleTime(
|
|||||||
locale: Locale = Locale.getDefault()
|
locale: Locale = Locale.getDefault()
|
||||||
): String = formatCreatorChannelScheduleUtc(scheduledAtUtc, "a hh:mm", timeZone, locale)
|
): 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(
|
private fun formatCreatorChannelScheduleUtc(
|
||||||
scheduledAtUtc: String,
|
scheduledAtUtc: String,
|
||||||
pattern: String,
|
pattern: String,
|
||||||
timeZone: TimeZone,
|
timeZone: TimeZone,
|
||||||
locale: Locale
|
locale: Locale
|
||||||
): String {
|
): 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 {
|
val date = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US).apply {
|
||||||
this.timeZone = TimeZone.getTimeZone("UTC")
|
this.timeZone = TimeZone.getTimeZone("UTC")
|
||||||
isLenient = false
|
isLenient = false
|
||||||
}.parse(scheduledAtUtc) ?: return ""
|
}.runCatching { parse(utc) }.getOrNull() ?: return null
|
||||||
return SimpleDateFormat(pattern, locale).apply { this.timeZone = timeZone }.format(date)
|
return SimpleDateFormat(pattern, locale).apply { this.timeZone = timeZone }.format(date)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,11 +66,13 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_audio_content_free_tag"
|
android:id="@+id/tv_audio_content_free_tag"
|
||||||
style="@style/Typography.Body6"
|
style="@style/Typography.Body6"
|
||||||
android:layout_width="34dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
android:background="@drawable/bg_audio_content_tag_free"
|
android:background="@drawable/bg_audio_content_tag_free"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:includeFontPadding="false"
|
android:includeFontPadding="false"
|
||||||
|
android:minWidth="34dp"
|
||||||
|
android:paddingHorizontal="4dp"
|
||||||
android:text="@string/audio_content_tag_free"
|
android:text="@string/audio_content_tag_free"
|
||||||
android:textColor="@color/white" />
|
android:textColor="@color/white" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -21,17 +21,19 @@
|
|||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/layout_series_original_tag"
|
android:id="@+id/layout_series_original_tag"
|
||||||
android:layout_width="70dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="24dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="top|start"
|
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
|
<ImageView
|
||||||
android:id="@+id/iv_series_original_icon"
|
android:id="@+id/iv_series_original_icon"
|
||||||
android:layout_width="14dp"
|
android:layout_width="14dp"
|
||||||
android:layout_height="14dp"
|
android:layout_height="14dp"
|
||||||
android:layout_gravity="start|center_vertical"
|
android:layout_gravity="start|center_vertical"
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
android:src="@drawable/ic_series_original" />
|
android:src="@drawable/ic_series_original" />
|
||||||
|
|
||||||
@@ -39,7 +41,7 @@
|
|||||||
android:id="@+id/tv_series_original_text"
|
android:id="@+id/tv_series_original_text"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="26dp"
|
android:layout_marginStart="18dp"
|
||||||
android:layout_marginTop="2dp"
|
android:layout_marginTop="2dp"
|
||||||
android:fontFamily="@font/phosphate_solid"
|
android:fontFamily="@font/phosphate_solid"
|
||||||
android:text="Only"
|
android:text="Only"
|
||||||
|
|||||||
Reference in New Issue
Block a user