From 71e37f85cb4aae102a83bd20e2952d70b9370d1c Mon Sep 17 00:00:00 2001 From: "tramline-github[bot]" <98346001+tramline-github[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:01:17 +0530 Subject: [PATCH] [1.48.1] Post-release merge (#718) * Center align posts filter and mark all as read button contents * Handle nullable seed colors --------- Co-authored-by: Sasikanth Miriyampalli --- .../sasikanth/rss/reader/home/ui/FeaturedSection.kt | 11 +++++++++-- .../dev/sasikanth/rss/reader/home/ui/HomeTopAppBar.kt | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/FeaturedSection.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/FeaturedSection.kt index c35a38f28..8028cd0d0 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/FeaturedSection.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/FeaturedSection.kt @@ -116,6 +116,8 @@ internal fun FeaturedSection( systemBarsEndPadding } + val defaultSeedColor = AppTheme.colorScheme.tintedForeground + LaunchedEffect(pagerState, featuredPosts) { snapshotFlow { val settledPage = pagerState.settledPage @@ -148,9 +150,14 @@ internal fun FeaturedSection( currentItem } + val fromSeedColor = + fromItem.seedColor.run { if (this != null) Color(this) else defaultSeedColor } + val toSeedColor = + toItem.seedColor.run { if (this != null) Color(this) else defaultSeedColor } + dynamicColorState.animate( - fromSeedColor = Color(fromItem.seedColor!!), - toSeedColor = Color(toItem.seedColor!!), + fromSeedColor = fromSeedColor, + toSeedColor = toSeedColor, progress = offset ) } diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/HomeTopAppBar.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/HomeTopAppBar.kt index b174812b9..4ad8a0d23 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/HomeTopAppBar.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/HomeTopAppBar.kt @@ -254,6 +254,7 @@ private fun MarkPostsAsReadButton( .padding(vertical = 4.dp) .padding(start = 8.dp, end = 12.dp), horizontalArrangement = Arrangement.spacedBy(8.dp), + verticalAlignment = Alignment.CenterVertically, ) { CompositionLocalProvider(LocalContentColor provides contentColor) { Text( @@ -288,6 +289,7 @@ private fun PostsFilterButton( .padding(vertical = 4.dp) .padding(start = 8.dp, end = 12.dp), horizontalArrangement = Arrangement.spacedBy(8.dp), + verticalAlignment = Alignment.CenterVertically, ) { val postsTypeLabel = getPostTypeLabel(postsType)