Questions tagged [android-jetpack-compose-lazy-column]

78 questions
50
votes
6 answers

Jetpack Compose LazyColumn programmatically scroll to Item

Is there any way to programmatically scroll LazyColumn to some item in the list? I thought that it can be done by hoisting the LazyColumn argument state: LazyListState = rememberLazyListState() but I have no idea how I can change this state e.g. on…
28
votes
7 answers

Get last visible item index in jetpack compose LazyColumn

I want to check if the list is scrolled to end of the list. How ever the lazyListState does not provide this property Why do I need this? I want to show a FAB for "scrolling to end" of the list, and hide it if last item is already visible (Note: It…
27
votes
1 answer

Android Jetpack Compose Lazy column items with index?

How to access the current item's index of LazyColumn in Jetpack Compose. LazyColumn { items(viewModel.list) { item -> // Here I want to get the index of the item Timber.d("item - $item") } }
13
votes
6 answers

jetpack compose: scroll to bottom listener (end of list)

I am wondering if it is possible to get observer inside a @Compose function when the bottom of the list is reached (similar to recyclerView.canScrollVertically(1)) Thanks in advance.
10
votes
2 answers

Jetpack Compose lazy column all items recomposes when a single item update

I'm trying to do some list operations and I've run into the issue of all items recomposing when a single item update. https://prnt.sc/8_OAi1Krn-qg My models; data class Person(val id: Int, val name: String, val isSelected: Boolean =…
8
votes
1 answer

How to prevent LazyColumn from autoscrolling if the first item was moved

I use Jetpack Compose UI to build a simple TODO app. The idea is to have a list of tasks that could be checked or unchecked, and checked tasks should go to the end of the list. Everything is working fine except when I check the first visible item on…
7
votes
1 answer

How to select multiple items in LazyColumn in JetpackCompose

How to select multiple items in LazyColumn and finally add the selected items in a seperate list. GettingTags(tagsContent ={ productTags -> val flattenList = productTags.flatMap { it.tags_list …
5
votes
2 answers

Performance of LazyColumn with LazyRows inside it

I have a lazy column with lazy rows inside it, like in the image: I am testing on a 2017 middle-quality phone with Android 9. Release build with R8 enabled. Scroll performance in rows are pretty good, but in column performance is very low. I am…
4
votes
0 answers

Compose nestedScrollConnection not being triggered with animated scroll

I've created a collapsible header in Compose with the NestedScrollConnection. Everything works perfectly but one addition had to be made: automatic scrolling to a certain item. The problem I have is that the header (connected using the…
3
votes
1 answer

LazyColumn, how to add window insets padding to my padding?

I have a LazyColumn where I have a contentPadding = PaddingValues(16.dp) Now, I want to add navigation bar height to the bottom padding, as to achieve the "edge to edge" effect so contentPadding = WindowInsets.navigationBars.asPaddingValues() But…
3
votes
1 answer

Jetpack Compose LazyColumn reverse display

native composable column with elements a, b and c: a b c how can you reverse arrangement to: c b a in android jetpack compose
3
votes
2 answers

How to implement LazyColumn item impression tracking

I have a lazycolumn with items, and I want to send an event every time one of the items appears on screen. There are examples of events being sent the first time (like here https://plusmobileapps.com/2022/05/04/lazy-column-view-impressions.html) but…
3
votes
2 answers

Execute LaunchedEffect only when an item is visible in LazyColumn

I am using a LazyColumn and there are several items in which one of item has a LaunchedEffect which needs to be executed only when the view is visible. On the other hand, it gets executed as soon as the LazyColumn is rendered. How to check whether…
3
votes
2 answers

How to check visibility of list item in Jetpack Compose

FlatList of React Nativehas a property viewabilityConfigCallbackPairs where you can set: viewabilityConfig: { itemVisiblePercentThreshold: 50, waitForInteraction: true, } to detect visible items of the list with threshold of 50% and after…
2
votes
1 answer

Nesting of Lazy Column in Jetpack compose gives crash, I searched through Internet but I didn't find any solution for the crash?

I have a list of Pair> . Here main list is list of all direcotry name and in each directory there is list of files in it. so In compose I want to design UI design where Folder name followed by its content and after content second…
1
2 3 4 5 6