Slide 50
Slide 50 text
Coding Example
HorizontalChangeHandler
public class HorizontalChangeHandler extends AnimatorChangeHandler {
@Override
protected Animator getAnimator(@NonNull ViewGroup container, View from, View to,
boolean isPush, boolean toAddedToContainer) {
AnimatorSet animSet = new AnimatorSet();
if (isPush && from != null) {
animSet.play(ObjectAnimator.ofFloat(from, View.TRANSLATION_X, -from.getWidth()));
}
if (isPush && to != null) {
animSet.play(ObjectAnimator.ofFloat(to, View.TRANSLATION_X, to.getWidth(), 0));
}
return animatorSet;
}
protected void resetFromView(@NonNull View from) { }
}