PulsingView

Additional

Language
Kotlin
Version
N/A
Created
Apr 8, 2021
Updated
Oct 3, 2021 (Retired)
Owner
Cristian Holdunu (Crysis21)
Contributor
Cristian Holdunu (Crysis21)
1
Activity
Badge
Generate
Download
Source code

PulsingView

PulsingView is a simple android library designed to give you a ripple effect, if you ever need one. Ideally it can be used as a background for circle UI elements.

Installation

Add mavenCentral to your projects root build.gradle file

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        ....
        mavenCentral()
        ....
    }
}

In your modules build.gradle add the dependency

implementation 'ro.holdone:pulseview:1.0.1'

Usage

Add the PulsingAnimationView in your XML files and personalize it. You're done.

    <ro.holdone.pulseview.PulsingAnimationView
        android:id="@+id/button_companion"
        android:layout_width="140dp"
        android:layout_height="140dp"
        app:autoplay="true"
        app:baseRadius="32dp"
        app:pulseColor="@color/orange"
        app:strokeWidth="2.0dp"
        app:waveDistance="10dp" />

You can change the following params:

  • autoplay - default is false. Will auto play the animation once the layout is loaded.
  • baseRadius - the innermost circle size. Waves will start expanding from this size
  • pulseColor - color used to draw
  • strokeWidth - thickness of the drawn circles
  • waveDistance - distance between 2 circles

This params can be changed in XML or programatically.