I have a button in my layout, which I want it to stop scrolling on a certain Y in my vertical scroll :
val scrollState = rememberScrollState()
Column(
modifier = Modifier.verticalScroll(scrollState)
) {
Box(
modifier = Modifier.height(Dimens.DetailBoxImageHeight)
) {
Image(
painter = rememberImagePainter(item.poster),
contentDescription = null,
modifier = Modifier
.align(Alignment.TopCenter)
.fillMaxWidth()
.clip(shape = MaterialTheme.shapes.medium)
.alpha(contentAlpha()),
contentScale = ContentScale.Crop,
)
Button(
onClick = sendNotification,
shape = RoundedCornerShape(36.dp),
modifier = Modifier
.width(126.dp)
.align(Alignment.BottomCenter)
.offset(y = 23.5.dp)
) {
Text(text = "DeepLink")
}
}
Spacer(Modifier.height(32.dp))
Text(
modifier = Modifier.padding(8.dp),
text = item.description,
style = typography.body2,
fontSize = 18.sp,
color = MaterialTheme.colors.onSurface
)
}
How can I achieve that in Jetpack Compose?