Skip to content

paolorotolo/ViewGardiumLeviosa

Repository files navigation

ViewGardiumLeviosa

Makes a view fluctuate.

Import

  1. Add the JitPack repository to your build file

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

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
  1. Add the dependency
	dependencies {
	        implementation 'com.github.paolorotolo:viewgardiumleviosa:1.0.0'
	}

Usage

ViewGardiumLeviosa adds an extension method to your Views.

You can make the view fluctuate with:

view.startFluctuate()

If you want to customize the animation, you can specify the max delta and the duration of one animcaiton cycle:

val fluctuateDelta = -50
val fluctuateDuration = 500

view.startFluctuate(fluctuateDelta, fluctuateDuration)

Finally, to stop the animation, call:

view.stopFluctuate()