From a0198caf30c61f76435468fd38b3b682f3c6f2a1 Mon Sep 17 00:00:00 2001 From: Jonas Kalderstam Date: Fri, 20 Dec 2024 01:16:16 +0100 Subject: [PATCH] fixed tablet being hardcoded to card article style Signed-off-by: Jonas Kalderstam --- .../feeder/ui/compose/feed/FeedScreen.kt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feed/FeedScreen.kt b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feed/FeedScreen.kt index aeea23a3e..fc706169a 100644 --- a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feed/FeedScreen.kt +++ b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feed/FeedScreen.kt @@ -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) @@ -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 @@ -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,