plattysoft / Leonids

A Particle System for standard Android UI: http://plattysoft.github.io/Leonids/
Apache License 2.0
2.28k stars 398 forks source link

Particles stuck on screen after stopEmitting() and few fragment transactions #69

Open stfbee opened 7 years ago

stfbee commented 7 years ago
  1. Start emission
  2. Stop it
  3. Switch some fragments while the particles are still there on the screen
  4. After few switches they are stuck on screen and they are not deleted on next emission start.

Bug occurs on version 1.3.2. On 1.3.1 all right.

plattysoft commented 7 years ago

Thanks for the heads up. This is an interesting bug.

So, in principle the particles should not stop when the emitter stops because they need to do the lifecycle. This is shown on the follow touch example.

Now, what happens here is that some of the components get disconnected when paused and do not get reconnected when resumed. Most likely the timers.

Since I always used it on Activities that finish, this is not something I've seen before.

I would need to look at the lifecycle of fragments to see how to fix it properly, but I do not have time for that at the moment.

I hope I have given you any hint on how to solve it yourself.

stfbee commented 7 years ago

No problem at this moment, i just downgraded to previous version.

23 янв. 2017 г. 4:27 ПП пользователь "Raul Portales" < notifications@github.com> написал:

Thanks for the heads up. This is an interesting bug.

So, in principle the particles should not stop when the emitter stops because they need to do the lifecycle. This is shown on the follow touch example.

Now, what happens here is that some of the components get disconnected when paused and do not get reconnected when resumed. Most likely the timers.

Since I always used it on Activities that finish, this is not something I've seen before.

I would need to look at the lifecycle of fragments to see how to fix it properly, but I do not have time for that at the moment.

I hope I have given you any hint on how to solve it yourself.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/plattysoft/Leonids/issues/69#issuecomment-274487505, or mute the thread https://github.com/notifications/unsubscribe-auth/AA8U9bZ5Vi3sddllhV9MUYpFOO6U5J6bks5rVKrWgaJpZM4LokZH .

mujeebwazir commented 6 years ago

i have the same issue too and i m explaining this as; 1) Do not show animation while using in oncreate() and then it works after opening the app several times. 2) Unable to stop or cancel animation in the same activity.

sarantist commented 5 years ago

stopEmitting () Stops the emission of new particles, but the active ones are updated.

cancel () Stops the emission of new particles and cancles the active ones.

cancel() will clear any stuck particles on the Fragment