Open JohnMerlino2 opened 6 years ago
i face same problem
Solution is to delay action of generating particles
i used this Handler().postDelayed({ stratAnim() }, 1200)
with kotlin
That is not the best solution, this is most likely the same problem as for Activities regarding that while onCreate the views are not yet measured. The suggested solution is to observe the view tree .
For more details see https://github.com/plattysoft/Leonids/issues/22
@plattysoft why not make it as internal implementation of lib to start anim when views are measured
if you create the ParticleSystem after the views are measured, you can don't get a ViewTreeObserver callback, so the system does not know if the views are been measured yet, or if they have been measured before creating. This needs to be tied to the ActivityLifecycle, maybe using the lifecycle components it could be done.
I have a fragment:
AnimationFragment.java
I have a view in Fragment with animationBox id:
Notice I initialized the ParticleSystem in onCreateView. When I run the app, nothing shows. Can the Particle System with with Fragments?