Skip to content

Commit

Permalink
fix #1511 again
Browse files Browse the repository at this point in the history
z-huang committed Aug 31, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 18deb83 commit 2354cc7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -418,16 +418,18 @@ fun HomeScreen(
title = stringResource(R.string.forgotten_favorites)
)

// take min in case list size is less than 4
val rows = min(4, forgottenFavorites.size)
LazyHorizontalGrid(
state = forgottenFavoritesLazyGridState,
rows = GridCells.Fixed(min(4, forgottenFavorites.size)), // take min in case list size is less than 4
rows = GridCells.Fixed(rows),
flingBehavior = rememberSnapFlingBehavior(forgottenFavoritesSnapLayoutInfoProvider),
contentPadding = WindowInsets.systemBars
.only(WindowInsetsSides.Horizontal)
.asPaddingValues(),
modifier = Modifier
.fillMaxWidth()
.height(ListItemHeight * 4)
.height(ListItemHeight * rows)
) {
items(
items = forgottenFavorites,

0 comments on commit 2354cc7

Please sign in to comment.