Skip to content

Commit 17ae426

Browse files
Adjusted row count calculation and ensure non-negative vertical padding in LibraryBrowseFragment
- Fixes #353
1 parent bc780fc commit 17ae426

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/src/main/java/org/jellyfin/androidtv/ui/browsing/v2/LibraryBrowseFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,9 @@ class LibraryBrowseFragment : Fragment() {
531531
BoxWithConstraints(modifier = modifier.fillMaxSize()) {
532532
val availableHeight = maxHeight - minPadding * 2
533533
val cellHeight = cardHeight.dp + 16.dp
534-
val rowCount = (availableHeight / cellHeight).toInt().coerceAtLeast(2)
534+
val rowCount = (availableHeight / cellHeight).toInt().coerceAtLeast(1)
535535
val gridHeight = cardHeight.dp * rowCount + 16.dp * (rowCount - 1)
536-
val verticalPadding = (maxHeight - gridHeight) / 2
536+
val verticalPadding = ((maxHeight - gridHeight) / 2).coerceAtLeast(0.dp)
537537

538538
LazyHorizontalGrid(
539539
rows = GridCells.Fixed(rowCount),

0 commit comments

Comments
 (0)