Add it to your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency to your app.gradle:
dependencies {
...
compile 'com.github.jeketos:WaveAnimationLayout:1.0'
}
Add to your layout xml file WaveAnimateRelativeLayout
<com.jeketos.waveanimationlayout.WaveAnimateRelativeLayout
android:id="@+id/animateLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:animDuration="5000"
app:wavesCount="10"
app:relativeTo="@+id/view"
app:startColor="@color/colorPrimary"
>
For auto start animation add to your Activity or Fragment the code below:
override fun onResume() {
super.onResume()
animateLayout.startAnim()
}
override fun onPause() {
super.onPause()
animateLayout.stopAnim()
}
Also you can use startAnim()/stopAnim() in any time by yourself.
animDuration
- one wave animation durationwavesCount
- waves count for animDurationstartX
- position X point related to wave animation containerstartY
- position Y point related to wave animation containerrelativeTo
- position related to the center of view in wave animation container. When used - startX, StartY is ignoredstartSize
- start size of animated wavestartColor
- start color of animated view
If startX, startY, relativeTo
are not specified, waves are moving from the center of wave animation container.