Skip to content

Commit

Permalink
Fix huge FeaturedSection gap on android devices with api level 30 or …
Browse files Browse the repository at this point in the history
…below
  • Loading branch information
darktiny committed Sep 20, 2023
1 parent 405909f commit 957c2e0
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ import kotlinx.collections.immutable.ImmutableList
import kotlinx.coroutines.flow.collectLatest

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

private val featuredGradientBackgroundAspectRatio: Float
@Composable
@ReadOnlyComposable
get() =
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 957c2e0

Please sign in to comment.