mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-23 19:26:50 +00:00
refactor: simplify gradient handling and remove unused components in TvFocusedItemHero
This commit is contained in:
@@ -31,7 +31,6 @@ import androidx.compose.ui.text.style.TextOverflow
|
|||||||
import androidx.compose.ui.unit.Dp
|
import androidx.compose.ui.unit.Dp
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import hu.bbara.purefin.common.ui.components.MediaHeroScrimOverlay
|
|
||||||
import hu.bbara.purefin.common.ui.components.MediaProgressBar
|
import hu.bbara.purefin.common.ui.components.MediaProgressBar
|
||||||
import hu.bbara.purefin.common.ui.components.PurefinAsyncImage
|
import hu.bbara.purefin.common.ui.components.PurefinAsyncImage
|
||||||
|
|
||||||
@@ -40,7 +39,6 @@ internal const val TvHomeHeroStatusTag = "tv-home-hero-status"
|
|||||||
internal const val TvHomeHeroProgressLabelTag = "tv-home-hero-progress-label"
|
internal const val TvHomeHeroProgressLabelTag = "tv-home-hero-progress-label"
|
||||||
|
|
||||||
private const val TvHomeHeroAnimationMillis = 180
|
private const val TvHomeHeroAnimationMillis = 180
|
||||||
private val TvHomeHeroShape = RoundedCornerShape(bottomStart = 28.dp, bottomEnd = 28.dp)
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
internal fun TvFocusedItemHero(
|
internal fun TvFocusedItemHero(
|
||||||
@@ -53,7 +51,6 @@ internal fun TvFocusedItemHero(
|
|||||||
modifier = modifier
|
modifier = modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.height(height)
|
.height(height)
|
||||||
.clip(TvHomeHeroShape)
|
|
||||||
.background(scheme.background)
|
.background(scheme.background)
|
||||||
) {
|
) {
|
||||||
Crossfade(
|
Crossfade(
|
||||||
@@ -68,17 +65,16 @@ internal fun TvFocusedItemHero(
|
|||||||
contentScale = ContentScale.Crop
|
contentScale = ContentScale.Crop
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
MediaHeroScrimOverlay()
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(
|
.background(
|
||||||
Brush.horizontalGradient(
|
Brush.horizontalGradient(
|
||||||
colors = listOf(
|
colorStops = arrayOf(
|
||||||
scheme.background,
|
0.0f to scheme.background,
|
||||||
scheme.background.copy(alpha = 0.94f),
|
0.28f to scheme.background.copy(alpha = 0.88f),
|
||||||
scheme.background.copy(alpha = 0.72f),
|
0.62f to scheme.background.copy(alpha = 0.42f),
|
||||||
scheme.background.copy(alpha = 0.18f)
|
1.0f to scheme.background.copy(alpha = 0.06f)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -88,10 +84,10 @@ internal fun TvFocusedItemHero(
|
|||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(
|
.background(
|
||||||
Brush.verticalGradient(
|
Brush.verticalGradient(
|
||||||
colors = listOf(
|
colorStops = arrayOf(
|
||||||
scheme.background.copy(alpha = 0f),
|
0.0f to scheme.background.copy(alpha = 0f),
|
||||||
scheme.background.copy(alpha = 0.22f),
|
0.56f to scheme.background.copy(alpha = 0.1f),
|
||||||
scheme.background.copy(alpha = 0.92f)
|
1.0f to scheme.background
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user