Git Product home page Git Product logo

android-snowfall's Introduction

Android-Snowfall

Android Arsenal Release API AndroidWeekly AndroidDev Digest

Fully customizable implementation of "Snowfall View" on Android.

That's how we use it in our app Hotellook

image

Compatibility

This library is compatible from API 16 (Android 4.1).

Download

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

Add the dependency

dependencies {
    compile 'com.github.jetradarmobile:android-snowfall:1.2.1'
}

Usage

Default implementation with round snowflakes:

<com.jetradarmobile.snowfall.SnowfallView
      android:layout_width="match_parent"
      android:layout_height="match_parent"/>

Fully customized implementation:

<com.jetradarmobile.snowfall.SnowfallView
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:snowflakesNum="250"
      app:snowflakeAlphaMin="150"
      app:snowflakeAlphaMax="255"
      app:snowflakeAngleMax="5"
      app:snowflakeSizeMin="8dp"
      app:snowflakeSizeMax="32dp"
      app:snowflakeSpeedMin="4"
      app:snowflakeSpeedMax="12"
      app:snowflakesFadingEnabled="true"
      app:snowflakesAlreadyFalling="false"
      app:snowflakeImage="@drawable/snowflake"/>

License

Copyright 2016 JetRadar

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

android-snowfall's People

Contributors

b1uebyte avatar dnihze avatar ivacf avatar johnkil avatar jonathan-caryl avatar yuridenison avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-snowfall's Issues

Different snow Flakes icons ?

Hello is there a way to add multiple snow flakes icons and make them appear randomly on the activity ? thank you!

Orientation change

Starts falling again from top when orientation change i think in to the library project configurationwith screenlayout change isnt added in activity .in manifest

doesn't change image programmatically

I want to change snow flake image programmatically.
Please do something and let me know through email.
Above issues is the only missing in this library.
Thank you so much for this library.

Page loading slow when i use snow fall animation.

I have my Editext field and snow fall animations at the same page. When i try to enter text in the edittext field it takes more time for the text to be show. It is because of the animations in the page makes the text to appear slow. Is there any way to view the text as soon as possible after it is being typed?

Thanks in Advance.

Getting class cast exception

I am using default implementation as provided in Readme and getting this problem :

java.lang.ClassCastException: com.jetradarmobile.snowfall.SnowfallView cannot be cast to android.view.ViewGroup
	at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:859)
	at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
	at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
	at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:861)
	at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
	at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
	at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:324)
	at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
	at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:389)
	at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:548)
	at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:533)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:966)
	at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:533)
	at com.android.tools.idea.rendering.RenderTask.lambda$inflate$70(RenderTask.java:659)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Performance issue with recyclerview

I am trying to integrate this snowfall effect in recyclerview and it is looking quite good.
But without snowfall effect recyclerview is scrolling smoothly and integration of snowfall makes recyclerview scrolling hazy.

Do you know this is happening ?
Any direction and guide will be really helpful.
Thanks.

Thread-safe

The code is not thread-safe. There are two threads accessing the snowflake objects at the same time, the main thread in onDraw() and a background thread. This can cause the snowflakes to be drawn at incorrect positions.

You should really do everything on the main thread if possible, if not then you need to copy the array before passing it to the background thread then post it back to the main thread when the work is done so they don't interfere with each other.

[source]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.