https://kotlinlang.org logo
#compose
Title
# compose
t

Tom Truyen

10/19/2023, 9:17 AM
Hi everyone 👋 I have spend the last few days working on an implementation for a Timetable/Calendar view in Jetpack Compose with a free scroll functionality (so being able to scroll in all directions) FreeScroll Library: https://github.com/chihsuanwu/compose-free-scroll/tree/main For the CalendarView I am greatly inspired by https://github.com/drampelt/WeekSchedule. I have managed to get it working, though currently I am using a
Layout
composable just like the "WeekSchedule" app (
BasicSchedule.kt
) does (with some minor adjustments). What I have noticed is that when I have a lot of Events, the scroll seems to get laggy. This lagg is mostly visible in Debug mode (I know that Jetpack Compose optimises a lot in release). Though that got me wondering... Is there a way I can manually recycle/lazily render placeables in a
Layout
dependening on if they are even visible on the screen or not?
I read about
SubcomposeLayout
but I am not sure how to use it at this point in time
o

Oleksandr Balan

10/19/2023, 3:12 PM
Hey 👋 I have been working on something quite similar a few months ago. Mine solution however was based on
LazyLayout
to recycle items, you could check it for an inspiration: https://github.com/oleksandrbalan/minabox
t

Tom Truyen

10/19/2023, 4:02 PM
Funnily enough, I actual found your library and looked into the code which got me on the right track! I managed to also get it working using a
LazyLayout
(without your library though) I did however give you a star as it is an amazing library imo
🤗 1