protected static BaseInterpolator stringToInterpolator(String s) { if (s != null) { switch (s) { case ACCELERATE: return new AccelerateInterpolator(); case DESCELERATE: return new DecelerateInterpolator(); case ACCELERATE_DESCELERATE: return new AccelerateDecelerateInterpolator(); } } return null; }
public BallPathAnimator(BaseInterpolator interpolator, Path path, int duration) { this.interpolator = interpolator; this.path = path; this.duration = duration; init(); }
/** * @param animation_behavior the interpolator behavior */ @TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1) public DescriptionAnimation(BaseInterpolator animation_behavior) { this.animation_behavior = animation_behavior; }
/** * @param min_sec additional setting minute second that controls the time threadhold between each slide * @param animation_behavior the interpolator behavior */ @TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1) public DescriptionAnimation(int min_sec, BaseInterpolator animation_behavior) { this.time_threadhold = min_sec; this.animation_behavior = animation_behavior; }
/** * Initialize parameters and properties for TranslateAnimation. * * @param viewToAnimate View on which translate animation will be performed * @param fromXDelta Change in X coordinate to apply at the start of the * animation * @param toXDelta Change in X coordinate to apply at the end of the * animation * @param fromYDelta Change in Y coordinate to apply at the start of the * animation * @param toYDelta Change in Y coordinate to apply at the end of the * animation * @param duration Duration in milliseconds. * @param startOffSet When this Animation should start, in milliseconds from * the start time of the root AnimationSet. * @param interpolator Sets the acceleration curve for this animation. */ public void init(@NonNull View viewToAnimate, float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, long duration, long startOffSet, BaseInterpolator interpolator){ mFromXDelta = fromXDelta; mToXDelta = toXDelta; mFromYDelta = fromYDelta; mToYDelta = toYDelta; mDuration = duration; mStartOffSet = startOffSet; mInterpolator = interpolator; mViewToAnimate = viewToAnimate; }
/** * Constructor to use when building a TranslateAnimation from code * * @param viewToAnimate View on which translate animation will be performed * @param fromXDelta Change in X coordinate to apply at the start of the * animation * @param toXDelta Change in X coordinate to apply at the end of the * animation * @param fromYDelta Change in Y coordinate to apply at the start of the * animation * @param toYDelta Change in Y coordinate to apply at the end of the * animation * @param interpolator Sets the acceleration curve for this animation. */ public TranslateAnimationHelper(@NonNull View viewToAnimate, float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, BaseInterpolator interpolator){ init(viewToAnimate, fromXDelta, toXDelta, fromYDelta, toYDelta, DEFAULT_DURATION, 0, interpolator); doTranslateAnimation(); }
/** * Constructor to use when building a TranslateAnimation from code * * @param viewToAnimate View on which translate animation will be performed * @param fromXDelta Change in X coordinate to apply at the start of the * animation * @param toXDelta Change in X coordinate to apply at the end of the * animation * @param fromYDelta Change in Y coordinate to apply at the start of the * animation * @param toYDelta Change in Y coordinate to apply at the end of the * animation * @param startOffSet When this Animation should start, in milliseconds from * the start time of the root AnimationSet. * @param interpolator Sets the acceleration curve for this animation. */ public TranslateAnimationHelper(@NonNull View viewToAnimate, float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, long startOffSet, BaseInterpolator interpolator){ init(viewToAnimate, fromXDelta, toXDelta, fromYDelta, toYDelta, DEFAULT_DURATION, startOffSet, interpolator); doTranslateAnimation(); }
/** * Constructor to use when building a TranslateAnimation from code * * @param viewToAnimate View on which translate animation will be performed * @param fromXDelta Change in X coordinate to apply at the start of the * animation * @param toXDelta Change in X coordinate to apply at the end of the * animation * @param fromYDelta Change in Y coordinate to apply at the start of the * animation * @param toYDelta Change in Y coordinate to apply at the end of the * animation * @param duration Duration in milliseconds. * @param startOffSet When this Animation should start, in milliseconds from * the start time of the root AnimationSet. * @param interpolator Sets the acceleration curve for this animation. */ public TranslateAnimationHelper(@NonNull View viewToAnimate, float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, long duration, long startOffSet, BaseInterpolator interpolator){ init(viewToAnimate, fromXDelta, toXDelta, fromYDelta, toYDelta, duration, startOffSet, interpolator); doTranslateAnimation(); }