mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 15:11:58 +01:00
pin the artist scrim to the top behind the status bar
This commit is contained in:
@@ -34,6 +34,7 @@ import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.remember
|
||||
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.geometry.Offset
|
||||
import androidx.compose.ui.graphics.Brush
|
||||
@@ -52,7 +53,6 @@ import org.koin.compose.viewmodel.koinViewModel
|
||||
import org.koin.core.parameter.parametersOf
|
||||
|
||||
private val ART_HEIGHT = 420.dp
|
||||
private val SCRIM_HEIGHT = 180.dp
|
||||
private val TITLE_INSET = 16.dp
|
||||
private val FADE_LEAD = 24.dp
|
||||
|
||||
@@ -136,17 +136,6 @@ fun ArtistDetailScreen(
|
||||
name = artist?.name.orEmpty(),
|
||||
modifier = Modifier.fillMaxWidth().height(ART_HEIGHT),
|
||||
)
|
||||
Box(
|
||||
modifier =
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.height(SCRIM_HEIGHT)
|
||||
.background(
|
||||
Brush.verticalGradient(
|
||||
listOf(Color.Black.copy(alpha = 0.8f), Color.Transparent),
|
||||
),
|
||||
),
|
||||
)
|
||||
Text(
|
||||
text = artist?.name.orEmpty(),
|
||||
style = imageNameStyle,
|
||||
@@ -188,6 +177,18 @@ fun ArtistDetailScreen(
|
||||
}
|
||||
}
|
||||
|
||||
Box(
|
||||
modifier =
|
||||
Modifier
|
||||
.align(Alignment.TopStart)
|
||||
.fillMaxWidth()
|
||||
.height(barHeight + 24.dp)
|
||||
.alpha(1f - barFraction)
|
||||
.background(
|
||||
Brush.verticalGradient(listOf(Color.Black.copy(alpha = 0.8f), Color.Transparent)),
|
||||
),
|
||||
)
|
||||
|
||||
TopAppBar(
|
||||
title = {
|
||||
Text(
|
||||
|
||||
Reference in New Issue
Block a user