fix(tv): align home section spacing

This commit is contained in:
2026-05-01 22:06:37 +02:00
parent f304b1f1f5
commit 71a9a8b98e
4 changed files with 17 additions and 7 deletions

View File

@@ -152,6 +152,7 @@ fun PosterCardContent(
text = model.primaryText, text = model.primaryText,
color = scheme.onBackground, color = scheme.onBackground,
fontSize = 13.sp, fontSize = 13.sp,
lineHeight = 13.sp,
fontWeight = FontWeight.Medium, fontWeight = FontWeight.Medium,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis
@@ -164,6 +165,7 @@ fun PosterCardContent(
text = text, text = text,
color = scheme.onSurfaceVariant, color = scheme.onSurfaceVariant,
fontSize = 11.sp, fontSize = 11.sp,
lineHeight = 11.sp,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis
) )

View File

@@ -6,7 +6,7 @@ import androidx.compose.foundation.gestures.BringIntoViewSpec
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import kotlin.math.abs import kotlin.math.abs
internal val TvHomeFocusedItemTopOffset = 42.dp internal val TvHomeFocusedItemTopOffset = 48.dp
internal val TvHomeBringIntoViewTrailingSpace = 120.dp internal val TvHomeBringIntoViewTrailingSpace = 120.dp
private const val TvHomeRowPivotParentFraction = 0.3f private const val TvHomeRowPivotParentFraction = 0.3f

View File

@@ -4,6 +4,7 @@ package hu.bbara.purefin.ui.screen.home.components
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.LocalBringIntoViewSpec import androidx.compose.foundation.gestures.LocalBringIntoViewSpec
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
@@ -66,11 +67,9 @@ fun TvHomeContent(
.fillMaxSize() .fillMaxSize()
.background(scheme.background) .background(scheme.background)
.focusRequester(initialFocusRequester), .focusRequester(initialFocusRequester),
verticalArrangement = Arrangement.spacedBy(24.dp),
contentPadding = contentPadding contentPadding = contentPadding
) { ) {
item(key = "tv-home-top-spacer") {
Spacer(modifier = Modifier.height(8.dp))
}
if (hasContinueWatching) { if (hasContinueWatching) {
item(key = "tv-home-continue-watching") { item(key = "tv-home-continue-watching") {
TvContinueWatchingSection( TvContinueWatchingSection(

View File

@@ -12,9 +12,11 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.layout.wrapContentHeight
@@ -63,8 +65,8 @@ private val TvHomeLandscapeFocusedBorderWidth = (2f * TvHomeMediaCardScale).dp
private val TvHomeLandscapeUnfocusedBorderWidth = (1f * TvHomeMediaCardScale).dp private val TvHomeLandscapeUnfocusedBorderWidth = (1f * TvHomeMediaCardScale).dp
private val TvHomeLandscapeProgressBarHeight = (6f * TvHomeMediaCardScale).dp private val TvHomeLandscapeProgressBarHeight = (6f * TvHomeMediaCardScale).dp
private val TvHomeLandscapeProgressBarPadding = (8f * TvHomeMediaCardScale).dp private val TvHomeLandscapeProgressBarPadding = (8f * TvHomeMediaCardScale).dp
private val TvHomeLandscapeMetadataSpacing = (4f * TvHomeMediaCardScale).dp private val TvHomeLandscapeMetadataSpacing = (1f * TvHomeMediaCardScale).dp
private val TvHomeLandscapeMetadataTopPadding = (12f * TvHomeMediaCardScale).dp private val TvHomeLandscapeMetadataTopPadding = (6f * TvHomeMediaCardScale).dp
private val TvHomeLandscapeMetadataHorizontalPadding = (4f * TvHomeMediaCardScale).dp private val TvHomeLandscapeMetadataHorizontalPadding = (4f * TvHomeMediaCardScale).dp
private val TvHomeLandscapeTitleFontSize = (15f * TvHomeMediaCardScale).sp private val TvHomeLandscapeTitleFontSize = (15f * TvHomeMediaCardScale).sp
private val TvHomeLandscapeSupportingFontSize = (11f * TvHomeMediaCardScale).sp private val TvHomeLandscapeSupportingFontSize = (11f * TvHomeMediaCardScale).sp
@@ -87,6 +89,10 @@ fun TvContinueWatchingSection(
modifier: Modifier = Modifier modifier: Modifier = Modifier
) { ) {
if (items.isEmpty()) return if (items.isEmpty()) return
TvSectionHeader(
title = "Continue Watching",
)
Spacer(modifier = Modifier.height(8.dp))
TvHomeSectionRow( TvHomeSectionRow(
items = items, items = items,
onFocused = onFocusedItem, onFocused = onFocusedItem,
@@ -117,6 +123,7 @@ fun TvNextUpSection(
TvSectionHeader( TvSectionHeader(
title = "Next Up", title = "Next Up",
) )
Spacer(modifier = Modifier.height(8.dp))
TvHomeSectionRow( TvHomeSectionRow(
items = items, items = items,
onFocused = onFocusedItem, onFocused = onFocusedItem,
@@ -142,10 +149,10 @@ fun TvLibraryPosterSection(
onMediaSelected: (MediaUiModel) -> Unit, onMediaSelected: (MediaUiModel) -> Unit,
) { ) {
if (items.isEmpty()) return if (items.isEmpty()) return
TvSectionHeader( TvSectionHeader(
title = title, title = title,
) )
Spacer(modifier = Modifier.height(8.dp))
TvHomeSectionRow( TvHomeSectionRow(
items = items, items = items,
onFocused = onFocusedItem, onFocused = onFocusedItem,
@@ -327,6 +334,7 @@ private fun TvHomeLandscapeCard(
text = title, text = title,
color = scheme.onBackground, color = scheme.onBackground,
fontSize = TvHomeLandscapeTitleFontSize, fontSize = TvHomeLandscapeTitleFontSize,
lineHeight = TvHomeLandscapeTitleFontSize,
fontWeight = FontWeight.SemiBold, fontWeight = FontWeight.SemiBold,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis
@@ -336,6 +344,7 @@ private fun TvHomeLandscapeCard(
text = supporting, text = supporting,
color = scheme.onSurfaceVariant, color = scheme.onSurfaceVariant,
fontSize = TvHomeLandscapeSupportingFontSize, fontSize = TvHomeLandscapeSupportingFontSize,
lineHeight = TvHomeLandscapeSupportingFontSize,
fontWeight = FontWeight.Medium, fontWeight = FontWeight.Medium,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis