Guilherme Delgado
01/11/2023, 12:47 PMLazyColumn with stickyHeader and itemsIndexed. To build it I’m using .forEach { (header, data) ->. Let’s say I would have a “today” button, how can I scroll to a desired stickyHeader position making it the first item visible? As far as i know I don’t have access to stickyHeader indexes 🤔Oleksandr Balan
01/11/2023, 1:48 PMcontent lambda of the LazyColumn. Just create a variable “index” with 0 initial value and increment it with each item/header added. When adding header with stickyHeader, also add an entry to your map and use current “index” value.
It should be safe to increment stuff in content lambda, as it is not in Composable scope.Guilherme Delgado
01/11/2023, 4:02 PM