-
Notifications
You must be signed in to change notification settings - Fork 7
Limitations and Warnings
Ivan Škorić edited this page Oct 31, 2017
·
1 revision
VanGogh library is limited by the Android's ViewPropertyAnimator
implementation, which means that one view can only be controlled by one animator at a time. This means that you can not apply two animations on one view at the same time, so:
// Works.
fadeIn(view).andThen(fadeOut(view)).subscribe();
// Doesn't work.
fadeIn(view).mergeWith(rotate(view, 90f)).subscribe();
If you would like to perform the second animation, you'd have to define a custom implementation that performs these two animations together, for example:
public static AnimationCompletable fadeInAndRotate90Degrees(View view) {
return AnimationBuilder.forView(view)
.alpha(1f)
.rotation(90f)
.buildCompletable();
}
public void animate() {
// Execute animation.
fadeInAndRotate90Degrees(view).subscribe();
}