Skip to content

Commit

Permalink
fixed tablet being hardcoded to card article style
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Kalderstam <jonas@cowboyprogrammer.org>
  • Loading branch information
spacecowboy committed Dec 20, 2024
1 parent d59fe0f commit 49f3008
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1367,14 +1367,8 @@ fun FeedGridContent(
)
}

// Grid has hard-coded card
val feedItemStyle =
remember {
FeedItemStyle.CARD
}

val arrangement =
when (feedItemStyle) {
when (viewState.feedItemStyle) {
FeedItemStyle.CARD -> Arrangement.spacedBy(LocalDimens.current.gutter)
FeedItemStyle.COMPACT_CARD -> Arrangement.spacedBy(LocalDimens.current.gutter)
FeedItemStyle.COMPACT -> Arrangement.spacedBy(LocalDimens.current.gutter)
Expand Down Expand Up @@ -1405,7 +1399,7 @@ fun FeedGridContent(
items(
count = pagedFeedItems.itemCount,
key = pagedFeedItems.itemKey { it.id },
contentType = pagedFeedItems.itemContentType { it.contentType(feedItemStyle) },
contentType = pagedFeedItems.itemContentType { it.contentType(viewState.feedItemStyle) },
) { itemIndex ->
val previewItem = pagedFeedItems[itemIndex] ?: PLACEHOLDER_ITEM

Expand Down Expand Up @@ -1436,7 +1430,7 @@ fun FeedGridContent(
filter = viewState.filter,
item = previewItem,
showThumbnail = viewState.showThumbnails,
feedItemStyle = feedItemStyle,
feedItemStyle = viewState.feedItemStyle,
swipeAsRead = viewState.swipeAsRead,
bookmarkIndicator = !viewState.currentFeedOrTag.isSavedArticles,
maxLines = viewState.maxLines,
Expand Down

0 comments on commit 49f3008

Please sign in to comment.