Easily and flexibly applies the Reveal Effect.
Reveal Effect is added animation from Android 5.0. So effect does not apply only in 5.0 and more device. However, you do not need to use the Build.VERSION.SDK_INT
. Library switch the process depending on the API level at the time of execution.
It is possible to apply the Reveal Effect like ViewPropertyAnimaor.
View overlayView = ...;
View centerView = ...;
Clippin.animate().target(overlayView)
.center(centerView) // or #center(int)
.duration(400) // default is 500 milliseconds
.delay(10) // option
.interpolator(new AccelerateDecelerateInterpolator()) // option
.show(null); // sets a call back if necessary
// or
.hide(null);
It is also possible to set the following constants in the #center(int)
method.
CENTER_ORIGIN
CENTER_LEFT_TOP
CENTER_RIGHT_TOP
CENTER_LEFT_BOTTOM
CENTER_RIGHT_BOTTOM
CENTER_ORIGIN_BOTTOM
Add the following code to module build.gradle.
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.droibit:clippin:1.0.2'
}
- Support Annotations v22.2.0