myanmarking
09/14/2023, 3:39 PMmyanmarking
09/14/2023, 3:39 PMfun Modifier.scrollingHeaderBackground(
arcHeight: Dp,
colorStart: Color,
colorEnd: Color,
lazyListState: LazyListState
): Modifier{
return this.then(
Modifier.composed {
val progressHeight by remember {
derivedStateOf {
when (lazyListState.firstVisibleItemIndex) {
0 -> TODO()
else -> TODO()
}
}
}
val headerPath by remember {
derivedStateOf {
Path().apply {
// path here based on progressHeight
TODO()
}
}
}
val brush: Brush by remember {
derivedStateOf {
// brush here with offset based on progressHeight
// also colorStart/colorEnd
TODO()
}
}
drawWithContent {
drawPath(path = headerPath, brush = brush)
drawContent()
}
}
)
}