GithubHelp home page GithubHelp logo

rainyview's Introduction

RainyView

Download Api reqeust Apache License 2.0 Blog

A rainy rainy rainy view. ( ˘•灬•˘ )


gif1


gif2


Usage

Gradle

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

dependencies {
    implementation 'me.samlss:rainyview:1.0.0'
}

Maven

<dependency>
  <groupId>me.samlss</groupId>
  <artifactId>rainyview</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

In layout.xml

    <me.samlss.view.RainyView
          app:left_cloud_color="#B7AC8D"
          app:right_cloud_color="#9b8f84"
          app:raindrop_color="#9aa9bb"
          app:raindrop_creation_interval="10"
          app:raindrop_max_number="50"
          app:raindrop_max_length="50"
          app:raindrop_min_length="20"
          app:raindrop_min_speed="1"
          app:raindrop_max_speed="3"
          app:raindrop_size="15"
          app:raindrop_slope="-4"
          android:layout_weight="1"
          android:layout_width="0dp"
          android:layout_height="match_parent" />

In code

rainyView.setLeftCloudColor(Color.parseColor("#B7AC8D")); //Set the color of the left cloud
rainyView.setRightCloudColor(Color.parseColor("#9b8f84")); //Set the color of the right cloud
rainyView.setRainDropColor(Color.parseColor("#9aa9bb")); //Set the color of the raindrop
rainyView.setRainDropMaxNumber(50); //Set the max number of the raindrop
rainyView.setRainDropMaxLength(50); //Set the max length of the raindrop
rainyView.setRainDropMinLength(20); //Set the min length of the raindrop
rainyView.setRainDropMaxSpeed(3); //Set the max speed of the raindrop
rainyView.setRainDropMinSpeed(1); //Set the min speed of the raindrop
rainyView.setRainDropSlope(-4); //Set the slope of the raindrop
rainyView.setRainDropCreationInterval(10); //Set the creation interval of the raindrop

rainyView.start(); //Start animation
rainyView.stop(); //Stop animation
rainyView.release(); //Release the rainy view

attr

    <declare-styleable name="RainyView">
        <!--The color of raindrop-->
        <attr name="raindrop_color" format="color"></attr>

        <!--The color of the left cloud-->
        <attr name="left_cloud_color" format="color"></attr>

        <!--The color of the right cloud-->
        <attr name="right_cloud_color" format="color"></attr>

        <!--Number of raindrops that can coexist at the same time-->
        <attr name="raindrop_max_number" format="integer"></attr>

        <!--The creation of the raindrop interval in millis-->
        <attr name="raindrop_creation_interval" format="integer"></attr>

        <!--The min length in pixel of every raindrop-->
        <attr name="raindrop_min_length" format="integer"></attr>

        <!--The max length in pixel of every raindrop-->
        <attr name="raindrop_max_length" format="integer"></attr>

        <!--The size in pixel of every raindrop-->
        <attr name="raindrop_size" format="integer"></attr>

        <!--The min speed of every raindrop-->
        <attr name="raindrop_min_speed" format="float"></attr>

        <!--The max speed of every raindrop-->
        <attr name="raindrop_max_speed" format="float"></attr>

        <!--The slope of every raindrop-->
        <attr name="raindrop_slope" format="float"></attr>
    </declare-styleable>

License

Copyright 2018 samlss

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.

rainyview's People

Contributors

samlss 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

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.