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,
color = scheme.onBackground,
fontSize = 13.sp,
lineHeight = 13.sp,
fontWeight = FontWeight.Medium,
maxLines = 1,
overflow = TextOverflow.Ellipsis
@@ -164,6 +165,7 @@ fun PosterCardContent(
text = text,
color = scheme.onSurfaceVariant,
fontSize = 11.sp,
lineHeight = 11.sp,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)

View File

@@ -6,7 +6,7 @@ import androidx.compose.foundation.gestures.BringIntoViewSpec
import androidx.compose.ui.unit.dp
import kotlin.math.abs
internal val TvHomeFocusedItemTopOffset = 42.dp
internal val TvHomeFocusedItemTopOffset = 48.dp
internal val TvHomeBringIntoViewTrailingSpace = 120.dp
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.gestures.LocalBringIntoViewSpec
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
@@ -66,11 +67,9 @@ fun TvHomeContent(
.fillMaxSize()
.background(scheme.background)
.focusRequester(initialFocusRequester),
verticalArrangement = Arrangement.spacedBy(24.dp),
contentPadding = contentPadding
) {
item(key = "tv-home-top-spacer") {
Spacer(modifier = Modifier.height(8.dp))
}
if (hasContinueWatching) {
item(key = "tv-home-continue-watching") {
TvContinueWatchingSection(

View File

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