Giter Site home page Giter Site logo

gaurav414u / android-ripple-pulse-animation Goto Github PK

View Code? Open in Web Editor NEW
118.0 4.0 17.0 1.59 MB

A cool ripple and pulse background animation for android

License: Apache License 2.0

Java 100.00%
android-library ripple-animation pulse-background-animation android ring android-animation

android-ripple-pulse-animation's Introduction

android-ripple-pulse-animation

A cool ripple and pulse background animation for android with configurable color, start radius, end radius, animation duration etc.

Dependencies

dependencies {
    compile 'com.gauravbhola.ripplepulsebackground:library:1.0.0'
}
//for gradle 3 and above
dependencies {
    implementation 'com.gauravbhola.ripplepulsebackground:library:1.0.0'
}

Proguard

-keep class com.gauravbhola.ripplepulsebackground.RipplePulseLayout$RippleView { *; }

Usage

The following properties can be used either in Layout or Programatically

  • duration : Duration in milliseconds for the ripple animation
  • ripple_color : ARGB color for the pulse/ripple
  • start_radius : Starting radius of the pulse
  • end_radius : Ending radius of the pulse
  • ripple_type : Ripple type. Accepted values : 'fill', 'stroke'(ring type)
  • stroke_width : The width of the ring if using ripple_type = stroke

Layout

<com.gauravbhola.ripplepulsebackground.RipplePulseLayout
          android:layout_width="200dp"
          android:layout_height="200dp"
          android:clipChildren="false"
          ripple:rippleColor="#3D66C7"
          ripple:rippleType="stroke"
          ripple:strokeWidth="2dp"
          ripple:startRadius="42dp"
          ripple:endRadius="100dp"
          ripple:duration="2000"
          android:id="@+id/layout_ripplepulse">

      <com.gauravbhola.ripplepulsebackground.sample.views.RoundedImageView
              android:layout_width="90dp"
              android:layout_height="90dp"
              android:layout_centerInParent="true"
              android:src="@drawable/contact"/>
</com.gauravbhola.ripplepulsebackground.RipplePulseLayout>

Activity

public class MainActivity extends AppCompatActivity {
    RipplePulseLayout mRipplePulseLayout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mRipplePulseLayout = findViewById(R.id.layout_ripplepulse);
    }
}

start animation

mRipplePulseLayout.startRippleAnimation();

stop animation

mRipplePulseLayout.stopRippleAnimation();

Developed By

License

Copyright 2017 **Gaurav Bhola**

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-ripple-pulse-animation's People

Contributors

gaurav414u avatar gbhola-bst 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

android-ripple-pulse-animation's Issues

Duration

Great library :) Is is possible to set the duration programmatically?

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.