141 questions
0
votes
1
answer
543
views
LazyList performance issues after Compose 1.4.0 update
I decided to update my project to stable Compose 1.4.0 because of some new fixes, but quickly found out that all of my LazyLists with clickable cards have become very laggy while scrolling. I make my ...
1
vote
1
answer
1k
views
How to use SwipeRefresh with Jetpack Compose LazyColumn and reverseLayout
I am trying to create a chat feature in app. We would like the layout to be reversed in the column for easier scrolling. However, we cannot get the SwipeRefresh to work in this configuration if the ...
2
votes
1
answer
1k
views
Change Alignment of particular child item in LazyColumn jetpack compose
I am using LazyColumn in my @Compsoable screen. Inside LazyColumn there are so many child and which align verticalArrangement = Arrangement.Top and horizontalAlignment = Alignment.CenterHorizontally....
0
votes
1
answer
1k
views
Jetpack compose how to skip one item in a LazyVerticalGrid / java.lang.IllegalStateException: Check failed
i'am starting to work with jetpack compose. i'am creating a grid to display some Box with some text. the problem is that i get my data from my api and some might be null. So i would like to skip this ...
0
votes
1
answer
1k
views
Composable state is lost after scroll and rotation
I have a LazyColumn containing ToggleButtonGroups that I have created myself. My issue can be reproduced by these three steps:
Select "YES" on every ToggleButtonGroup
Rotate the screen and ...
1
vote
1
answer
2k
views
auto scroll screen to last element jetpack compose
I am making a chat bot application. I've searched in many places to solve this problem but couldn't find anything clear. I have an empty list. Bot messages and user messages are added to this list, ...
1
vote
1
answer
693
views
Accessing layoutInfo field from LazyListState causes the enclosing composable to recompose infinitely
Here's an example:
@Composable
fun MyList(items: List<Item>) {
val lazyListState = rememberLazyListState()
lazyListState.layoutInfo // Accessing this field causes MyList to recompose ...
1
vote
1
answer
2k
views
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 ...
0
votes
0
answers
2k
views
How To Properly Pass Model Class In Navigation Of Jetpack Compose
I have a pretty basic application in Jetpack Compose, where:
First screen has a lazyColumn with many items
Users can click on an item and be moved to a screen with details about the clicked item
Each ...
4
votes
1
answer
2k
views
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 ...
3
votes
3
answers
6k
views
How can I use LazyColumn in LazyColumn in jetpack compose?
I got this error message, And I don't get it.
java.lang.IllegalState
Exception: Vertically scrollable component was measured with an
infinity maximum height constraints, which is disallowed. One of ...
9
votes
0
answers
3k
views
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 ...
3
votes
3
answers
8k
views
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 {
...
8
votes
1
answer
4k
views
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 = ...
12
votes
1
answer
2k
views
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 ...
1
vote
3
answers
3k
views
Add separator in LazyColum in jetpack compose
I am learning LazyColum in jetpack compose. I want to add Separator in my each item in some condition, please have a look on below MessageList() function. Also I'll add a screenshot to clearly ...
4
votes
2
answers
1k
views
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/...
1
vote
1
answer
3k
views
jetpack compose : creating LazyColumn with items parameter
LazyColumn(modifier = Modifier.fillMaxWidth(), state = listState) {
//ABC Category Items
item {
ABC(componentCoordinator = componentCoordinator)
}
//DEF Category Items
...
3
votes
2
answers
3k
views
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 ...
31
votes
7
answers
26k
views
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.
75
votes
8
answers
80k
views
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 ...