Questions tagged [lazycolumn]

209 questions
7
votes
1 answer

Sticky headers like android contacts in Jetpack Compose

I didn't find any way to have a stickyHeader on the same line as an item in a LazyColumn: So I used a Box to put the letter with its background on top of the LazyColumn and used the LazyListState to put it in the right position…
Jfreu
  • 511
  • 5
  • 10
7
votes
2 answers

Jetpack Compose: No recomposition happening, when updating list element contents

I am experimenting with Android's Jetpack Compose. For simple use cases everything is working as expected, but I am having some trouble with missing recompositions for a more advanced case. My Model: I am simulating a Storage system for ingredients,…
7
votes
4 answers

The last elements are not visible in LazyColumn. Jetpack Compose

I take an example from this codelab override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View { return ComposeView(requireContext()).apply { setContent { …
6
votes
1 answer

How to use LazyColumn's animateItemPlacement() without autoscrolling on changes?

I am using a LazyColumn in a checklist like style. The list shows all to-be-done items first and all done items last. Tapping on an item toggles whether it is done. Here is an MWE of what I am doing: data class TodoItem(val id: Int, val label:…
Tim
  • 1,430
  • 15
  • 36
6
votes
2 answers

Single Selection - DeSelection in Lazy Column

PROBLEM ::: I want to create a lazy column where I can select or deselect only one option at a time. Right now, whenever I click on row component inside lazy column, all the rows get selected. CODE ::: @Composable fun LazyColumnWithSelection() { …
6
votes
2 answers

Jetpack Compose: how to reset LazyListState?

I have a LazyColumn with nested LazyRows (similar to Netflix or Spotify home page feed). In short, the issue I'm having is that when the content of the page changes, the scrolling positions of the nested LazyRows are not reset. For example, user…
6
votes
1 answer

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 composable is on screen. If I scroll quickly to…
6
votes
1 answer

Jetpack Compose BottomSheetScaffold sheetGestures disabled but gestures still works when child component is scrollable

I have a BottomSheetScaffold inside my android app that looks like the following: BottomSheetScaffold( sheetGesturesEnabled = false, sheetContent = { MyContent() }, scaffoldState = bottomSheetScaffoldState, ) { …
J. Hegg
  • 1,365
  • 11
  • 31
6
votes
4 answers

Compose: LazyColumn recomposes all items on single item update

I am trying to show a list of Orders in a list using LazyColumn. Here is the code: @Composable private fun MyOrders( orders: List?, onClick: (String, OrderStatus) -> Unit ) { orders?.let { LazyColumn { items( …
Chandra Sekhar
  • 18,914
  • 16
  • 84
  • 125
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…
5
votes
1 answer

How to animate list initial population in Android Jetpack compose

My current Android Jetpack Compose project contains a number of lists and grids. I would like to animate the initial population of my lists and grids to bring some life to my application. I have found documentation for inserting, deleting etc. of…
Hector
  • 4,016
  • 21
  • 112
  • 211
5
votes
1 answer

Fetching words from Firestore does not update LazyColumn Jetpack Compose

@Composable fun getData() { var wordData = arrayListOf() db.get().addOnSuccessListener { documents -> for (document in documents) { wordData.add(document.toObject(Word::class.java)) } …
user20197752
5
votes
1 answer

Removing item from the list causes wrong display in LazyColumn

So here's an odd one, I think. I'm showing a list of Textfields in a LazyColoumn. The user can remove each of the textfields, but when doing so, it copies the value from REPLACE textfield. What's happening: I have added 3 people: Person 1, Person…
5
votes
1 answer

Jetpack compose lazy column not recomposing with list

I have a list which is stored inside a Viewmodel via Stateflow. class FirstSettingViewModel : ViewModel() { private val _mRoomList = MutableStateFlow>(mutableListOf()) val mRoomList: StateFlow> = _mRoomList …
5
votes
1 answer

How to write Text into TextFields in a Lazycolumn at the bottom of the screen

I'm having a problem with TextFields inside a LazyColumn. My goal is to have a LazyColumn with a bunch of TextFields where I can scroll to see the whole content of the LazyColumn even if the keyboard is active enter a new line to a TextField and…
1
2
3
13 14