Instantly share code, notes, and snippets.
What if in the bottom sheet content will be a lazylist, how we can track then a scrollState ?
Sorry, something went wrong.
@Alexbeard This was my use case as well. I believe I solved it with relatively few modifications.
I changed val scrollState = rememberScrollState() to val scrollState = rememberLazyListState().
val scrollState = rememberScrollState()
val scrollState = rememberLazyListState()
In the onPreFling I changed scrollState.value == 0 to scrollState.firstVisibleItemIndex == 0 && scrollState.firstVisibleItemScrollOffset == 0
scrollState.value == 0
scrollState.firstVisibleItemIndex == 0 && scrollState.firstVisibleItemScrollOffset == 0
The .value in the original implementation describes "current scroll position value in pixels" so what I have accomplishes that I think for the LazyListState implementation of ScrollableState
modifier = Modifier.fillMaxWidth(),
state = scrollState
I changed the body type for this Composable to be body: LazyListScope.() -> Unit,
body: LazyListScope.() -> Unit,
I think that's it. It seems to be working, but let it be known that I've been playing around with my implementation for all of about 8 minutes so far
@nkrebs13 8 minutes looks enough for me, ship it!
Hey Guys, Where is the toOffset() method in swipeableState.performDrag(delta).toOffset() coming from? Its not resolving for me.
Oh Sorry, Got it, Didn't see the extension function created below.
Hello, How can I make it so that I can move the bottom sheet only for the area with LazyColumn?