Questions tagged [lazycolumn]

209 questions
5
votes
4 answers

Current scroll position value in pixels in LazyColumn Jetpack Compose

I want to have the total scroll position in px in LazyColumn. The column itself has a ScrollState which has a value (Described in the document as the current scroll position value in pixels), But LazyColumn ScrollState hasn't this field, I want the…
5
votes
2 answers

LazyColumn with ConstraintLayout in android jetpack compose

I'm going to put a label on the top for each column and a LazyСolumn on the bottom. As follows. However, when I filled it out, the screen other than I expected appeared: Is there anything else I need to set up? Here is my code @Composable fun…
Polaris Nation
  • 1,085
  • 2
  • 18
  • 49
4
votes
1 answer

Use lazycolumn jetpack compose lag more than use recycleview

I just learned jetpack compose and I switched from recycle to lazy column but when I do it it lags much more than recycle after adding about 100 items to the application the app is lagging, is there any way to reduce the lag for the lazy column? I…
4
votes
1 answer

Compose LazyColumn - add items to top of list and keep currently visible items still visible

I try to build list of items, where items are added to top or bottom of the list, based on header of footer click, but still keep normal list items in same position in screen. Currently when AddMoreHeader() is clicked, new items are added to…
4
votes
1 answer

State Hoisting in LazyColumn Single Selection. Jetpack Compose

I have a LazyColumn with expandable items. And when i click on the item he expands or collapses, but i need that when i click on closed element it opens and others in the list close.(the one that open). So first i moved state of item from remember…
4
votes
2 answers

How to recompose a composable after an event occured in the main Activity?

I created an event listener to catch when a physical button is pressed, and it works well. But I would want to update a list used in a LazyColumn class MainActivity : ComponentActivity() { @OptIn(ExperimentalComposeUiApi::class) override fun…
4
votes
2 answers

LazyColumn callback for items that become visible but only once

I am looking for an efficient way to trigger a callback for each item of a LazyColumn as they become visible, but only once. The callback should happen only once as items become visible. It should not trigger if the user scrolls past the same item…
4
votes
1 answer

Lazycolumn does not update when deleting an item

I am trying to delete an item from Lazycolumn. Here is my code : MyViewModel.kt : class MyViewModel:ViewModel() { val items = MutableLiveData>() fun removeItem(item: Items) { items.value = items.value?.filter { it !=…
4
votes
0 answers

How to scroll to selected item in a LazyColumn within a ModalBottomSheetLayout with Jetpack Compose?

I have a places list that it can be selected via ModalBottomSheetLayout. These places are in a LazyColumn inside the ModalBottomSheetLayout. When I open the ModalBottomSheetLayout clicking in 'Open place Selector' to select a new place, I would like…
4
votes
1 answer

Jetpack Compose: LazyColumn not updating with MutableList

I am trying to strikethrough a text at the click of a button using Jetpack Compose but the UI is not updating. I have tried to set a button and on the click of a button, deletedTasks gets updated and if my task is in deletedTasks then it should show…
4
votes
3 answers

How to calculate empty space in lazy column after last visible item

How to calculate empty space in lazy column after last visible item in Jetpack compose.
4
votes
0 answers

Compose LazyListState scrollToItem or animatedScrollToItem do not work when there are many items

When I have a large list of items, OR when i don't have large list of items but each with component renders slowly, the rememberLazyListState.scrollToItem OR rememberLazyListState.animateScrollToItem just don't seem to work in Jetpack Compose…
TatiOverflow
  • 1,071
  • 2
  • 16
  • 23
4
votes
0 answers

TextField losing focus inside LazyColumn

I'm trying to build an UI that contains a search bar inside a LazyColumn layout. The only problem is that the TextField loses focus if it is not at the top of the screen. Code: val listState = rememberLazyListState() LazyColumn( …
4
votes
3 answers

How to optimize AndroidView composable with a lazy list layout in compose

I have got two problems, scrolling through LazyColumn or VerticalPager with AndroidView filling the whole screen as a child item lags the screen and the scrolling behavior for a couple of milliseconds as well as overlapping items. In my code the…
4
votes
1 answer

Jetpack Compose Lazy Column insertion and deletion animations with multiple item types

What's the best way to animate insertion and deletion animations in lazy column or row with multiple item types similar to how it's done using DiffUtil?
1 2
3
13 14