This view can rain drawables.
- Wind
- 3D
- Wiggle
- Alpha
Configuration can be done via XML or the AnimationView.Config class.
The view uses its default values if nothing gets configured.
A drawable is always needed.
data class Config(
val direction: Int,
val duration: Long,
val spawnDelay: Long,
val simulate3D: Boolean,
val simulateWiggle: Boolean,
val simulateWind: Boolean,
val interpolator: Interpolator,
val drawableConfig: DrawableConfig,
val alphaConfig: AlphaConfig
)
data class DrawableConfig(
val drawable: Drawable?,
val drawableHeight: Int,
val drawableWidth: Int
)
data class AlphaConfig(
val alpha: Boolean,
val from: Float,
val to: Float,
val duration: Long,
val delay: Long
)
For example, call like this:
override fun onResume() {
super.onResume()
av.start()
}
override fun onPause() {
super.onPause()
av.stop()
}
implementation 'com.github.fly8899:RainingAnimationView:1.0.2'
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}