106 questions
1
vote
1
answer
548
views
How to create LazyColumn with both draggable and non-draggable titles and dividers?
I found an example of simple lazy lists with draggable items and tried to modify it to suit my needs. I need to be able to list the indices of the elements on which dragging doesn't work and, if there ...
0
votes
0
answers
730
views
Detect swipe gesture between Composable in Jetpack Compose
I'm currently working on an app that one of its functionality is to detect defect in touchscreen. There are Grids in which user have to touch to confirm that section of the touchscreen is working. ...
0
votes
1
answer
1k
views
Jetpack Compose. How to center text in LazyColumn
I'm trying to implement simple list. When list is empty I need to show empty placeholder in the center of the screen. Here is my code:
LazyColumn(
modifier = Modifier
....
0
votes
1
answer
1k
views
Jetpack Compose TvLazyColumn PivotOffset for items with different sizes
I am using TvLazyColumn composable with 7 items, and inside of each item has a title and a TvLazyRow with a list of video thumbnail images which are focusable.
Out of the 7 items, 6 have identical ...
0
votes
1
answer
2k
views
Managing nested state for checkboxes with Jetpack Compose
I am facing a weird issue with jetpack compose where I can get a child state to manage itself, or have the parent state manage child state, but not both.
In the below example (I removed a lot of ...
1
vote
0
answers
124
views
Bottom Sheet's scroll behavior is triggered instead of the Column's scroll behavior
I have a BottomSheetDialogFragment. In the OnCreateView, I return a ComposeView. Inside the ComposeView, I have a Column with a Vertical Scroll
since the column has quite a few items.
When I swipe up ...
5
votes
1
answer
3k
views
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 ...
2
votes
1
answer
879
views
Jetpack Compose LazyColumn Performance Issue
I'm writing example-screen with using lazyColumn. I encountered some performance issues on release build. Frame skipping happens when I fast-scroll the list.
All models and composables are stable. My ...
0
votes
1
answer
4k
views
Map item index in lazy column to item index in list
So I have a marketplace list similar to the code snippet attached. We have a list of marketplace items in the viewmodel being observed as our state. We break down each marketplace item into a lazyitem ...
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 {
...
2
votes
2
answers
3k
views
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 ...
2
votes
1
answer
2k
views
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 ...
5
votes
2
answers
2k
views
Custom Compose Arrangement to add extra spacing at beginning and end of a LazyRow/LazyColumn
How can I create a custom Arrangement for LazyRow to add additional spacing at beginning and end, but have even spacing in between?
Start|< more space> Item 1 Item 2 Last Item |End
object ...
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 ...
1
vote
1
answer
661
views
Item index inside rememberDismissState not being updated on list update in LazyColumn itemsIndexed
I have a LazyColumn with some items where you can only remove the first item in the list (index 0).
The LazyColumn looks something like this:
LazyColumn {
itemsIndexed(items, key = { _, item -> ...
4
votes
3
answers
5k
views
Compose LazyColumn key, messes up scrolling when sorting the items
I'm trying to implement simple sort with items that are in a state.
This will work perfectly, only problem is that the animation is now gone, because it doesn't have a key.
LazyColumn(
state = ...
7
votes
1
answer
6k
views
How to make a LazyColumn item occupy the remaining height on Jetpack Compose
Can I make a item on LazyColumn occupy only the remaining height available? I'm I tried to use fillParentMaxSize but it make the item as the same size of the LazyColumn, so i can't put another item ...
6
votes
1
answer
1k
views
LazyVerticalGrid or LazyColumn clips the content horizontally when using contentPadding
I have a case that I need to put a LazyRow inside a LazyVerticalGrid but when I set a contentPadding in grid it clips the lazy row horizontally. If I remove it than I will need to manually give ...
17
votes
5
answers
8k
views
Jetpack Compose LazyRow - Center selected item
How can I calculate the position of the selected item in a LazyRow and use it for centering the item on the screen?
The items will have various sizes depending on their content.
If I go with ...
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/...
5
votes
2
answers
4k
views
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 ...
2
votes
1
answer
103
views
mutableStateOf() not assinging new object?
I am updating the old mutableStateOf() object data by modifying it but new data is not reflecting on it.
variable: as
val offTime = mutableStateOf<List<OffTime>>(emptyList())
update code
...
2
votes
1
answer
474
views
How can I know the how many items will be drawn on the screen, so I can put a custom item as the last item. Without scrolling. Using Jetpack Compose
I want to show items in a grid but not scrollable. How can I know how many items I will draw on the screen based on its height and width. here i am showing only 9 items on the screen and putting the ...
4
votes
1
answer
2k
views
How to animate a center alignment in Jetpack Compose?
I was playing around with the Jetpack Compose basic codelab, and wanted to add an Icon centered in a Row, but I'm unable to animate it.
Is it possible to get a smooth animation, so that the icon is ...
0
votes
1
answer
932
views
Apply alpha after scrolling part of the screen in Jetpack Compose
I have an Image as a background. I want that after scrolling up to 1.5x the height of the screen, the alpha value of the Composable start changing. his is the logic that seems correct to me:
val ...
4
votes
1
answer
3k
views
I want to achieve the below layout, the button should be at the bottom of the screen, when the lazy column is filled, the button shouldn't go outside
There is lazy column at top and below the lazy column there is enter phone number layout and add contact from phonebook layout, I want this layout to be at top when no contact is added and when I add ...
1
vote
1
answer
3k
views
Jetpack compose - lazycolumn fillMaxHeight modifier hides widgets below, but not destroying widgets above
I'm trying to build a simple chat screen, with a header, a footer (text field) and the messages part which is a lazycolumn. I've seen many people using such methods like the ones below: (fill parent ...
0
votes
1
answer
482
views
Unexplained Snapping Behaviour In A Programmatically Scrolled "Lazy List""
I stumbled upon this issue while trying to solve a case. To summarise, the patient needed complete control over the 'speed' of the scroll. Now, Android's sensible defaults have the item-scroll follow ...
2
votes
3
answers
4k
views
Changing scroll speed on LazyRow
Looking at the documentation for LazyRow I was wondering if it was possible to reduce the scroll speed, it looks like LazyRow inherits from ScrollState but I can't find anything useful on how to ...
1
vote
1
answer
376
views
Accompanist SwipeRefresh Inside LazyColumn
I'm trying to place a SwipeRefresh layout inside a LazyColumn and scope it to include the 2 item calls and one items call, below a item {LazyRow(inside LazyColumn)} and below another item{}.
So what I'...
0
votes
2
answers
884
views
Row composable not taking up the full width of parent
I have a shopping list item composable that is not taking up the entire width of the parent, as you can see below with the red border. I want it to be flush against the parent's edge. And why is there ...
5
votes
1
answer
5k
views
Jetpack Compose - How to get LazyVerticaGrid item row index?
I'm using a LazyVerticalGrid to display items, with Adaptive GridCells, i.e. there's a variable number of columns depending on the screen width.
LazyVerticalGrid(
columns = GridCells.Adaptive(...
62
votes
7
answers
39k
views
Jetpack Compose: nested LazyColumn / LazyRow
I've read through similar topics but I couldn't find satisfactory result:
What is the equivalent of NestedScrollView + RecyclerView or Nested RecyclerView (Recycler inside another recycler) in ...
3
votes
1
answer
2k
views
LazyList memory leak in Jetpack Compose
I found out that LazyList generates memory leaks. When I scroll down to the bottom of the list memory usage by my app increases by ~3MB. After I scroll up and usage also increases by ~3MB. Memory ...
1
vote
0
answers
675
views
Efficient Way to Animate Big Content Changes in a LazyColumn
I have a fully functional list, containing a complex item... a list of complex Composables, that is. I use LazyColumn for the job, but I then wished to allow the user to long-press on an item and ...
1
vote
1
answer
2k
views
Nested State for checkbox in jetpack compose
I have face problem related to states in jetpack compose. Problem is that I have list that contains questions. Some question need radio button for single selection and some question need checkbox for ...
14
votes
1
answer
3k
views
DropDownMenu frame drops and lags in Jetpack Compose
So I am bit of in a pickle now.
The Begining
I have list of countries and I want to allow the user to pick any of them by showing a drop a down menu, and earlier no jetpack compose way, I had a an ...
0
votes
2
answers
2k
views
Searching a List with Check Box Selection in Jetpack Compose
Currently there is a Lazy Column with Text along with Custom Checkbox. I am currently able to maintain the Checkbox selection in Lazy Column by using the following code. Even during scrolls (up/down) ...
3
votes
2
answers
6k
views
Jetpack Compose - Make the first element in a LazyRow be aligned to the center of the screen
I want to obtain a LazyRow that looks like this:
|--aaa-b|bb-cccc|-dd... ...|w--x---|
|-------| is one screen width
The size of the elements varies but they have a fixed spacing between them.
I ...
1
vote
2
answers
2k
views
Jetpack Compose LazyList - possible to zoom the center item?
I am wondering if it is possible to have a list where you can scroll through - and all the items have a simple view which is shown by default and then a more detailed view which is shown when the item ...
8
votes
1
answer
2k
views
AdManagerAdView not rendering ad image when off screen in LazyColumn
I am wrapping an AdManagerAdView in an AndroidView so I can use it in Jetpack Compose. The image fails to load when I use it in a LazyColumn AND the AdManagerAdView tries to load the image before the ...
14
votes
3
answers
21k
views
Jetpack compose collectAsState() is not collecting a hot flow when the list is modified
When I use collectAsState(), the collect {} is triggered only when a new list is passed, not when it is modified and emitted.
View Model
@HiltViewModel
class MyViewModel @Inject constructor() : ...
0
votes
0
answers
2k
views
LazyColumn list not showing in jetpack compose
I m new To Jetpack Compose , i'm trying to create a Proxy list app , used lazy column to list proxies but its now showing .. app runs successfully but result not getting , Give Me a Solution . Thx
...
3
votes
1
answer
6k
views
Jetpack Compose Recomposition every state changes
Here is my problem;
When I add MyText composable in my Screen, I see all Logs (value1, value2, value3) which means it is recomposing every part of my code.
However when I comment the MyText line, I ...
4
votes
2
answers
4k
views
Hidden bottom item in LazyColumn - Jetpack Compose
I am trying to create a list of items with a hidden button at the bottom. By default the button is not visible on the screen.
If a user scrolls to the bottom of the list the button should appear like ...
3
votes
1
answer
1k
views
Perform different actions based upon items inside LazyColumn in android compose, different onClick events
I am creating a profile page for the app and need to perform different actions based upon items clicked inside LazyColumn.
What I want is when I click on Rate us, play store to open, click on feedback ...
1
vote
1
answer
1k
views
Jetpack Compose - LazyColumn children not redrawn on recompose
I have a very strange problem with my LazyColumn. I am updating the menuList State in the ViewModel, the view recomposes but the list doesn't get redrawn.
When I use the debugger, it gets to ...
4
votes
1
answer
2k
views
Read-only mutableStateListOf
In Jetpack Compose, if I have a MutableState variable, I can expose it's State as "read-only" value to other classes as State<String>, just like:
private val _title = mutableStateOf(&...
0
votes
1
answer
74
views
How do I know a `LazyColumn` can be navigated?
How do I know a LazyColumn can be navigated?
For example, a list contains 100 elements, then it is a lazy column that can be scroll and we show a fab button to scroll up, but when this list contains 5 ...
14
votes
1
answer
8k
views
An efficient way to check when a specific LazyColumn item comes into view?
I need to check when a certain LazyColumn item comes into view, and once it does, make a callback to onItemWithKeyViewed() only once to notify that this item has been viewed.
My attempt:
@Composable
...