Closed chanjungkim closed 1 year ago
Can you attach a project that reproduces this?
@gpeal here's an example.
https://github.com/chanjungkim/viewPagerWithLottieInCompose
The points are
@gpeal I followed accompanist and lottie compose document. But please let me know if there's something I missed in the code.
Per the accompanist docs, you want to render the page passed into HorizontalPager child scope like this:
) { page ->
ContentItem(contentList[page])
}
I just switched your project to that and it seems to be working fine. I don't think this is a Lottie issue but feel free to reopen again if you think it is.
Here's my questions in Stackoverflow.
https://stackoverflow.com/questions/75118583/how-can-i-solve-outofmemory-issue-with-lottie-and-viewpager-in-jetpack-compose
https://stackoverflow.com/questions/75107130/how-can-i-call-a-page-once-in-jetpack-compose-viewpager
As far as I know, Android Devices have different memory size for each process. And some devices seems have memory problem with Lottie compose with ViewPager compose.
The OS that I've tested are from API23 to API33. Recent devices seem to work well but it uses a lot of memory.
The file I tried is attached. (Since I can't upload *.json, I uploaded in txt extension) intro_1.txt
Here's the record.
https://user-images.githubusercontent.com/19689773/212652410-231dd929-6726-4577-9811-7aed3ec8755d.mov