Android AnimatorSet - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android AnimatorSet class.

This code example shows how to use the following methods: play, playSequentially, start
        skewAnim.setDuration(100);
        // and wobble it 
        ObjectAnimator wobbleAnim = ObjectAnimator.ofFloat(this, "skewX", 0);
        wobbleAnim.setInterpolator(sOvershooter);
        wobbleAnim.setDuration(150);
        AnimatorSet set = new AnimatorSet();
        set.playSequentially(moveAnim, skewAnim, wobbleAnim);
        if (finishDownAnim != null) {
            set.play(finishDownAnim).before(moveAnim);
        } 
        set.start();
        mOnLeft = !mOnLeft;
    } 
 
    /** 
     * Restore the button to its un-pressed state 
     */ 
    private void runCancelAnim() { 
        if (downAnim != null && downAnim.isRunning()) {
            downAnim.cancel();
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: playSequentially, start
This code example shows how to use the following methods: addListener, playTogether, setDuration, start
        // Post this on the UI thread's message queue. It's needed for the items to be already measured 
        new Handler().post(new Runnable() {
 
            @Override 
            public void run() { 
                mSetAnim = new AnimatorSet();
                mTopImage.setLayerType(View.LAYER_TYPE_HARDWARE, null);
                mBottomImage.setLayerType(View.LAYER_TYPE_HARDWARE, null);
                mSetAnim.addListener(new Animator.AnimatorListener() {
                    @Override 
                    public void onAnimationStart(Animator animation) {
                    } 
 
                    @Override 
                    public void onAnimationEnd(Animator animation) {
                        clean(destActivity);
                    } 
 
                    @Override 
                    public void onAnimationCancel(Animator animation) {

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: play, playSequentially, start
        skewAnim.setDuration(100);
        // and wobble it 
        ObjectAnimator wobbleAnim = ObjectAnimator.ofFloat(this, "skewX", 0);
        wobbleAnim.setInterpolator(sOvershooter);
        wobbleAnim.setDuration(150);
        AnimatorSet set = new AnimatorSet();
        set.playSequentially(moveAnim, skewAnim, wobbleAnim);
        if (finishDownAnim != null) {
            set.play(finishDownAnim).before(moveAnim);
        } 
        set.start();
        mOnLeft = !mOnLeft;
    } 
 
    /** 
     * Restore the button to its un-pressed state 
     */ 
    private void runCancelAnim() { 
        if (downAnim != null && downAnim.isRunning()) {
            downAnim.cancel();
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: playTogether, setDuration, start
        if (mGlowBG != null) {
            if (pressed != isPressed()) {
                if (mPressedAnim != null && mPressedAnim.isRunning()) {
                    mPressedAnim.cancel();
                } 
                final AnimatorSet as = mPressedAnim = new AnimatorSet();
                if (pressed) {
                    if (mGlowScale < GLOW_MAX_SCALE_FACTOR) 
                        mGlowScale = GLOW_MAX_SCALE_FACTOR;
                    if (mGlowAlpha < BUTTON_QUIESCENT_ALPHA)
                        mGlowAlpha = BUTTON_QUIESCENT_ALPHA;
                    setDrawingAlpha(1f); 
                    as.playTogether(
                        ObjectAnimator.ofFloat(this, "glowAlpha", 1f),
                        ObjectAnimator.ofFloat(this, "glowScale", GLOW_MAX_SCALE_FACTOR)
                    ); 
                    as.setDuration(50);
                } else { 
                    as.playTogether(
                        ObjectAnimator.ofFloat(this, "glowAlpha", 0f),

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android AnimatorSet Questions & Answers:

Other Android AnimatorSet Examples

18:	  private int width;
19:	  private int height;
20:	  private AnimatorSet set;
21:	
22:	  @Override
-
54:	  }
55:	
56:	  private AnimatorSet createAnimation() {
57:	    int nextX = randon.nextInt(width);
58:	    int nextY = randon.nextInt(height);
-
62:	    animation2 = ObjectAnimator.ofFloat(button, "y", nextY);
63:	    animation2.setDuration(1400);
64:	    AnimatorSet set = new AnimatorSet();
65:	    set.playTogether(animation1, animation2);
66:	    return set;
-
62:	    animation2 = ObjectAnimator.ofFloat(button, "y", nextY);
63:	    animation2.setDuration(1400);
64:	    AnimatorSet set = new AnimatorSet();
65:	    set.playTogether(animation1, animation2);
66:	    return set;

Read More

See Code Examples for Android AnimatorSet Methods: