Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overscrolling at the botton in jetpack compose

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?

like image 783
Anudeep Ananth Avatar asked Oct 27 '22 12:10

Anudeep Ananth


People also ask

What is LazyColumn in jetpack compose?

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.

What is mutableStateOf in jetpack compose?

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 .

How do I make my screen scrollable in jetpack compose?

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 .

Is jetpack compose easy to learn?

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.


1 Answers

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...

like image 151
Anudeep Ananth Avatar answered Nov 08 '22 13:11

Anudeep Ananth