https://kotlinlang.org logo
Title
r

Roudy Korkis Kanaan

08/08/2022, 4:21 AM
Question about
LazyLayout
, I'm working on a lazy tiles based maps in Compose and using
LazyLayout
to lazily load the tiles as I scroll in both X and Y directions. The logic works well and I'm able to get the performance that I like. The only thing missing is prefetching/ pre-composing and measuring the out of bounds items. Looking at the
LazyList
implementation, it uses a modifier implementing
ModifierLocalProvider<BeyondBoundsLayout?>, BeyondBoundsLayout
, I am trying to do the same and applied to modifier to my
LazyLayout
but the
layout
function inside that implementation is never called. I know this is experimental, but any ideas on how to get the beyond bounds modifier to work ?
s

shikasd

08/08/2022, 9:36 AM
For
BeyondBoundsLayout
, your measurement logic also has to support it Check LazyListMeasure for example of such support :)
r

Roudy Korkis Kanaan

08/08/2022, 9:38 AM
Oh thanks ! I'll give it a look
s

shikasd

08/08/2022, 9:41 AM
It might be the case that there's some other integration piece that I am missing, just can't remember from the top of my head If you look up usages of the method in your ide, it should highlight the missing things implemented for LazyList