ui-lottie icon indicating copy to clipboard operation
ui-lottie copied to clipboard

Delay when showing the view in android navigation

Open vallemar opened this issue 2 years ago • 4 comments

When I navigate to a page with lottie it has a delay until it appears, it can be seen in the video. It is not always the same delay, there are times it is more and other times it is less

https://github.com/nativescript-community/ui-lottie/assets/15719383/7d524f62-99da-4cc7-87b2-160e3c1bdb29

It doesn't just happen to me with that lottie, I have another one on another screen and I also have the same behavior

Note: I have tried to put everything directly in the initNativeView method of the plugin so that it does not take long to start the properties, but it keeps doing the same thing Captura de pantalla 2023-09-30 a las 11 18 49

vallemar avatar Sep 30 '23 09:09 vallemar

It must be the loading / parsing of the Lottie content which might be taking some time. Have you tried using a file path? (Which is what you should always do). You can create a repro sample project

farfromrefug avatar Sep 30 '23 10:09 farfromrefug

@farfromrefug I have found the problem, it is its fork  😅, with NS this does not happen. I found it because when creating the simple demo it didn't happen and I tried with the fork and that's when it happens, this is the example:

Repo: https://github.com/vallemar/ns-lottie/tree/main Comment this for disable fork: https://github.com/vallemar/ns-lottie/blob/main/webpack.config.js#L7

Note: It is not seen in all navigations, so if it is not detected, enter and exit several times. In my project it is more noticeable, I think it is because I have more views

And yes, in my project I use the assets path for the Lotties, the previous string was only a test to check that it was not slow loading the file

vallemar avatar Sep 30 '23 11:09 vallemar

OK great will test and see what could be wrong in my fork ;)

farfromrefug avatar Sep 30 '23 14:09 farfromrefug

@vallemar I dont see any delay with your demo app. Neither on an emulator(android 10) nor on a real device (android 13). I must have navigated a 100 times.

farfromrefug avatar Oct 04 '23 13:10 farfromrefug