This question refers to the Transitions API. I am using TransitionManager.beginDelayedTransition. As I have several views changing position, I wanted to teleport some of them, because moving them doesn't look good. By teleporting I mean, making them disappear animatedly, and then reappear in the new position, also animatedly. I have overriden Visibility to modify how views appear or disappear, but I don't know how to override ChangeBounds (or any other class, if more appropriate) to make the view disappear and reappear instead of move.
This code is an attempt I have done, but it does nothing to the view.
@Override
public Animator createAnimator(ViewGroup sceneRoot, TransitionValues startValues, TransitionValues endValues) {
PropertyValuesHolder holderX = PropertyValuesHolder.ofFloat("scaleX", 1, 0);
PropertyValuesHolder holderY = PropertyValuesHolder.ofFloat("scaleY", 1, 0);
ValueAnimator disappear = ObjectAnimator.ofPropertyValuesHolder(holderX, holderY);
holderX = PropertyValuesHolder.ofFloat("scaleX", 0, 1);
holderY = PropertyValuesHolder.ofFloat("scaleY", 1, 1);
ValueAnimator appear = ObjectAnimator.ofPropertyValuesHolder(holderX, holderY);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playSequentially(disappear, appear);
return animatorSet;
}
Returning appear, or disappear has the same result: nothing.