mirror of https://github.com/readrops/Readrops.git
Add compact option in TimelineItem
This commit is contained in:
parent
698abfe32b
commit
16ed0ef05e
|
@ -42,10 +42,12 @@ fun TimelineItem(
|
||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
onFavorite: () -> Unit,
|
onFavorite: () -> Unit,
|
||||||
onReadLater: () -> Unit,
|
onReadLater: () -> Unit,
|
||||||
onShare: () -> Unit
|
onShare: () -> Unit,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
compactLayout: Boolean = false,
|
||||||
) {
|
) {
|
||||||
Card(
|
Card(
|
||||||
modifier = Modifier
|
modifier = modifier
|
||||||
.padding(horizontal = MaterialTheme.spacing.shortSpacing)
|
.padding(horizontal = MaterialTheme.spacing.shortSpacing)
|
||||||
.clickable { onClick() }
|
.clickable { onClick() }
|
||||||
) {
|
) {
|
||||||
|
@ -148,7 +150,7 @@ fun TimelineItem(
|
||||||
|
|
||||||
ShortSpacer()
|
ShortSpacer()
|
||||||
|
|
||||||
if (itemWithFeed.item.cleanDescription != null) {
|
if (itemWithFeed.item.cleanDescription != null && !compactLayout) {
|
||||||
Text(
|
Text(
|
||||||
text = itemWithFeed.item.cleanDescription!!,
|
text = itemWithFeed.item.cleanDescription!!,
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
@ -160,7 +162,7 @@ fun TimelineItem(
|
||||||
ShortSpacer()
|
ShortSpacer()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemWithFeed.item.imageLink != null) {
|
if (itemWithFeed.item.hasImage && !compactLayout) {
|
||||||
AsyncImage(
|
AsyncImage(
|
||||||
model = itemWithFeed.item.imageLink,
|
model = itemWithFeed.item.imageLink,
|
||||||
contentDescription = itemWithFeed.item.title!!,
|
contentDescription = itemWithFeed.item.title!!,
|
||||||
|
|
Loading…
Reference in New Issue