This is a small library which provides a simple View that animates snowfall using any image you provide to it as a snowflake.
Simply add the following in your project build.gradle
file:
allprojects {
repositories {
...
maven { url 'https://www.jitpack.io' }
}
}
Add the dependency to your module build.gradle
:
dependencies {
compile 'com.github.ivorcho:SnowfallView:1.0'
}
Simply add the view to your layout. Make sure it is on top of all of your views so it is visible:
<com.ivorcho.snowfallview.SnowfallView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:snowflake="@drawable/ic_snowflake"
app:spawnRate="400"/>
You can use the following attributes for customization:
snowflake
- Reference to a drawable which to be used as a snowflake. Coresponding method:setFlakeImage()
spawnRate
- Rate in milliseconds at which the snowflakes are spawned. Coresponding method:setSnowflakeSpawnRate()