JetradarMobile / android-snowfall

Fully customizable implementation of "Snowfall View" on Android.
Apache License 2.0
1.17k stars 173 forks source link

should start stopped #20

Open oduconge opened 6 years ago

oduconge commented 6 years ago

if I stop it on the onCreate, the animation always continuous...

kuba14 commented 5 years ago

For stopping/starting, just use visibility attribute.

gcantoni commented 4 years ago

Just use this: com.jetradarmobile.snowfall.SnowfallView snow; snow = findViewById(R.id.snow); snow.setVisibility(View.VISIBLE);

And in your desired layout xml file: <com.jetradarmobile.snowfall.SnowfallView android:id="@+id/snow" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="invisible" />

If you want to start/stop it you can use for example SharedPreferences.

if (prefs.getBoolean("snowPref", true)) { com.jetradarmobile.snowfall.SnowfallView snow; snow = findViewById(R.id.snow); snow.setVisibility(View.VISIBLE); }