-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sample App is not responding after continuously touching for long time in FollowCursorExampleActivity #38
Comments
If you need me to provide Video and Log file, just me know! |
This works as intended. A particle system does create a pool of particles and attaches itself to the view hierarchy. It is meant to be used in one of the following ways:
If you want to create multiple particle systems and make them auto-release once the oneShot is completed, you need to add a listener there and remove the particle system from the View hierarchy. As I said, that is not the way it is intended to work, you should create a few particle systems and reuse them, but if you really want to go that way, the solution is what I stated before. |
Dear Mr Raul, Second thing is with oneShot it doesn't specify emit point position like If you have any ideas for this problem, could you please let me know. Thank you again for all your help.
|
The position is calculated based on the parent view, setting the position was a later addition for special cases like the follow touch example. It should be possible to create a particle system during onCreate, as long as it is done after setContentView. You can change the position anytime using the same method and then call oneShot. If it does not, that is a bug that should be solved (I haven't tried that particular case myself). In this case, each time the user clicks, the oneShot will move, so if it is clicked before the previous one finishes there could be a visual glitch. I suggest you create a pool of ParticleSystems and dynamically change the position and call oneShot, adding a listener when the oneShot is completed to return the particle system to the pool. Given that each ParticleSystem creates a View to draw with, a small number should be easy to manage (that is also the cause of the unresponsiveness on your case) The other solution is to create a method that finalizes the oneShot by removing the particle system from the view hierarchy. The first solution (pool) is probably easier. |
Thank you very much for your help, it works well now. I already handled 2016-02-22 17:46 GMT+07:00 Raul Portales notifications@github.com:
|
Good to know, I hope this thread is useful for someone else in your situation. |
As I mention above, after touching continuously for several minutes, sample app will be not responding. If I increase to several ParticleSystem, it will be faster to not responding.
The problem can be it just create new ParticleSystem objects, but after using it. The app still keep memory for those object without free them and continuously create new objects when touching. (I don't see you have function to free the memory).
It will be great if you can fix this issue and destructive objects after using them. Thank you very much for your time.
The text was updated successfully, but these errors were encountered: