Skip to content

Commit

Permalink
Fix featured section background size on android devices with api leve…
Browse files Browse the repository at this point in the history
…l 30 or below
  • Loading branch information
darktiny authored Sep 20, 2023
1 parent 405909f commit 23f0f6b
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ private val featuredImageBackgroundAspectRatio: Float
else -> 1.1f
}

private val featuredGradientBackgroundAspectRatio: Float
@Composable
@ReadOnlyComposable
get() =
when (LocalWindowSizeClass.current.widthSizeClass) {
WindowWidthSizeClass.Compact -> 0.8f
WindowWidthSizeClass.Medium -> 1.11f
WindowWidthSizeClass.Expanded -> 2.3f
else -> 0.8f
}

@OptIn(ExperimentalFoundationApi::class)
@Composable
internal fun FeaturedSection(
Expand Down Expand Up @@ -278,7 +289,7 @@ private fun FeaturedSectionBlurredBackground(modifier: Modifier = Modifier, imag
} else {
Box(
modifier =
Modifier.aspectRatio(0.8f).composed {
Modifier.aspectRatio(featuredGradientBackgroundAspectRatio).composed {
val colorStops =
listOf(
AppTheme.colorScheme.tintedHighlight.copy(alpha = 0.0f),
Expand Down

0 comments on commit 23f0f6b

Please sign in to comment.