Closed magneticflux- closed 7 years ago
Hi,
thank you for being interested in WeatherView library. I've tested the library and the particles can stay outside of the parent view even when android:clipChildren="true"
is set.
I can't understand your solution. Can you give more information?
The solution I added to my fork gets the parent view of the WeatherView and casts it to a ViewGroup, which it gives to the ParticleSystem. The ParticleSystem then adds a ParticleField view to the parent ViewGroup on which it draws the particles. This means that the Canvas that the particles are drawn on is clipped to the parent of the WeatherView. There is no visible change to the demo app since the WeatherView used there covers the entire screen. Tonight (10h away) I will try a modified method of this that I believe will solve some issues with emitter positions and offsets.
Currently, the ParticleSystem is initialized inside of
android.R.id.content
, which is effectively the entire screen. This means that particles can stray outside of the parent view even whenandroid:clipChildren="true"
is set.To alleviate this, the
WeatherView
class should extendFrameLayout
so that theParticleField
can be inserted in it at runtime by Leonids. Then,this
should be passed when creating aParticleSystem
.