r/androiddev•
lavanasur

how to fix the laggy compose animations (even after the release apk)?

I used this code to create a slide in slide out animation.

Initially I used google's official slideIntoContainer but it is super laggy and even buggy (even with release apk).

So i decided to use the above code. It is better and very optimized (apk size is 750kb compared to 4.5 mb using google's recommended animations).

Yet this solution is still laggy. Less laggy than slideIntoContainer. But still laggy.

I have done the slide in and out animations using xml and kotlin and it worked buttery smooth. no lag. no bugs.

The only problem with xml kotlin was, the 'overridePendingTransition' is now deprecated and its alternative 'overrideActivityTransition' needs minimum sdk 34.

So, how do i fix this lag. Also, is this lag limited to only this kind of animation or are there any other areas where there is lag as well using compose?

I'm now rethinking my choice of switching from xml to compose.

Posted Nov 1, 2023, 3:56 PM UTC

43
Loading comments…