From 16ed0ef05e205a09b3ece5fbd9c18a7591246aa5 Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Mon, 21 Aug 2023 18:46:37 +0200 Subject: [PATCH] Add compact option in TimelineItem --- .../com/readrops/app/compose/timelime/TimelineItem.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/appcompose/src/main/java/com/readrops/app/compose/timelime/TimelineItem.kt b/appcompose/src/main/java/com/readrops/app/compose/timelime/TimelineItem.kt index 0bdd4e28..bbc4e56e 100644 --- a/appcompose/src/main/java/com/readrops/app/compose/timelime/TimelineItem.kt +++ b/appcompose/src/main/java/com/readrops/app/compose/timelime/TimelineItem.kt @@ -42,10 +42,12 @@ fun TimelineItem( onClick: () -> Unit, onFavorite: () -> Unit, onReadLater: () -> Unit, - onShare: () -> Unit + onShare: () -> Unit, + modifier: Modifier = Modifier, + compactLayout: Boolean = false, ) { Card( - modifier = Modifier + modifier = modifier .padding(horizontal = MaterialTheme.spacing.shortSpacing) .clickable { onClick() } ) { @@ -148,7 +150,7 @@ fun TimelineItem( ShortSpacer() - if (itemWithFeed.item.cleanDescription != null) { + if (itemWithFeed.item.cleanDescription != null && !compactLayout) { Text( text = itemWithFeed.item.cleanDescription!!, style = MaterialTheme.typography.bodyMedium, @@ -160,7 +162,7 @@ fun TimelineItem( ShortSpacer() } - if (itemWithFeed.item.imageLink != null) { + if (itemWithFeed.item.hasImage && !compactLayout) { AsyncImage( model = itemWithFeed.item.imageLink, contentDescription = itemWithFeed.item.title!!,