I am trying to ensure that there is a visual indication that the user is trying to scroll more to the bottom even though he has reached the end of the list in a LazyColumn.
This feature is available by default in XML layouts.
How do we implement this in Jetpack compose? For over scrolling at the top, I see that there is a Swipe for Refresh equivalent. Is there a solution out there at present?
A LazyColumn is a vertically scrolling list that only composes and lays out the currently visible items. It's similar to a Recyclerview in the classic Android View system.
mutableStateOf creates an observable MutableState<T> , which is an observable type integrated with the compose runtime. interface MutableState<T> : State<T> { override var value: T. } Any changes to value will schedule recomposition of any composable functions that read value .
Add Modifier. scrollable(..) to the container that you wish to make scrollable. Code would be something like this: val scrollState = rememberScrollState() ... Box( // or whatever your parent composable is modifier = Modifier .
1 - Creating your first Compose project is easy Yes it's basic, but 5 minutes isn't bad to have your first Compose app up and running.
With version 1.1.0-alpha04 for Jetpack compose, glad to see that a feature to show a visual indication that the user has reached the end of the list is built just like xml...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With