private void init(Context context, AttributeSet attrs) { setOrientation(LinearLayout.HORIZONTAL); setGravity(Gravity.CENTER); handleTypedArray(context, attrs); mAnimationOut = (AnimatorSet) AnimatorInflater.loadAnimator(context, mAnimatorResId); mAnimationOut.setInterpolator(new LinearInterpolator()); mAnimationIn = (AnimatorSet) AnimatorInflater.loadAnimator(context, mAnimatorResId); mAnimationIn.setInterpolator(new ReverseInterpolator()); }
@NonNull @Override public Animator[] getAnimators(@NonNull final ViewGroup parent, @NonNull final View view) { return new Animator[]{AnimatorInflater.loadAnimator(mContext, getAnimationResourceId())}; }
@Override public Animator[] getAnimators(final ViewGroup parent, final View view) { return new Animator[]{AnimatorInflater.loadAnimator(mContext, getAnimationResourceId())}; }
@Override public Animator[] getAnimators(ViewGroup parent, View view) { return new Animator[] { AnimatorInflater.loadAnimator(mContext, getAnimationResourceId()) }; }
/** * See {@link #animator(Animator)}. * * @param context * @param animatorId * @return */ public ViewTransitionBuilder animator(@NonNull Context context, int animatorId) { animator(AnimatorInflater.loadAnimator(context, animatorId)); return this; }
/** * Specifies the animation used to animate a View that enters the screen. * * @param context The application's environment. * @param resourceID The resource id of the animation. * * @see #getInAnimation() * @see #setInAnimation(android.animation.ObjectAnimator) */ public void setInAnimation(Context context, int resourceID) { setInAnimation(AnimatorInflater.loadAnimator(context, resourceID)); }
/** * Specifies the animation used to animate a View that exit the screen. * * @param context The application's environment. * @param resourceID The resource id of the animation. * * @see #getOutAnimation() * @see #setOutAnimation(android.animation.ObjectAnimator) */ public void setOutAnimation(Context context, int resourceID) { setOutAnimation(AnimatorInflater.loadAnimator(context, resourceID)); }