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

78 questions
1
vote
1 answer

Accessing layoutInfo field from LazyListState causes the enclosing composable to recompose infinitely

Here's an example: @Composable fun MyList(items: List) { val lazyListState = rememberLazyListState() lazyListState.layoutInfo // Accessing this field causes MyList to recompose infinitely LazyColumn(state = lazyListState) { …
1
vote
0 answers

How to use item id values as keys with generics in LazyColumn?

According to this SO answer, we can make a reusable LazyColumn composable by using generics. But, if we need to use the item's id value as the key, using T.id throws an unresolved reference error. How can we specify the id for key values if using…
1
vote
1 answer

Avoid Recomposition in nested column in jetpack compose

I am working on nested column in jetpack compose. I have one list which is huge amount of data coming from server. I was checked in Layout Inspector and I see that whenever my item is added in list it recompose and increase counts. So my doubt is if…
1
vote
1 answer

LazyColumn cuts off items when using with BottomNavigationView and Toolbar

LazyColumn in Jetpack Compose works fine with Scaffold and its inner padding according to this link. but when I try to use it inside a Fragment, it's items cut off by Toolbar and BottomNavigationView. should I calculate inner padding manually…
1
vote
3 answers

How to draw border around the LazyColumn items in Android Compose

There are items() {} sections inside LazyColumn. So I would like to draw a border with rounded corners around each section. Is there any method? // need to draw a border around the items LazyColumn { items(10) { Row { //…
1
vote
2 answers

Jetpack Compose: LazyRow onScrollListener

I was wondering if there is a way or a resource I could refer to in order to achieve a side effect on a LazyRow when an item is scrolled? The side effect is basically to call a function in the viewModel to alter the state of the list's state. The…
1
vote
1 answer

Push a LazyColumn item to end of screen if the LazyColumn is empty

I want to add a footer to LazyColumn that only appears when all the items are scrolled, but if there are no items in the LazyColumn or no enough items to cover the whole screen, I want the footer to show at the bottom of the screen. Since we cannot…
1
vote
1 answer

jetpack compose : creating LazyColumn with items parameter

LazyColumn(modifier = Modifier.fillMaxWidth(), state = listState) { //ABC Category Items item { ABC(componentCoordinator = componentCoordinator) } //DEF Category Items item { DEF(coordinator = screenCoordinator) …
0
votes
1 answer

isSticky state when using stickyHeader in LazyColumn

LazyColumn(state = lazyListState,) { item {} item {} stickyHeader{ stickState.value = lazyListState.firstVisibleItemIndex >= stickyItemIndex //Some item in here } } When using stickyHeader {}, how can I access…
0
votes
0 answers

How to make multiple lazy columns scroll independently each other in Jetpack Compose?

I want to make multiple LazyColumn scrolled simultaneously in Jetpack Compose. But, It seems that one LazyColumn prevent other LazyColumn to be scrolled. Below screenshots is my composable structure. class MainActivity : ComponentActivity() { …
0
votes
0 answers

ExoPlayer issue using AndroidView in LazyColumn Compose

I am trying to have a videoplayer (using ExoPlayer occupying half of the screen's height) at the top of the LazyColumn and list of items below the video player using compose. The list of items redirects to a details screen. I am using navigation…
0
votes
2 answers

Pause image loading in coil onscroll in lazycolumn in jetpack compose android

Pause image loading in coil onscroll in lazycolumn in jetpack compose android We are using Coil to load images with jetpack compose , earlier in glide with recylerview or other lists we had the option to pause loading images when we scrolled , it…
0
votes
1 answer

Arrange items at the top of a ScalingLazyColumn

My layout contains a single ScrollingLazyColumn that fills the entire screen. The first item should be at the top of the screen, but it is centered. Here is my code: @Preview(device = Devices.WEAR_OS_SMALL_ROUND, showBackground = true,…
0
votes
2 answers

Updating item in a mutableStateList is not triggering recomposition in UI (LazyColumn)

I have been scratching my head over this problem. I have a data class representing items that can be selected(or unselected). data class FilterItem( val name: String, val isSelected: Boolean ) I have created a mutableStateList of…
0
votes
1 answer

Jetpack compose Lazycolumn, wrong index when tapping on canvas item

I use a LazyColumn in Jetpack Compose and draw 2 canvas items (4 if screen is rotated) on each row. When i click on one canvas item, I want the canvas to be disabled (background red). I also draw a text item on each canvas to see the index number.…