Skip to content

Commit

Permalink
[1.64.*] Pre-release merge (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
tramline-github[bot] authored Feb 7, 2024
2 parents 56aa78b + 8760996 commit 12d4f25
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand All @@ -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))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ 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
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
Expand Down Expand Up @@ -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
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 12d4f25

Please sign in to comment.