diff --git a/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/AtomContentParser.kt b/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/AtomContentParser.kt index e567948cd..af42afa80 100644 --- a/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/AtomContentParser.kt +++ b/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/AtomContentParser.kt @@ -27,6 +27,7 @@ import dev.sasikanth.rss.reader.core.network.parser.FeedParser.Companion.TAG_CON import dev.sasikanth.rss.reader.core.network.parser.FeedParser.Companion.TAG_LINK import dev.sasikanth.rss.reader.core.network.parser.FeedParser.Companion.TAG_PUBLISHED import dev.sasikanth.rss.reader.core.network.parser.FeedParser.Companion.TAG_SUBTITLE +import dev.sasikanth.rss.reader.core.network.parser.FeedParser.Companion.TAG_SUMMARY import dev.sasikanth.rss.reader.core.network.parser.FeedParser.Companion.TAG_TITLE import dev.sasikanth.rss.reader.core.network.parser.FeedParser.Companion.TAG_UPDATED import io.ktor.http.Url @@ -115,7 +116,8 @@ internal object AtomContentParser : ContentParser() { skip(parser) } } - TAG_CONTENT -> { + TAG_CONTENT, + TAG_SUMMARY -> { rawContent = readTagText(tagName, parser).trimIndent() val htmlContent = HtmlContentParser.parse(htmlContent = rawContent) diff --git a/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/FeedParser.kt b/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/FeedParser.kt index 15d0bb17f..bcd1e9101 100644 --- a/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/FeedParser.kt +++ b/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/FeedParser.kt @@ -86,6 +86,7 @@ class FeedParser(private val dispatchersProvider: DispatchersProvider) { internal const val TAG_ENCLOSURE = "enclosure" internal const val TAG_CONTENT_ENCODED = "content:encoded" internal const val TAG_CONTENT = "content" + internal const val TAG_SUMMARY = "summary" internal const val TAG_SUBTITLE = "subtitle" internal const val TAG_PUB_DATE = "pubDate" internal const val TAG_PUBLISHED = "published" diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/feed/ui/FeedInfoBottomSheet.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/feed/ui/FeedInfoBottomSheet.kt index 86b6c0f9e..f2d4c6095 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/feed/ui/FeedInfoBottomSheet.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/feed/ui/FeedInfoBottomSheet.kt @@ -80,6 +80,11 @@ fun FeedInfoBottomSheet( } } + // Doing this before `ModalBottomSheet` as this value is not available + // after `ModalSheetConsumes` insets, I think? It's returning 0 when + // I do this inside `ModalBottomSheet`. + val systemBarsBottomPadding = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding() + ModalBottomSheet( modifier = Modifier.then(modifier), onDismissRequest = { feedPresenter.dispatch(FeedEvent.BackClicked) }, @@ -92,9 +97,7 @@ fun FeedInfoBottomSheet( modifier = Modifier.fillMaxWidth() .padding(horizontal = 24.dp) - .padding( - bottom = 16.dp + WindowInsets.systemBars.asPaddingValues().calculateBottomPadding() - ) + .padding(bottom = 16.dp + systemBarsBottomPadding) ) { Spacer(Modifier.requiredHeight(8.dp)) diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt index 46eb7ce73..9cb69efab 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt @@ -258,7 +258,7 @@ class HomePresenter( } val posts = - createPager(config = createPagingConfig(pageSize = 20, enablePlaceholders = false)) { + createPager(config = createPagingConfig(pageSize = 20, enablePlaceholders = true)) { rssRepository.posts( selectedFeedLink = selectedFeed?.link, unreadOnly = unreadOnly, diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/PostList.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/PostList.kt index 74660f1c4..d275207ca 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/PostList.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/PostList.kt @@ -18,6 +18,7 @@ package dev.sasikanth.rss.reader.home.ui import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row @@ -25,6 +26,7 @@ import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.WindowInsetsSides import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.requiredHeight import androidx.compose.foundation.layout.requiredSize import androidx.compose.foundation.layout.systemBars import androidx.compose.foundation.layout.windowInsetsPadding @@ -115,13 +117,15 @@ internal fun PostsList( onPostSourceClick = { onPostSourceClick(post.feedLink) }, togglePostReadClick = { onTogglePostReadClick(post.link, post.read) } ) + } else { + Box(Modifier.requiredHeight(132.dp)) + } - if (index != posts.itemCount - 1) { - Divider( - modifier = Modifier.fillParentMaxWidth().padding(horizontal = 24.dp), - color = AppTheme.colorScheme.surfaceContainer - ) - } + if (index != posts.itemCount - 1) { + Divider( + modifier = Modifier.fillParentMaxWidth().padding(horizontal = 24.dp), + color = AppTheme.colorScheme.surfaceContainer + ) } } } diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/settings/ui/SettingsScreen.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/settings/ui/SettingsScreen.kt index b6eaf3a38..27031a928 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/settings/ui/SettingsScreen.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/settings/ui/SettingsScreen.kt @@ -15,6 +15,7 @@ */ package dev.sasikanth.rss.reader.settings.ui +import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -338,17 +339,25 @@ private fun PostsDeletionPeriodSettingItem( ONE_YEAR -> LocalStrings.current.settingsPostsDeletionPeriodOneYear } + val backgroundColor = + if (period == postsDeletionPeriod) { + AppTheme.colorScheme.tintedSurface + } else { + Color.Unspecified + } + DropdownMenuItem( onClick = { onValueChanged(period) showDropdown = false - } + }, + modifier = Modifier.background(backgroundColor) ) { val textColor = if (period == postsDeletionPeriod) { - AppTheme.colorScheme.tintedForeground - } else { AppTheme.colorScheme.onSurface + } else { + AppTheme.colorScheme.textEmphasisHigh } Text(text = periodString, style = MaterialTheme.typography.bodyLarge, color = textColor)