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.
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'
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 sizepulseColor
- color used to drawstrokeWidth
- thickness of the drawn circleswaveDistance
- distance between 2 circles
This params can be changed in XML or programatically.