ValueAnimator start - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ValueAnimator start method.

This code example shows how to use the following methods:setFloatValues, start
    public void setPingMode(int mode) {
        mPingMode = mode;
    } 
 
    public void startSaving() { 
        mFadeAnimator.setFloatValues(0, 1);
        mFadeAnimator.start();
    } 
 
    public void stopSaving() { 
        mFadeAnimator.setFloatValues(1, 0);
        mFadeAnimator.start();
    } 
 
    public void notifyOrientationChanged(int angle) {
        mOrientation = angle;
    } 
 
    @Override 
    public void onDraw(Canvas canvas) {
7
CodeRank
This code example shows how to use the following methods:addUpdateListener, setInterpolator, start
 
        private void createAnimation() { 
            if (bounceAnim == null) {
                bounceAnim = ObjectAnimator.ofFloat(ball, "y", ball.getY(), getHeight() - 50f).
                        setDuration(1500); 
                bounceAnim.setInterpolator(new AccelerateInterpolator(2f));
                bounceAnim.addUpdateListener(this);
            } 
        } 
 
        public void startAnimation() { 
            createAnimation(); 
            bounceAnim.start();
        } 
 
        public void reverseAnimation() { 
            createAnimation(); 
            bounceAnim.reverse();
        } 
 
6
CodeRank
This code example shows how to use the following methods:addUpdateListener, setDuration, start
            if (bounceAnim == null) {
                XYHolder startXY = new XYHolder(0f, 0f);
                XYHolder endXY = new XYHolder(300f, 500f);
                bounceAnim = ObjectAnimator.ofObject(ballHolder, "xY",
                        new XYEvaluator(), endXY);
                bounceAnim.setDuration(1500);
                bounceAnim.addUpdateListener(this);
            } 
        } 
 
        public void startAnimation() { 
            createAnimation(); 
            bounceAnim.start();
        } 
 
        private ShapeHolder createBall(float x, float y) {
            OvalShape circle = new OvalShape();
            circle.resize(50f, 50f);
            ShapeDrawable drawable = new ShapeDrawable(circle);
            ShapeHolder shapeHolder = new ShapeHolder(drawable);
7
CodeRank
This code example shows how to use the following methods:addUpdateListener, setInterpolator, start
 
        private void createAnimation() { 
            if (bounceAnim == null) {
                bounceAnim = ObjectAnimator.ofFloat(ball, "y",
                        ball.getY(), getHeight() - BALL_SIZE).setDuration(1500);
                bounceAnim.setInterpolator(new BounceInterpolator());
                bounceAnim.addUpdateListener(this);
            } 
        } 
 
        public void startAnimation() { 
            createAnimation(); 
            bounceAnim.start();
        } 
 
        public void seek(long seekTime) {
            createAnimation(); 
            bounceAnim.setCurrentPlayTime(seekTime);
        } 
 
7
CodeRank
This code example shows how to use the following methods:addUpdateListener, setDuration, start
            if (bounceAnim == null) {
                XYHolder startXY = new XYHolder(0f, 0f);
                XYHolder endXY = new XYHolder(300f, 500f);
                bounceAnim = ObjectAnimator.ofObject(ballHolder, "xY",
                        new XYEvaluator(), endXY);
                bounceAnim.setDuration(1500);
                bounceAnim.addUpdateListener(this);
            } 
        } 
 
        public void startAnimation() { 
            createAnimation(); 
            bounceAnim.start();
        } 
 
        private ShapeHolder createBall(float x, float y) {
            OvalShape circle = new OvalShape();
            circle.resize(50f, 50f);
            ShapeDrawable drawable = new ShapeDrawable(circle);
            ShapeHolder shapeHolder = new ShapeHolder(drawable);
7
CodeRank
This code example shows how to use the following methods:addListener, addUpdateListener, setDuration, setInterpolator, start
            mAnimator.cancel();
        } 
        float from = mLeftToRight ? 0f : 1f;
        float to = mLeftToRight ? 1f : 0f;
        mAnimator = ValueAnimator.ofFloat(from, to);
        mAnimator.setDuration(DURATION);
        mAnimator.setInterpolator(new LinearInterpolator());
        mAnimator.addListener(new AnimatorListenerAdapter() {
            @Override 
            public void onAnimationEnd(Animator animation) {
                mDrawDots = false;
                // make sure we draw one frame at the end with everything gone. 
                invalidate();
            } 
 
            @Override 
            public void onAnimationStart(Animator animation) {
                mDrawDots = true;
            } 
        }); 

7
CodeRank
This code example shows how to use the following methods:addUpdateListener, setInterpolator, start
 
        private void createAnimation() { 
            if (bounceAnim == null) {
                bounceAnim = ObjectAnimator.ofFloat(ball, "y", ball.getY(), getHeight() - 50f).
                        setDuration(1500); 
                bounceAnim.setInterpolator(new AccelerateInterpolator(2f));
                bounceAnim.addUpdateListener(this);
            } 
        } 
 
        public void startAnimation() { 
            createAnimation(); 
            bounceAnim.start();
        } 
 
        public void reverseAnimation() { 
            createAnimation(); 
            bounceAnim.reverse();
        } 
 
7
CodeRank
This code example shows how to use the following methods:cancel, getAnimatedValue, getCurrentPlayTime, setFloatValues, start
            } 
        }); 
    } 
 
    private void animate(int direction) {
        final long currentPlayTime = mAnimator.getCurrentPlayTime();
        final float toValue = (direction == IN) ? mOriginalToValue : mOriginalFromValue;
        final float startValue = mFirstRun ? mOriginalFromValue :
                ((Float) mAnimator.getAnimatedValue()).floatValue();
 
        // Make sure it's stopped before we modify any values 
        cancel(); 
 
        // TODO: We don't really need to do the animation if startValue == toValue, but 
        // somehow that doesn't seem to work, possibly a quirk of the animation framework 
        mDirection = direction;
 
        // Ensure we don't calculate a non-sensical duration 
        long duration = mOriginalDuration - currentPlayTime;
        mAnimator.setDuration(Math.max(0, Math.min(duration, mOriginalDuration)));

7
CodeRank
This code example shows how to use the following methods:addListener, addUpdateListener, setDuration, start
This code example shows how to use the following methods:addUpdateListener, setInterpolator, start
 
        private void createAnimation() { 
            if (bounceAnim == null) {
                bounceAnim = ObjectAnimator.ofFloat(ball, "y",
                        ball.getY(), getHeight() - BALL_SIZE).setDuration(1500);
                bounceAnim.setInterpolator(new BounceInterpolator());
                bounceAnim.addUpdateListener(this);
            } 
        } 
 
        public void startAnimation() { 
            createAnimation(); 
            bounceAnim.start();
        } 
 
        public void seek(long seekTime) {
            createAnimation(); 
            bounceAnim.setCurrentPlayTime(seekTime);
        } 
 
7
CodeRank

Related ValueAnimator start Questions & Answers:

start Method Overview
Starts this animation.
See Code Examples for other Android ValueAnimator Methods: