From 0dbd563eecfab686f9fe2d525110723233491b83 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Thu, 24 Nov 2022 17:48:01 +0530 Subject: [PATCH 01/18] Extract podcast cover to compose components (cherry picked from commit 4fa25832ba76a8a6d763015e77ecc2ad67d35fd8) --- .../views/stories/StoryListenedCategoriesView.kt | 6 +++--- .../endofyear/views/stories/StoryListenedNumbersView.kt | 4 ++-- .../endofyear/views/stories/StoryListeningTimeView.kt | 6 +++--- .../endofyear/views/stories/StoryLongestEpisodeView.kt | 8 ++++---- .../endofyear/views/stories/StoryTopPodcastView.kt | 8 ++++---- .../pocketcasts/compose}/components/PodcastCover.kt | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) rename modules/{features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear => services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose}/components/PodcastCover.kt (91%) diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt index 742b4d2f828..419124bd70c 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt @@ -17,12 +17,12 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.intl.Locale import androidx.compose.ui.unit.dp -import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastCover -import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastCoverType +import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCover +import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCoverType +import au.com.shiftyjelly.pocketcasts.compose.components.transformPodcastCover import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastLogoWhite import au.com.shiftyjelly.pocketcasts.endofyear.components.StoryPrimaryText import au.com.shiftyjelly.pocketcasts.endofyear.components.StorySecondaryText -import au.com.shiftyjelly.pocketcasts.endofyear.components.transformPodcastCover import au.com.shiftyjelly.pocketcasts.endofyear.utils.podcastDynamicBackground import au.com.shiftyjelly.pocketcasts.repositories.endofyear.stories.StoryListenedCategories import au.com.shiftyjelly.pocketcasts.utils.extensions.pxToDp diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt index c055a384452..ea81cca4ad3 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt @@ -19,11 +19,11 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.intl.Locale import androidx.compose.ui.unit.dp -import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastCover +import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCover +import au.com.shiftyjelly.pocketcasts.compose.components.transformPodcastCover import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastLogoWhite import au.com.shiftyjelly.pocketcasts.endofyear.components.StoryPrimaryText import au.com.shiftyjelly.pocketcasts.endofyear.components.StorySecondaryText -import au.com.shiftyjelly.pocketcasts.endofyear.components.transformPodcastCover import au.com.shiftyjelly.pocketcasts.endofyear.utils.podcastDynamicBackground import au.com.shiftyjelly.pocketcasts.localization.R import au.com.shiftyjelly.pocketcasts.models.db.helper.TopPodcast diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListeningTimeView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListeningTimeView.kt index df02359d564..8bc05597429 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListeningTimeView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListeningTimeView.kt @@ -19,12 +19,12 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.intl.Locale import androidx.compose.ui.unit.dp -import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastCover -import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastCoverType +import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCover +import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCoverType +import au.com.shiftyjelly.pocketcasts.compose.components.transformPodcastCover import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastLogoWhite import au.com.shiftyjelly.pocketcasts.endofyear.components.StoryPrimaryText import au.com.shiftyjelly.pocketcasts.endofyear.components.StorySecondaryText -import au.com.shiftyjelly.pocketcasts.endofyear.components.transformPodcastCover import au.com.shiftyjelly.pocketcasts.endofyear.utils.podcastDynamicBackground import au.com.shiftyjelly.pocketcasts.repositories.endofyear.stories.StoryListeningTime import au.com.shiftyjelly.pocketcasts.settings.stats.StatsHelper diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt index e47edd1154f..796f5d6e512 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt @@ -17,13 +17,13 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastCover -import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastCoverType +import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCover +import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCoverType +import au.com.shiftyjelly.pocketcasts.compose.components.RectangleCover +import au.com.shiftyjelly.pocketcasts.compose.components.transformPodcastCover import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastLogoWhite -import au.com.shiftyjelly.pocketcasts.endofyear.components.RectangleCover import au.com.shiftyjelly.pocketcasts.endofyear.components.StoryPrimaryText import au.com.shiftyjelly.pocketcasts.endofyear.components.StorySecondaryText -import au.com.shiftyjelly.pocketcasts.endofyear.components.transformPodcastCover import au.com.shiftyjelly.pocketcasts.endofyear.utils.podcastDynamicBackground import au.com.shiftyjelly.pocketcasts.localization.R import au.com.shiftyjelly.pocketcasts.repositories.endofyear.stories.StoryLongestEpisode diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt index 91d2d74d5af..6bdfe16022d 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt @@ -17,13 +17,13 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastCover -import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastCoverType +import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCover +import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCoverType +import au.com.shiftyjelly.pocketcasts.compose.components.RectangleCover +import au.com.shiftyjelly.pocketcasts.compose.components.transformPodcastCover import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastLogoWhite -import au.com.shiftyjelly.pocketcasts.endofyear.components.RectangleCover import au.com.shiftyjelly.pocketcasts.endofyear.components.StoryPrimaryText import au.com.shiftyjelly.pocketcasts.endofyear.components.StorySecondaryText -import au.com.shiftyjelly.pocketcasts.endofyear.components.transformPodcastCover import au.com.shiftyjelly.pocketcasts.endofyear.utils.podcastDynamicBackground import au.com.shiftyjelly.pocketcasts.localization.R import au.com.shiftyjelly.pocketcasts.repositories.endofyear.stories.StoryTopPodcast diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/components/PodcastCover.kt b/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastCover.kt similarity index 91% rename from modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/components/PodcastCover.kt rename to modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastCover.kt index 53968f9d7a3..66e27e4bad2 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/components/PodcastCover.kt +++ b/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastCover.kt @@ -1,10 +1,11 @@ -package au.com.shiftyjelly.pocketcasts.endofyear.components +package au.com.shiftyjelly.pocketcasts.compose.components import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Card +import androidx.compose.material.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.draw.drawWithContent @@ -12,7 +13,6 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.drawscope.withTransform import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp -import au.com.shiftyjelly.pocketcasts.compose.components.PodcastImage @Composable fun PodcastCover( @@ -31,8 +31,8 @@ fun PodcastCover( @Composable fun RectangleCover( coverWidth: Dp, - backgroundColor: Color, modifier: Modifier = Modifier, + backgroundColor: Color = MaterialTheme.colors.surface, ) { Box( modifier = modifier.size(coverWidth) From 8f4efe347c9fe0486bc76849df6aec074e06198f Mon Sep 17 00:00:00 2001 From: ashiagr Date: Tue, 29 Nov 2022 10:40:16 +0530 Subject: [PATCH 02/18] Cherry pick rectangle cover changes from main --- .../compose/components/PodcastCover.kt | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastCover.kt b/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastCover.kt index 66e27e4bad2..955e9d80e93 100644 --- a/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastCover.kt +++ b/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastCover.kt @@ -1,7 +1,7 @@ package au.com.shiftyjelly.pocketcasts.compose.components -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.fillMaxSize +import androidx.annotation.DrawableRes +import androidx.compose.foundation.Image import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Card @@ -11,6 +11,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.drawWithContent import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.drawscope.withTransform +import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp @@ -33,21 +34,30 @@ fun RectangleCover( coverWidth: Dp, modifier: Modifier = Modifier, backgroundColor: Color = MaterialTheme.colors.surface, + @DrawableRes imageResId: Int? = null, ) { - Box( + val elevation = when { + coverWidth <= 50.dp -> 1.dp + coverWidth <= 200.dp -> 2.dp + else -> 4.dp + } + val cornerRadiusSize = when { + coverWidth <= 50.dp -> 2.dp + coverWidth <= 200.dp -> 4.dp + else -> 8.dp + } + Card( + elevation = elevation, + shape = RoundedCornerShape(cornerRadiusSize), + backgroundColor = backgroundColor, modifier = modifier.size(coverWidth) ) { - val elevation = when { - coverWidth <= 50.dp -> 1.dp - coverWidth <= 200.dp -> 2.dp - else -> 4.dp + imageResId?.let { + Image( + painter = painterResource(it), + contentDescription = null, + ) } - Card( - elevation = elevation, - shape = RoundedCornerShape(8.dp), - backgroundColor = backgroundColor, - modifier = modifier.fillMaxSize() - ) {} } } From 1c1e37e4938269da007e22bb393e8fc79a421116 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Tue, 29 Nov 2022 11:51:15 +0530 Subject: [PATCH 03/18] Increase elevation --- .../stories/StoryListenedCategoriesView.kt | 4 ++-- .../views/stories/StoryListeningTimeView.kt | 4 ++-- .../views/stories/StoryLongestEpisodeView.kt | 4 ++-- .../views/stories/StoryTopPodcastView.kt | 4 ++-- .../compose/components/PodcastCover.kt | 20 +++++++------------ .../compose/components/PodcastImage.kt | 5 +++-- 6 files changed, 18 insertions(+), 23 deletions(-) diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt index 419124bd70c..06925f2fa03 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt @@ -17,8 +17,8 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.intl.Locale import androidx.compose.ui.unit.dp +import au.com.shiftyjelly.pocketcasts.compose.components.CoverSize import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCover -import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCoverType import au.com.shiftyjelly.pocketcasts.compose.components.transformPodcastCover import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastLogoWhite import au.com.shiftyjelly.pocketcasts.endofyear.components.StoryPrimaryText @@ -83,7 +83,7 @@ private fun PodcastCoverStack( PodcastCover( uuid = story.listenedCategories[podcastIndex].mostListenedPodcastId, coverWidth = coverWidth, - coverType = PodcastCoverType.BIG + coverSize = CoverSize.BIG ) } } diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListeningTimeView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListeningTimeView.kt index 8bc05597429..3c134ef007b 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListeningTimeView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListeningTimeView.kt @@ -19,8 +19,8 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.intl.Locale import androidx.compose.ui.unit.dp +import au.com.shiftyjelly.pocketcasts.compose.components.CoverSize import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCover -import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCoverType import au.com.shiftyjelly.pocketcasts.compose.components.transformPodcastCover import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastLogoWhite import au.com.shiftyjelly.pocketcasts.endofyear.components.StoryPrimaryText @@ -120,7 +120,7 @@ private fun PodcastCoverRow( PodcastCover( uuid = story.podcasts[podcastIndex].uuid, coverWidth = coverWidth, - coverType = PodcastCoverType.SMALL + coverSize = CoverSize.SMALL ) Spacer(modifier = modifier.width(5.dp)) } diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt index 796f5d6e512..4cee40e2d72 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt @@ -17,8 +17,8 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import au.com.shiftyjelly.pocketcasts.compose.components.CoverSize import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCover -import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCoverType import au.com.shiftyjelly.pocketcasts.compose.components.RectangleCover import au.com.shiftyjelly.pocketcasts.compose.components.transformPodcastCover import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastLogoWhite @@ -86,7 +86,7 @@ private fun PodcastCoverStack( 0 -> PodcastCover( uuid = podcastUuid, coverWidth = coverWidth, - coverType = PodcastCoverType.BIG + coverSize = CoverSize.BIG ) 1 -> { diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt index 6bdfe16022d..9280eef0e8a 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt @@ -17,8 +17,8 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import au.com.shiftyjelly.pocketcasts.compose.components.CoverSize import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCover -import au.com.shiftyjelly.pocketcasts.compose.components.PodcastCoverType import au.com.shiftyjelly.pocketcasts.compose.components.RectangleCover import au.com.shiftyjelly.pocketcasts.compose.components.transformPodcastCover import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastLogoWhite @@ -86,7 +86,7 @@ private fun PodcastCoverStack( 0 -> PodcastCover( uuid = uuid, coverWidth = coverWidth, - coverType = PodcastCoverType.BIG + coverSize = CoverSize.BIG ) 1 -> { diff --git a/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastCover.kt b/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastCover.kt index 955e9d80e93..777c87fbb6d 100644 --- a/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastCover.kt +++ b/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastCover.kt @@ -20,11 +20,12 @@ fun PodcastCover( uuid: String, coverWidth: Dp, modifier: Modifier = Modifier, - coverType: PodcastCoverType = PodcastCoverType.SMALL, + coverSize: CoverSize = CoverSize.SMALL, ) { PodcastImage( uuid = uuid, - cornerSize = if (coverType == PodcastCoverType.SMALL) 4.dp else 8.dp, + elevation = if (coverSize == CoverSize.SMALL) 4.dp else 8.dp, + cornerSize = if (coverSize == CoverSize.SMALL) 4.dp else 8.dp, modifier = modifier.size(coverWidth) ) } @@ -35,17 +36,10 @@ fun RectangleCover( modifier: Modifier = Modifier, backgroundColor: Color = MaterialTheme.colors.surface, @DrawableRes imageResId: Int? = null, + coverSize: CoverSize = CoverSize.BIG, ) { - val elevation = when { - coverWidth <= 50.dp -> 1.dp - coverWidth <= 200.dp -> 2.dp - else -> 4.dp - } - val cornerRadiusSize = when { - coverWidth <= 50.dp -> 2.dp - coverWidth <= 200.dp -> 4.dp - else -> 8.dp - } + val elevation = if (coverSize == CoverSize.SMALL) 4.dp else 8.dp + val cornerRadiusSize = if (coverSize == CoverSize.SMALL) 4.dp else 8.dp Card( elevation = elevation, shape = RoundedCornerShape(cornerRadiusSize), @@ -72,7 +66,7 @@ fun Modifier.transformPodcastCover() = } } -enum class PodcastCoverType { +enum class CoverSize { SMALL, BIG } diff --git a/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastImage.kt b/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastImage.kt index 5a6413d1050..f391de01096 100644 --- a/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastImage.kt +++ b/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastImage.kt @@ -40,17 +40,18 @@ fun PodcastImage( roundCorners: Boolean = true, dropShadow: Boolean = true, cornerSize: Dp? = null, + elevation: Dp? = null, ) { BoxWithConstraints(modifier = modifier) { val corners = if (roundCorners) cornerSize ?: podcastImageCornerSize(maxWidth) else null if (dropShadow) { - val elevation = when { + val finalElevation = elevation ?: when { maxWidth <= 50.dp -> 1.dp maxWidth <= 200.dp -> 2.dp else -> 4.dp } Card( - elevation = elevation, + elevation = finalElevation, shape = if (corners == null) RectangleShape else RoundedCornerShape(corners), backgroundColor = Color.Transparent, modifier = Modifier.fillMaxSize() From 3f91f95cddcffe636d1141162c6064c6e61b3f61 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Tue, 29 Nov 2022 13:17:28 +0530 Subject: [PATCH 04/18] Update translations --- .../src/main/res/values-fr-rCA/strings.xml | 18 +++++++++++++++ .../src/main/res/values-fr/strings.xml | 20 ++++++++++++++++- .../src/main/res/values-it/strings.xml | 22 ++++++++++++++++++- .../src/main/res/values-pt-rBR/strings.xml | 4 +++- .../src/main/res/values-ru/strings.xml | 20 ++++++++++++++++- .../src/main/res/values-sv/strings.xml | 17 +++++++++++++- 6 files changed, 96 insertions(+), 5 deletions(-) diff --git a/modules/services/localization/src/main/res/values-fr-rCA/strings.xml b/modules/services/localization/src/main/res/values-fr-rCA/strings.xml index 043f558b2f7..072020a99dd 100644 --- a/modules/services/localization/src/main/res/values-fr-rCA/strings.xml +++ b/modules/services/localization/src/main/res/values-fr-rCA/strings.xml @@ -6,6 +6,23 @@ Generator: GlotPress/2.4.0-alpha Language: fr_CA --> + Trouver des podcasts + Trouver mon prochain podcast + Découvrez des podcasts tendance et d’autres passés inaperçus sur notre page des découvertes sélectionnées avec soin. + Découvrir quelque chose de nouveau + Merci. Maintenant, commencez à écouter du contenu ! + Merci. Maintenant, commencez à écouter du contenu ! + Les paiements récurrents commenceront après que vous %s + Commencer l’essai gratuit et s’abonner + Conditions générales + Politique de confidentialité + En poursuivant, vous acceptez nos %1$s et notre %2$s. + Devenir un membre Plus et profiter de toutes les fonctionnalités de Pocket Casts + S’inscrire + Créer un compte + Se connecter + Essai gratuit %s + Impossible de charger vos stories de fin d’année. Vérifiez votre connexion Internet. Affichez vos véritables couleurs. Des icônes et des thèmes exclusifs pour le club Plus uniquement. Thèmes et icônes Une expérience sans publicité qui vous permet de profiter encore plus de ce que vous aimez et qui évite ce qui ne vous intéresse pas. @@ -36,6 +53,7 @@ Language: fr_CA Mes catégories de podcasts les plus écoutés Vos meilleures catégories N’oubliez pas de partager avec vos amis et de mettre en lumière vos créateurs de podcasts préférés. + Merci d’avoir utilisé Pocket Casts pour écouter vos podcasts en 2022. L\'épisode le plus long que j\'ai écouté en 2022 %1$s La durée de cet épisode était de %1$s L’épisode le plus long que vous avez écouté durait %1$s et provient du podcast %2$s diff --git a/modules/services/localization/src/main/res/values-fr/strings.xml b/modules/services/localization/src/main/res/values-fr/strings.xml index 2a596d65718..f11d39abe55 100644 --- a/modules/services/localization/src/main/res/values-fr/strings.xml +++ b/modules/services/localization/src/main/res/values-fr/strings.xml @@ -1,11 +1,28 @@ + Trouver des podcasts + Trouver mon prochain podcast + Découvrez des podcasts tendance et d’autres passés inaperçus sur notre page des découvertes sélectionnées avec soin. + Découvrir quelque chose de nouveau + Merci. Maintenant, commencez à écouter du contenu ! + Merci. Maintenant, commencez à écouter du contenu ! + Les paiements récurrents commenceront après que vous %s + Commencer l’essai gratuit et s’abonner + Conditions générales + Politique de confidentialité + En poursuivant, vous acceptez nos %1$s et notre %2$s. + Devenir un membre Plus et profiter de toutes les fonctionnalités de Pocket Casts + S’inscrire + Créer un compte + Se connecter + Essai gratuit %s + Impossible de charger vos stories de fin d’année. Vérifiez votre connexion Internet. Affichez vos véritables couleurs. Des icônes et des thèmes exclusifs pour le club Plus uniquement. Thèmes et icônes Une expérience sans publicité qui vous permet de profiter encore plus de ce que vous aimez et qui évite ce qui ne vous intéresse pas. @@ -36,6 +53,7 @@ Language: fr Mes catégories de podcasts les plus écoutés Vos meilleures catégories N’oubliez pas de partager avec vos amis et de mettre en lumière vos créateurs de podcasts préférés. + Merci d’avoir utilisé Pocket Casts pour écouter vos podcasts en 2022. L\'épisode le plus long que j\'ai écouté en 2022 %1$s La durée de cet épisode était de %1$s L’épisode le plus long que vous avez écouté durait %1$s et provient du podcast %2$s diff --git a/modules/services/localization/src/main/res/values-it/strings.xml b/modules/services/localization/src/main/res/values-it/strings.xml index 64bddcf0560..507864e4fbb 100644 --- a/modules/services/localization/src/main/res/values-it/strings.xml +++ b/modules/services/localization/src/main/res/values-it/strings.xml @@ -1,11 +1,28 @@ + Trova Podcast + Trova il mio prossimo podcast + Trova podcast nascosti e di tendenza nella nostra pagina Discover selezionata. + Scopri qualcosa di nuovo + Grazie, ora mettiamoci all\'ascolto! + Benvenuto, ora mettiamoci all\'ascolto! + I pagamenti ricorrenti inizieranno dopo il %s + Inizia la prova gratuita e abbonati + Termini e condizioni + Politica sulla privacy + Continuando accetti i nostri %1$s e %2$s. + Diventa un membro Plus e sblocca tutte le funzionalità Pocket Casts + Registrati + Crea account + Accesso + Periodo di prova %s + Impossibile caricare le storie della fine dell\'anno, controlla la connessione Internet. Mostra i tuoi reali colori. Icone e temi esclusivi solo per chi fa parte del club Plus. Temi e icone Esperienza senza pubblicità che offre più di ciò che ami e meno di ciò che non ti piace. @@ -16,11 +33,13 @@ Language: it Cartelle Ascolta da più postazioni con le app per Windows, macOS e web. App per desktop + Sblocca tutte le funzionalità Ottieni l\'accesso a esclusive funzionalità e opzioni di personalizzazione Tutto ciò che ti piace di Pocket Casts e molto altro Importa Personalizza Pocket Casts selezionando i tuoi podcast preferiti o importali da un altro Podcast Player. Puoi eseguire questa azione in un secondo momento. Trova i tuoi podcast preferiti + Non ora Se attivo, il lettore a schermo intero si aprirà quando inizierai ad ascoltare un episodio del podcast. Apri automaticamente il lettore Inserisci una email valida @@ -34,6 +53,7 @@ Language: it I più ascoltati nelle categorie podcast Categorie migliori Non dimenticare di condividere con i tuoi amici e ringrazia i creatori dei tuoi podcast preferiti + Grazie per aver permesso a Pocket Casts di far parte della tua esperienza di ascolto nel 2022 L\'episodio più lungo ascoltato nel 2022 %1$s Questo episodio è durato %1$s L\'episodio più lungo che hai ascoltato è stato di %1$s del podcast %2$s diff --git a/modules/services/localization/src/main/res/values-pt-rBR/strings.xml b/modules/services/localization/src/main/res/values-pt-rBR/strings.xml index 495882b5ecf..6455822f1f7 100644 --- a/modules/services/localization/src/main/res/values-pt-rBR/strings.xml +++ b/modules/services/localization/src/main/res/values-pt-rBR/strings.xml @@ -1,11 +1,12 @@ + Unable to load your end of year stories, check your internet connection. Expresse sua individualidade. Temas e ícones exclusivos para o Plus. Temas e ícones Experiência sem publicidade, que se alinha mais ao seu gosto. @@ -36,6 +37,7 @@ Language: pt_BR Categorias dos podcasts que mais ouvi Suas principais categorias Não esqueça de compartilhar com seus amigos e agradecer a seus criadores favoritos + Obrigado por deixar o Pocket Casts ser uma parte da sua experiência sonora em 2022 O episódio mais longo que eu ouvi em 2022 %1$s Esse episódio tinha %1$s O maior episódio que você ouviu foi %1$s do podcast %2$s diff --git a/modules/services/localization/src/main/res/values-ru/strings.xml b/modules/services/localization/src/main/res/values-ru/strings.xml index 0ef587df0e7..5eb1f7445cb 100644 --- a/modules/services/localization/src/main/res/values-ru/strings.xml +++ b/modules/services/localization/src/main/res/values-ru/strings.xml @@ -1,11 +1,28 @@ + Поиск подкастов + Найти следующий подкаст + На странице поиска мы собрали для вас набирающие обороты и уже популярные подкасты. + Найдите для себя что-то новое + Спасибо. А теперь давайте что-нибудь послушаем! + Добро пожаловать. Давайте что-нибудь послушаем! + Регулярные платежи начнут списываться, когда вы %s + Начать бесплатный пробный период и подписаться + Условия предоставления услуг + Политику конфиденциальности + Продолжая, вы принимаете %1$s и %2$s. + Станьте пользователем Plus и получите доступ ко всем возможностям Pocket Casts + Регистрация + Создать учётную запись + Войти + Бесплатный пробный период %s + Не удаётся загрузить итоги года, проверьте подключение к Интернету Покажите себя во всей красе. Эксклюзивные темы и значки только для членов клуба Plus. Темы и значки Без рекламы у вас будет больше того, что вам нравится, и меньше того, что вам не нравится. @@ -36,6 +53,7 @@ Language: ru Рубрики подкастов, которые я слушаю чаще всего Ваши любимые рубрики Не забудьте поделиться с друзьями и рассказать о любимых подкастерах + Благодарим за использование Pocket Casts в 2022 году Самый продолжительный выпуск, прослушанный мною в 2022 году: %1$s Этот выпуск длился %1$s Самым длинным выпуском, который вы слушали, был эпизод %1$s подкаста %2$s diff --git a/modules/services/localization/src/main/res/values-sv/strings.xml b/modules/services/localization/src/main/res/values-sv/strings.xml index 44a3680d370..37dbabfe074 100644 --- a/modules/services/localization/src/main/res/values-sv/strings.xml +++ b/modules/services/localization/src/main/res/values-sv/strings.xml @@ -1,11 +1,26 @@ + Välj dina egna färger. Exklusiva ikoner och teman för Plus-medlemmar. + Teman och ikoner + Annonsfri upplevelse som ger dig mer av det du gillar och mindre av det du inte gillar. + Dölj annonser + Ladda upp dina filer till molnlagringen och ha dem tillgängliga överallt. + 10 GB molnlagring + Organisera dina podcasts i mappar och håll dem synkroniserade på alla dina enheter. + Mappar + Lyssna på fler med våra Windows-, macOS- och webbappar. + Dator-appar + Få tillgång till exklusiva funktioner och anpassningsalternativ + Allt du älskar med Pocket Casts och mer därtill + Importera + Gör Pocket Casts till ditt genom att välja dina favoritpodcasts eller importera dem från en annan podcastspelare. Du kan alltid göra detta senare. + Hitta dina favoritpodcasts Om alternativet är aktiverat öppnas spelaren i fullskärmsläge när du börjar spela upp ett podcastavsnitt. Öppna spelaren automatiskt Ange en giltig e-post From 8d676700968b63b7e8714b51201da04a5f49e784 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Tue, 29 Nov 2022 13:30:07 +0530 Subject: [PATCH 05/18] Use typographic apostrophe --- .../services/localization/src/main/res/values/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/services/localization/src/main/res/values/strings.xml b/modules/services/localization/src/main/res/values/strings.xml index 764b9833aa9..541bd7604a3 100644 --- a/modules/services/localization/src/main/res/values/strings.xml +++ b/modules/services/localization/src/main/res/values/strings.xml @@ -1405,14 +1405,14 @@ In 2022, you spent %1$s listening to podcasts. In 2022, you spent\n%1$s\nlistening to podcasts. Replay - Let\'s celebrate your year of listening… + Let’s celebrate your year of listening… I spent %1$s listening to podcasts in 2022 You listened to %1$d different categories this year You listened to\n%1$d different categories\nthis year - Let\'s take a look at some of your favorites… + Let’s take a look at some of your favorites… I listened to %1$d different categories in 2022 @@ -1443,7 +1443,7 @@ Thank you for letting Pocket Casts be a part of your listening experience in 2022 - Don\'t forget to share with your friends and give a shout out to your favorite podcast creators + Don’t forget to share with your friends and give a shout out to your favorite podcast creators Your Top Categories From 050675077169bba6943c565045dc75a2e1ab1689 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Tue, 29 Nov 2022 13:32:49 +0530 Subject: [PATCH 06/18] Use exclamation in intro title --- modules/services/localization/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/localization/src/main/res/values/strings.xml b/modules/services/localization/src/main/res/values/strings.xml index 541bd7604a3..3b7a2b8d833 100644 --- a/modules/services/localization/src/main/res/values/strings.xml +++ b/modules/services/localization/src/main/res/values/strings.xml @@ -1405,7 +1405,7 @@ In 2022, you spent %1$s listening to podcasts. In 2022, you spent\n%1$s\nlistening to podcasts. Replay - Let’s celebrate your year of listening… + Let’s celebrate your year of listening! I spent %1$s listening to podcasts in 2022 From d2ce7c23ee6bd110dd3e5380a584077e874b7f40 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Tue, 29 Nov 2022 13:35:15 +0530 Subject: [PATCH 07/18] Linebreak in intro title (en only) --- .../endofyear/views/stories/StoryIntroView.kt | 9 ++++++++- .../localization/src/main/res/values/strings.xml | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryIntroView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryIntroView.kt index 9f572372a89..38638cd2bc5 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryIntroView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryIntroView.kt @@ -18,6 +18,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.intl.Locale import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp @@ -68,7 +69,13 @@ private fun PrimaryText( story: StoryIntro, modifier: Modifier, ) { - val text = stringResource(id = LR.string.end_of_year_story_intro_title) + val language = Locale.current.language + val textResId = if (language == "en") { + LR.string.end_of_year_story_intro_title_english_only + } else { + LR.string.end_of_year_story_intro_title + } + val text = stringResource(id = textResId) StoryPrimaryText(text = text, color = story.tintColor, modifier = modifier) } diff --git a/modules/services/localization/src/main/res/values/strings.xml b/modules/services/localization/src/main/res/values/strings.xml index 3b7a2b8d833..c865dae9f88 100644 --- a/modules/services/localization/src/main/res/values/strings.xml +++ b/modules/services/localization/src/main/res/values/strings.xml @@ -1406,6 +1406,7 @@ In 2022, you spent\n%1$s\nlistening to podcasts. Replay Let’s celebrate your year of listening! + Let’s celebrate your year\nof listening! I spent %1$s listening to podcasts in 2022 From 28d79c259b66464c6f05fea60ae3bddd6c243540 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Tue, 29 Nov 2022 13:46:28 +0530 Subject: [PATCH 08/18] Move intro story image down --- .../pocketcasts/endofyear/views/stories/StoryIntroView.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryIntroView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryIntroView.kt index 38638cd2bc5..dc6a66b743f 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryIntroView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryIntroView.kt @@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll @@ -43,7 +42,7 @@ fun StoryIntroView( .fillMaxSize() .verticalScroll(rememberScrollState()), ) { - Spacer(modifier = modifier.height(40.dp)) + Spacer(modifier = modifier.weight(1f)) Image( painter = painterResource(R.drawable.img_2022_big), From 461f16e3691e12bb159ee92e8a232b94b318097f Mon Sep 17 00:00:00 2001 From: ashiagr Date: Tue, 29 Nov 2022 13:50:05 +0530 Subject: [PATCH 09/18] Move logo downwards --- .../pocketcasts/endofyear/views/stories/StoryEpilogueView.kt | 2 +- .../pocketcasts/endofyear/views/stories/StoryIntroView.kt | 4 ++-- .../endofyear/views/stories/StoryListenedCategoriesView.kt | 2 +- .../endofyear/views/stories/StoryListenedNumbersView.kt | 2 +- .../endofyear/views/stories/StoryListeningTimeView.kt | 2 +- .../endofyear/views/stories/StoryLongestEpisodeView.kt | 2 +- .../endofyear/views/stories/StoryTopFivePodcastsView.kt | 2 +- .../endofyear/views/stories/StoryTopListenedCategoriesView.kt | 2 +- .../endofyear/views/stories/StoryTopPodcastView.kt | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryEpilogueView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryEpilogueView.kt index 9780dd8422f..3e502926436 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryEpilogueView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryEpilogueView.kt @@ -70,7 +70,7 @@ fun StoryEpilogueView( PodcastLogoWhite() - Spacer(modifier = modifier.height(40.dp)) + Spacer(modifier = modifier.height(30.dp)) } } diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryIntroView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryIntroView.kt index dc6a66b743f..864b43424c8 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryIntroView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryIntroView.kt @@ -6,7 +6,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.height import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material.Surface @@ -59,7 +59,7 @@ fun StoryIntroView( PodcastLogoWhite() - Spacer(modifier = modifier.padding(bottom = 40.dp)) + Spacer(modifier = modifier.height(30.dp)) } } diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt index 06925f2fa03..dce315a25fb 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt @@ -59,7 +59,7 @@ fun StoryListenedCategoriesView( PodcastLogoWhite() - Spacer(modifier = modifier.height(40.dp)) + Spacer(modifier = modifier.height(30.dp)) } } diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt index ea81cca4ad3..498e132fc38 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt @@ -61,7 +61,7 @@ fun StoryListenedNumbersView( PodcastLogoWhite() - Spacer(modifier = modifier.height(40.dp)) + Spacer(modifier = modifier.height(30.dp)) } } diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListeningTimeView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListeningTimeView.kt index 3c134ef007b..14c30be2949 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListeningTimeView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListeningTimeView.kt @@ -63,7 +63,7 @@ fun StoryListeningTimeView( PodcastLogoWhite() - Spacer(modifier = modifier.height(40.dp)) + Spacer(modifier = modifier.height(30.dp)) } } diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt index 4cee40e2d72..64f518dd8b2 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt @@ -61,7 +61,7 @@ fun StoryLongestEpisodeView( PodcastLogoWhite() - Spacer(modifier = modifier.height(40.dp)) + Spacer(modifier = modifier.height(30.dp)) } } diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopFivePodcastsView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopFivePodcastsView.kt index c7bbbb0a8d8..c81316639d8 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopFivePodcastsView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopFivePodcastsView.kt @@ -60,7 +60,7 @@ fun StoryTopFivePodcastsView( PodcastLogoWhite() - Spacer(modifier = modifier.height(40.dp)) + Spacer(modifier = modifier.height(30.dp)) } } diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopListenedCategoriesView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopListenedCategoriesView.kt index 3697289af2f..27536391838 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopListenedCategoriesView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopListenedCategoriesView.kt @@ -56,7 +56,7 @@ fun StoryTopListenedCategoriesView( PodcastLogoWhite() - Spacer(modifier = modifier.height(40.dp)) + Spacer(modifier = modifier.height(30.dp)) } } diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt index 9280eef0e8a..b4dfc73a9a6 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt @@ -61,7 +61,7 @@ fun StoryTopPodcastView( PodcastLogoWhite() - Spacer(modifier = modifier.height(40.dp)) + Spacer(modifier = modifier.height(30.dp)) } } From 5f852cc7ac490dfa77ce3e6e5967c03d3adc8461 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Tue, 29 Nov 2022 14:02:44 +0530 Subject: [PATCH 10/18] Increase stacked cover size --- .../endofyear/views/stories/StoryListenedCategoriesView.kt | 2 +- .../endofyear/views/stories/StoryLongestEpisodeView.kt | 2 +- .../pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt index dce315a25fb..c5551dd6f6d 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedCategoriesView.kt @@ -70,7 +70,7 @@ private fun PodcastCoverStack( ) { val context = LocalContext.current val currentLocalView = LocalView.current - val coverWidth = (currentLocalView.width.pxToDp(context).dp) / 2.5f + val coverWidth = (currentLocalView.width.pxToDp(context).dp) / 2.2f Box { (0..2).reversed().forEach { index -> diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt index 64f518dd8b2..53d937992a9 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryLongestEpisodeView.kt @@ -72,7 +72,7 @@ private fun PodcastCoverStack( ) { val context = LocalContext.current val currentLocalView = LocalView.current - val coverWidth = (currentLocalView.width.pxToDp(context).dp) / 2.5f + val coverWidth = (currentLocalView.width.pxToDp(context).dp) / 2.2f Box { (0..2).reversed().forEach { index -> diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt index b4dfc73a9a6..7a605691a52 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopPodcastView.kt @@ -72,7 +72,7 @@ private fun PodcastCoverStack( ) { val context = LocalContext.current val currentLocalView = LocalView.current - val coverWidth = (currentLocalView.width.pxToDp(context).dp) / 2.5f + val coverWidth = (currentLocalView.width.pxToDp(context).dp) / 2.2f Box { (0..2).reversed().forEach { index -> From 10dfd5aa08ed23108c81b849729ce2d30f187cd3 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Tue, 29 Nov 2022 14:05:48 +0530 Subject: [PATCH 11/18] Increase listened numbers cover size --- .../endofyear/views/stories/StoryListenedNumbersView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt index 498e132fc38..67c3fd77bab 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt @@ -73,7 +73,7 @@ private fun PodcastCoverStack( val context = LocalContext.current val currentLocalView = LocalView.current val screenWidth = currentLocalView.width.pxToDp(context).dp - val availableWidth = screenWidth * .74f + val availableWidth = screenWidth * .8f Box( modifier = modifier .size(availableWidth) From 166d3d6d7f6741d88fa7029463647996f2f32543 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Wed, 30 Nov 2022 11:25:33 +0530 Subject: [PATCH 12/18] Add pulsating heart animation + red logo on last screen --- .../views/stories/StoryEpilogueView.kt | 44 ++++++++++--- .../src/main/res/drawable/logo_red.xml | 63 +++++++++++++++++++ 2 files changed, 98 insertions(+), 9 deletions(-) create mode 100644 modules/features/endofyear/src/main/res/drawable/logo_red.xml diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryEpilogueView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryEpilogueView.kt index 3e502926436..65de130c945 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryEpilogueView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryEpilogueView.kt @@ -1,7 +1,13 @@ package au.com.shiftyjelly.pocketcasts.endofyear.views.stories +import androidx.compose.animation.core.RepeatMode +import androidx.compose.animation.core.animateFloat +import androidx.compose.animation.core.infiniteRepeatable +import androidx.compose.animation.core.rememberInfiniteTransition +import androidx.compose.animation.core.tween import androidx.compose.foundation.Image import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize @@ -17,15 +23,16 @@ import androidx.compose.material.Icon import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Refresh import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.scale import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import au.com.shiftyjelly.pocketcasts.compose.components.TextP40 import au.com.shiftyjelly.pocketcasts.endofyear.R -import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastLogoWhite import au.com.shiftyjelly.pocketcasts.endofyear.components.StoryPrimaryText import au.com.shiftyjelly.pocketcasts.endofyear.components.StorySecondaryText import au.com.shiftyjelly.pocketcasts.repositories.endofyear.stories.StoryEpilogue @@ -52,7 +59,7 @@ fun StoryEpilogueView( Spacer(modifier = modifier.weight(1f)) - HeartImage() + PulsatingHeart() Spacer(modifier = modifier.weight(0.34f)) @@ -68,22 +75,33 @@ fun StoryEpilogueView( Spacer(modifier = modifier.weight(1f)) - PodcastLogoWhite() + PodcastLogo() Spacer(modifier = modifier.height(30.dp)) } } @Composable -private fun HeartImage( +private fun PulsatingHeart( modifier: Modifier = Modifier, ) { - Image( - painter = painterResource(id = R.drawable.heart), - contentDescription = null, - modifier = modifier - .size(HeartImageSize) + val infiniteTransition = rememberInfiniteTransition() + val scale by infiniteTransition.animateFloat( + initialValue = 1f, + targetValue = 1.2f, + animationSpec = infiniteRepeatable( + animation = tween(500), + repeatMode = RepeatMode.Reverse + ) ) + Box(modifier = Modifier.scale(scale)) { + Image( + painter = painterResource(id = R.drawable.heart), + contentDescription = null, + modifier = modifier + .size(HeartImageSize) + ) + } } @Composable @@ -130,3 +148,11 @@ private fun ReplayButton( ) } } + +@Composable +fun PodcastLogo() { + Image( + painter = painterResource(R.drawable.logo_red), + contentDescription = null, + ) +} diff --git a/modules/features/endofyear/src/main/res/drawable/logo_red.xml b/modules/features/endofyear/src/main/res/drawable/logo_red.xml new file mode 100644 index 00000000000..14ef7f7e2d0 --- /dev/null +++ b/modules/features/endofyear/src/main/res/drawable/logo_red.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + From a3211c41527cc2d3acbdaeb593cfe67e667d2400 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Wed, 30 Nov 2022 11:56:59 +0530 Subject: [PATCH 13/18] Add 3D effect to pillar --- .../endofyear/components/CategoryPillar.kt | 75 +++++++++++++++---- 1 file changed, 61 insertions(+), 14 deletions(-) diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/components/CategoryPillar.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/components/CategoryPillar.kt index 3b73a572707..586e85c8d93 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/components/CategoryPillar.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/components/CategoryPillar.kt @@ -4,6 +4,7 @@ import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding @@ -13,6 +14,8 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.alpha import androidx.compose.ui.draw.drawWithContent +import androidx.compose.ui.graphics.BlendMode +import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Matrix import androidx.compose.ui.graphics.drawscope.withTransform @@ -30,14 +33,15 @@ import au.com.shiftyjelly.pocketcasts.compose.components.TextH30 import au.com.shiftyjelly.pocketcasts.compose.components.TextH40 import au.com.shiftyjelly.pocketcasts.compose.components.TextH70 import au.com.shiftyjelly.pocketcasts.endofyear.R -import au.com.shiftyjelly.pocketcasts.endofyear.utils.FadeDirection -import au.com.shiftyjelly.pocketcasts.endofyear.utils.dynamicBackground import au.com.shiftyjelly.pocketcasts.utils.extensions.pxToDp private const val PillarRotationAngle = -30f private const val PillarTextSkew = 0.5f private const val PillarTopAspectRatio = .58f -private val PillarColor = Color(0xFFFE7E61) +private val PillarBaseColor = Color(0xFFFE7E61) +private val Black24 = Color(0x3D000000) +private val PillarGradientStartColor = Color(0xFFFE7E61) +private val PillarGradientEndColor = Color(0x003C1F5D) @Composable fun CategoryPillar( @@ -114,17 +118,22 @@ private fun Pillar( val pillarTopAspectRatio = PillarTopAspectRatio val pillarTopHeight = width * pillarTopAspectRatio Box { - Box( - modifier = modifier - .width(width) - .height(height) - .padding(top = pillarTopHeight / 2) - .dynamicBackground( - baseColor = PillarColor, - colorStops = listOf(Color.Black, Color.Transparent), - direction = FadeDirection.TopToBottom - ) - ) + Row { + Box( + modifier = modifier + .width(width / 2f) + .height(height) + .padding(top = pillarTopHeight / 2) + .leftPillarBackground() + ) + Box( + modifier = modifier + .width(width / 2f) + .height(height) + .padding(top = pillarTopHeight / 2) + .rightPillarBackground() + ) + } Box { Image( painter = painterResource(R.drawable.rectangle), @@ -164,3 +173,41 @@ private fun Pillar( } } } + +fun Modifier.leftPillarBackground() = + graphicsLayer { + alpha = 0.99f + }.drawWithContent { + drawRect(color = PillarBaseColor) + drawRect( + brush = Brush.verticalGradient( + listOf(Black24, Color.Black), + startY = Float.POSITIVE_INFINITY, + endY = 0f, + ), + blendMode = BlendMode.DstIn + ) + drawRect( + brush = Brush.verticalGradient( + listOf(PillarGradientStartColor, PillarGradientEndColor), + startY = 0f, + endY = Float.POSITIVE_INFINITY, + ), + blendMode = BlendMode.DstIn + ) + } + +fun Modifier.rightPillarBackground() = + graphicsLayer { + alpha = 0.99f + }.drawWithContent { + drawRect(color = PillarBaseColor) + drawRect( + brush = Brush.verticalGradient( + listOf(PillarGradientStartColor, PillarGradientEndColor), + startY = 0f, + endY = Float.POSITIVE_INFINITY, + ), + blendMode = BlendMode.DstIn + ) + } From e4fb26ebaa67897aed2cc1f8474802dc14722a38 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Wed, 30 Nov 2022 22:00:26 +0530 Subject: [PATCH 14/18] Capture unknown format conversion exception --- .../pocketcasts/settings/util/FunnyTimeConverter.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/util/FunnyTimeConverter.kt b/modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/util/FunnyTimeConverter.kt index 4f1e609e938..8ece3413eea 100644 --- a/modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/util/FunnyTimeConverter.kt +++ b/modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/util/FunnyTimeConverter.kt @@ -2,7 +2,9 @@ package au.com.shiftyjelly.pocketcasts.settings.util import android.content.res.Resources import androidx.annotation.StringRes +import timber.log.Timber import java.util.Random +import java.util.UnknownFormatConversionException import au.com.shiftyjelly.pocketcasts.localization.R as LR class FunnyTimeConverter { @@ -41,7 +43,12 @@ class FunnyTimeConverter { val mins = (timeSecs / 60).toDouble() val amount = mins * timesPerMinute - return resources.getString(formatStringId, amount) + return try { + resources.getString(formatStringId, amount) + } catch (ex: UnknownFormatConversionException) { + Timber.e(ex.message) + "" + } } fun suitableFor(timeSecs: Long): Boolean { From eff661117ebddefdf201720245c6fa7e1190a8fe Mon Sep 17 00:00:00 2001 From: ashiagr Date: Thu, 1 Dec 2022 12:19:17 +0530 Subject: [PATCH 15/18] Expand stories screens which are not shareable --- .../pocketcasts/endofyear/StoriesPage.kt | 16 ++++++++-------- .../pocketcasts/endofyear/StoriesViewModel.kt | 4 ---- .../repositories/endofyear/stories/Story.kt | 1 + .../endofyear/stories/StoryEpilogue.kt | 1 + .../repositories/endofyear/stories/StoryIntro.kt | 1 + 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/StoriesPage.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/StoriesPage.kt index 26d35acf498..57717e5e69c 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/StoriesPage.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/StoriesPage.kt @@ -37,7 +37,6 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.alpha import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.vector.rememberVectorPainter @@ -204,12 +203,13 @@ private fun StoriesView( } CloseButtonView(onCloseClicked) } - } - requireNotNull(onCaptureBitmap).let { - ShareButton( - onClick = { if (state.showShare) { onShareClicked.invoke(it) } }, - modifier = modifier.alpha(if (state.showShare) 1f else 0f) - ) + if (state.currentStory.shareable) { + requireNotNull(onCaptureBitmap).let { + ShareButton( + onClick = { onShareClicked.invoke(it) }, + ) + } + } } } } @@ -261,7 +261,7 @@ private fun StorySharableContent( @Composable private fun ShareButton( onClick: () -> Unit, - modifier: Modifier, + modifier: Modifier = Modifier, ) { RowOutlinedButton( text = stringResource(id = LR.string.share), diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/StoriesViewModel.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/StoriesViewModel.kt index a3a39a8e327..65214614361 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/StoriesViewModel.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/StoriesViewModel.kt @@ -11,8 +11,6 @@ import au.com.shiftyjelly.pocketcasts.endofyear.ShareableTextProvider.ShareTextD import au.com.shiftyjelly.pocketcasts.endofyear.StoriesViewModel.State.Loaded.SegmentsData import au.com.shiftyjelly.pocketcasts.repositories.endofyear.EndOfYearManager import au.com.shiftyjelly.pocketcasts.repositories.endofyear.stories.Story -import au.com.shiftyjelly.pocketcasts.repositories.endofyear.stories.StoryEpilogue -import au.com.shiftyjelly.pocketcasts.repositories.endofyear.stories.StoryIntro import au.com.shiftyjelly.pocketcasts.utils.FileUtilWrapper import au.com.shiftyjelly.pocketcasts.utils.SentryHelper import au.com.shiftyjelly.pocketcasts.utils.log.LogBuffer @@ -207,8 +205,6 @@ class StoriesViewModel @Inject constructor( val segmentsData: SegmentsData, val preparingShareText: Boolean = false, ) : State() { - val showShare: Boolean - get() = currentStory !is StoryIntro && currentStory !is StoryEpilogue data class SegmentsData( val widths: List = emptyList(), val xStartOffsets: List = emptyList(), diff --git a/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/endofyear/stories/Story.kt b/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/endofyear/stories/Story.kt index ef59e041cac..e686659aeec 100644 --- a/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/endofyear/stories/Story.kt +++ b/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/endofyear/stories/Story.kt @@ -8,4 +8,5 @@ abstract class Story { open val storyLength: Long = 5.seconds() open val backgroundColor: Color = Color.Black val tintColor: Color = Color.White + open val shareable: Boolean = true } diff --git a/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/endofyear/stories/StoryEpilogue.kt b/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/endofyear/stories/StoryEpilogue.kt index f2eb67d0b76..11f75b0da62 100644 --- a/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/endofyear/stories/StoryEpilogue.kt +++ b/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/endofyear/stories/StoryEpilogue.kt @@ -2,4 +2,5 @@ package au.com.shiftyjelly.pocketcasts.repositories.endofyear.stories class StoryEpilogue : Story() { override val identifier: String = "epilogue" + override val shareable: Boolean = false } diff --git a/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/endofyear/stories/StoryIntro.kt b/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/endofyear/stories/StoryIntro.kt index 123bcaa00f6..cad52badf74 100644 --- a/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/endofyear/stories/StoryIntro.kt +++ b/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/endofyear/stories/StoryIntro.kt @@ -4,4 +4,5 @@ import androidx.compose.ui.graphics.Color class StoryIntro : Story() { override val identifier: String = "intro" override val backgroundColor: Color = Color(0xFF1A1A1A) + override val shareable: Boolean = false } From a5a065cb6e0625112bd8d4638794188f426c8fdf Mon Sep 17 00:00:00 2001 From: ashiagr Date: Thu, 1 Dec 2022 12:18:02 +0530 Subject: [PATCH 16/18] Increase padding on listened nos. screen between artwork and text --- .../endofyear/views/stories/StoryListenedNumbersView.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt index 67c3fd77bab..73af1177bac 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryListenedNumbersView.kt @@ -77,7 +77,7 @@ private fun PodcastCoverStack( Box( modifier = modifier .size(availableWidth) - .padding(start = availableWidth * .55f, top = availableWidth * .09f) + .padding(start = availableWidth * .55f, top = availableWidth * .01f) .transformPodcastCover() ) { PodcastCover( @@ -91,7 +91,7 @@ private fun PodcastCoverStack( coverWidth = availableWidth * .23f, uuid = topPodcasts.atSafeIndex(4).uuid, modifier = modifier - .offset(x = -availableWidth / 2f, y = availableWidth / 2.3f) + .offset(x = -availableWidth / 2.3f, y = availableWidth / 2.5f) ) PodcastCover( From 71326bde6c2d91c9dee28c214ebcc1c9bc6282f0 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Thu, 1 Dec 2022 12:15:25 +0530 Subject: [PATCH 17/18] Revert red logo on epilogue screen --- .../views/stories/StoryEpilogueView.kt | 11 +--- .../src/main/res/drawable/logo_red.xml | 63 ------------------- 2 files changed, 2 insertions(+), 72 deletions(-) delete mode 100644 modules/features/endofyear/src/main/res/drawable/logo_red.xml diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryEpilogueView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryEpilogueView.kt index 65de130c945..1a6c185dd64 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryEpilogueView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryEpilogueView.kt @@ -33,6 +33,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import au.com.shiftyjelly.pocketcasts.compose.components.TextP40 import au.com.shiftyjelly.pocketcasts.endofyear.R +import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastLogoWhite import au.com.shiftyjelly.pocketcasts.endofyear.components.StoryPrimaryText import au.com.shiftyjelly.pocketcasts.endofyear.components.StorySecondaryText import au.com.shiftyjelly.pocketcasts.repositories.endofyear.stories.StoryEpilogue @@ -75,7 +76,7 @@ fun StoryEpilogueView( Spacer(modifier = modifier.weight(1f)) - PodcastLogo() + PodcastLogoWhite() Spacer(modifier = modifier.height(30.dp)) } @@ -148,11 +149,3 @@ private fun ReplayButton( ) } } - -@Composable -fun PodcastLogo() { - Image( - painter = painterResource(R.drawable.logo_red), - contentDescription = null, - ) -} diff --git a/modules/features/endofyear/src/main/res/drawable/logo_red.xml b/modules/features/endofyear/src/main/res/drawable/logo_red.xml deleted file mode 100644 index 14ef7f7e2d0..00000000000 --- a/modules/features/endofyear/src/main/res/drawable/logo_red.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - From 1e2ed1f43aab7633a548dbaaf910dadba1bf86a3 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Thu, 1 Dec 2022 13:31:51 +0530 Subject: [PATCH 18/18] Disable text font scale > 1.15 Popular font scale values: 1, 1.15, 1.3 --- .../endofyear/components/StoryText.kt | 8 +++++++ .../views/stories/StoryTopFivePodcastsView.kt | 5 +++++ .../stories/StoryTopListenedCategoriesView.kt | 2 ++ .../compose/components/TextStyles.kt | 21 ++++++++++++------- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/components/StoryText.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/components/StoryText.kt index ecd05f15046..8fd8e6bfd36 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/components/StoryText.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/components/StoryText.kt @@ -6,12 +6,15 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.draw.alpha import androidx.compose.ui.graphics.Color +import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import au.com.shiftyjelly.pocketcasts.compose.components.TextH20 import au.com.shiftyjelly.pocketcasts.compose.components.TextP40 +private const val MaxFontScale = 1.15f + @Composable fun StoryPrimaryText( text: String, @@ -22,6 +25,7 @@ fun StoryPrimaryText( text = text, textAlign = TextAlign.Center, color = color, + disableScale = disableScale(), modifier = modifier .fillMaxWidth() .padding(horizontal = 40.dp) @@ -39,9 +43,13 @@ fun StorySecondaryText( textAlign = TextAlign.Center, color = color, fontWeight = FontWeight.Bold, + disableScale = disableScale(), modifier = modifier .fillMaxWidth() .alpha(0.8f) .padding(horizontal = 40.dp) ) } + +@Composable +fun disableScale() = LocalDensity.current.fontScale > MaxFontScale diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopFivePodcastsView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopFivePodcastsView.kt index c81316639d8..f759cca5eaa 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopFivePodcastsView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopFivePodcastsView.kt @@ -28,6 +28,7 @@ import au.com.shiftyjelly.pocketcasts.compose.components.TextH30 import au.com.shiftyjelly.pocketcasts.compose.components.TextH70 import au.com.shiftyjelly.pocketcasts.compose.preview.ThemePreviewParameterProvider import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastLogoWhite +import au.com.shiftyjelly.pocketcasts.endofyear.components.disableScale import au.com.shiftyjelly.pocketcasts.endofyear.utils.podcastDynamicBackground import au.com.shiftyjelly.pocketcasts.localization.R import au.com.shiftyjelly.pocketcasts.models.entity.Podcast @@ -74,6 +75,7 @@ private fun Title( text = text, textAlign = TextAlign.Center, color = story.tintColor, + disableScale = disableScale(), modifier = modifier .padding(horizontal = 40.dp) .fillMaxWidth() @@ -108,6 +110,7 @@ fun PodcastItem( text = "${position + 1}.", color = tintColor, fontWeight = FontWeight.Normal, + disableScale = disableScale(), modifier = modifier.padding(end = 14.dp) ) Row( @@ -129,6 +132,7 @@ fun PodcastItem( color = tintColor, maxLines = 2, fontWeight = FontWeight.Bold, + disableScale = disableScale(), modifier = modifier .padding(bottom = 3.dp) ) @@ -137,6 +141,7 @@ fun PodcastItem( color = tintColor, maxLines = 1, fontWeight = FontWeight.Bold, + disableScale = disableScale(), modifier = modifier.alpha(0.8f) ) } diff --git a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopListenedCategoriesView.kt b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopListenedCategoriesView.kt index 27536391838..7739000df0f 100644 --- a/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopListenedCategoriesView.kt +++ b/modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/stories/StoryTopListenedCategoriesView.kt @@ -22,6 +22,7 @@ import androidx.compose.ui.unit.dp import au.com.shiftyjelly.pocketcasts.compose.components.TextH30 import au.com.shiftyjelly.pocketcasts.endofyear.components.CategoryPillar import au.com.shiftyjelly.pocketcasts.endofyear.components.PodcastLogoWhite +import au.com.shiftyjelly.pocketcasts.endofyear.components.disableScale import au.com.shiftyjelly.pocketcasts.endofyear.utils.dynamicBackground import au.com.shiftyjelly.pocketcasts.models.db.helper.ListenedCategory import au.com.shiftyjelly.pocketcasts.repositories.endofyear.stories.StoryTopListenedCategories @@ -70,6 +71,7 @@ private fun Title( text = text, textAlign = TextAlign.Center, color = story.tintColor, + disableScale = disableScale(), modifier = modifier .padding(horizontal = 40.dp) .fillMaxWidth() diff --git a/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/TextStyles.kt b/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/TextStyles.kt index 904f09c6072..abc4323a12c 100644 --- a/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/TextStyles.kt +++ b/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/TextStyles.kt @@ -57,13 +57,16 @@ fun TextH20( modifier: Modifier = Modifier, color: Color = MaterialTheme.theme.colors.primaryText01, maxLines: Int = Int.MAX_VALUE, - textAlign: TextAlign? = null + textAlign: TextAlign? = null, + disableScale: Boolean = false, + fontSize: TextUnit = 22.sp, + lineHeight: TextUnit = 30.sp, ) { Text( text = text, color = color, - fontSize = 22.sp, - lineHeight = 30.sp, + fontSize = if (disableScale) fontSize.value.nonScaledSp else fontSize, + lineHeight = if (disableScale) lineHeight.value.nonScaledSp else lineHeight.value.sp, fontWeight = FontWeight.Bold, maxLines = maxLines, overflow = TextOverflow.Ellipsis, @@ -81,13 +84,14 @@ fun TextH30( fontWeight: FontWeight? = null, maxLines: Int = Int.MAX_VALUE, disableScale: Boolean = false, - fontSize: TextUnit = 18.sp + fontSize: TextUnit = 18.sp, + lineHeight: TextUnit = 21.sp, ) { Text( text = text, color = color, fontSize = if (disableScale) fontSize.value.nonScaledSp else fontSize, - lineHeight = if (disableScale) 21.nonScaledSp else 21.sp, + lineHeight = if (disableScale) lineHeight.value.nonScaledSp else lineHeight.value.sp, textAlign = textAlign, fontWeight = fontWeight ?: FontWeight.SemiBold, maxLines = maxLines, @@ -148,13 +152,16 @@ fun TextP40( textAlign: TextAlign? = null, color: Color = MaterialTheme.theme.colors.primaryText01, maxLines: Int = Int.MAX_VALUE, + disableScale: Boolean = false, fontWeight: FontWeight? = null, + fontSize: TextUnit = 16.sp, + lineHeight: TextUnit = 22.sp, ) { Text( text = text, color = color, - fontSize = 16.sp, - lineHeight = 22.sp, + fontSize = if (disableScale) fontSize.value.nonScaledSp else fontSize, + lineHeight = if (disableScale) lineHeight.value.nonScaledSp else lineHeight, textAlign = textAlign, maxLines = maxLines, overflow = TextOverflow.Ellipsis,