MatteoBattilana/WeatherView


WeatherView is an Android Library let you make cool weather animations for your app

Download


Step 1. Add the JitPack repository to your build file

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

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.matteoBattilana:WeatherView:3.0.0'
	}
	dependencies {
		implementation("com.github.matteoBattilana:WeatherView:3.0.0")
	}
	<dependency>
	    <groupId>com.github.matteoBattilana</groupId>
	    <artifactId>WeatherView</artifactId>
	    <version>3.0.0</version>
	</dependency>

                            
    libraryDependencies += "com.github.matteoBattilana" % "WeatherView" % "3.0.0"
        
        

                            
    :dependencies [[com.github.matteoBattilana/WeatherView "3.0.0"]]
        
        

Readme


Android Arsenal Android Gems

<a href="https://play.google.com/store/apps/details?id=xyz.matteobattilana.weatherview"><img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/apps/en-play-badge-border.png" width="200" /></a> <a href="https://www.youtube.com/watch?v=Lw65v6QPz_M"><img alt="Watch the demo video" src="images/youtube.png" width="200" /></a>


WeatherView

WeatherView is an Android Library that helps you make a cool weather animation for your app.<br/> This library is based on the confetti library.

<p align="center"> <img src="images/sample_video_rain_1.gif" width="320"> <img src="images/sample_video_snow_1.gif" width="320"> <p>

Setup

Android Studio / Gradle

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

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

Add the dependency:

dependencies {
    implementation 'com.github.MatteoBattilana:WeatherView:3.0.0'
}

Simple usage

Simple use cases will look something like this:

Kotlin

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
	
	weather_view.setWeatherData(PrecipType.RAIN)
     }
 }

Java

public class Main2Activity extends AppCompatActivity
{
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        WeatherView weatherView = findViewById(R.id.weather_view);
        weatherView.setWeatherData(PrecipType.RAIN);
    }
}
<com.github.matteobattilana.weather.WeatherView
    android:id="@+id/weather_view"
    android:layout_width="0dp"
    android:layout_height="0dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

For examples of usage, see the demo app.

Screenshots

<img src="images/sample_clear_1.png" width="250"> <img src="images/sample_rain_1.png" width="250"> <img src="images/sample_snow_1.png" width="250">

License details

Copyright 2019 Matteo Battilana

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.

The library is Free Software, you can use it, extended with no requirement to open source your changes. You can also make paid apps using it.