android.view.animation.AnimationSet

Here are the examples of the java api class android.view.animation.AnimationSet taken from open source projects.

1. ZoomPageAnimator#initAnimations()

Project: Paginize
File: ZoomPageAnimator.java
private void initAnimations() {
    Animation inScaleAnimation = new ScaleAnimation(1.2f, 1, 1.2f, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    Animation inAlphaAnimation = new AlphaAnimation(0.0f, 1f);
    AnimationSet inAnimationSet = new AnimationSet(true);
    inAnimationSet.setDuration(ANIMATION_DURATION);
    inAnimationSet.addAnimation(inScaleAnimation);
    inAnimationSet.addAnimation(inAlphaAnimation);
    mInAnimation = inAnimationSet;
    Animation outScaleAnimation = new ScaleAnimation(1, 1.4f, 1, 1.4f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    Animation outAlphaAnimation = new AlphaAnimation(1f, 0f);
    AnimationSet outAnimationSet = new AnimationSet(true);
    outAnimationSet.setDuration(ANIMATION_DURATION);
    outAnimationSet.addAnimation(outScaleAnimation);
    outAnimationSet.addAnimation(outAlphaAnimation);
    mOutAnimation = outAnimationSet;
}

2. TweenAnimActivity#showAnimSet02()

Project: AndroidStudyDemo
File: TweenAnimActivity.java
/*
    ???2
     */
public void showAnimSet02(View v) {
    boolean isLoadFromXml = this.mLoadAnimByXmlCB.isChecked();
    boolean isKeepAnimStatus = this.mKeepAnimStatusCB.isChecked();
    if (isLoadFromXml) {
        mRotateAnimation = AnimationUtils.loadAnimation(TweenAnimActivity.this, R.anim.sda_rotate_anim);
        mScaleAnimation = AnimationUtils.loadAnimation(TweenAnimActivity.this, R.anim.sda_scale_anim);
        mTranslateAnimation = AnimationUtils.loadAnimation(TweenAnimActivity.this, R.anim.sda_translate_anim);
    } else {
        mRotateAnimation = AnimationUtils.loadAnimation(TweenAnimActivity.this, R.anim.sda_rotate_anim);
        mScaleAnimation = new ScaleAnimation(1.0f, 0.1f, 1.0f, 0.1f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
        mTranslateAnimation = new TranslateAnimation(0.1f, 100.0f, 0.1f, 100.0f);
    }
    // ???
    AnimationSet set = new AnimationSet(true);
    set.addAnimation(mRotateAnimation);
    set.addAnimation(mScaleAnimation);
    set.addAnimation(mTranslateAnimation);
    // ???????????????
    set.setDuration(C.Int.ANIM_DURATION * 2);
    set.setFillAfter(isKeepAnimStatus);
    this.mAnimImgIV.startAnimation(set);
}

3. RayMenu#createItemDisapperAnimation()

Project: UltimateAndroid
File: RayMenu.java
private static Animation createItemDisapperAnimation(final long duration, final boolean isClicked) {
    AnimationSet animationSet = new AnimationSet(true);
    animationSet.addAnimation(new ScaleAnimation(1.0f, isClicked ? 2.0f : 0.0f, 1.0f, isClicked ? 2.0f : 0.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f));
    animationSet.addAnimation(new AlphaAnimation(1.0f, 0.0f));
    animationSet.setDuration(duration);
    animationSet.setInterpolator(new DecelerateInterpolator());
    animationSet.setFillAfter(true);
    return animationSet;
}

4. ArcMenu#createItemDisapperAnimation()

Project: UltimateAndroid
File: ArcMenu.java
private static Animation createItemDisapperAnimation(final long duration, final boolean isClicked) {
    AnimationSet animationSet = new AnimationSet(true);
    animationSet.addAnimation(new ScaleAnimation(1.0f, isClicked ? 2.0f : 0.0f, 1.0f, isClicked ? 2.0f : 0.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f));
    animationSet.addAnimation(new AlphaAnimation(1.0f, 0.0f));
    animationSet.setDuration(duration);
    animationSet.setInterpolator(new DecelerateInterpolator());
    animationSet.setFillAfter(true);
    return animationSet;
}

5. RayMenu#createItemDisapperAnimation()

Project: UltimateAndroid
File: RayMenu.java
private static Animation createItemDisapperAnimation(final long duration, final boolean isClicked) {
    AnimationSet animationSet = new AnimationSet(true);
    animationSet.addAnimation(new ScaleAnimation(1.0f, isClicked ? 2.0f : 0.0f, 1.0f, isClicked ? 2.0f : 0.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f));
    animationSet.addAnimation(new AlphaAnimation(1.0f, 0.0f));
    animationSet.setDuration(duration);
    animationSet.setInterpolator(new DecelerateInterpolator());
    animationSet.setFillAfter(true);
    return animationSet;
}

6. ArcMenu#createItemDisapperAnimation()

Project: UltimateAndroid
File: ArcMenu.java
private static Animation createItemDisapperAnimation(final long duration, final boolean isClicked) {
    AnimationSet animationSet = new AnimationSet(true);
    animationSet.addAnimation(new ScaleAnimation(1.0f, isClicked ? 2.0f : 0.0f, 1.0f, isClicked ? 2.0f : 0.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f));
    animationSet.addAnimation(new AlphaAnimation(1.0f, 0.0f));
    animationSet.setDuration(duration);
    animationSet.setInterpolator(new DecelerateInterpolator());
    animationSet.setFillAfter(true);
    return animationSet;
}

7. KJAnimations#clickCurtain()

Project: KJBlog
File: KJAnimations.java
public static void clickCurtain(View v) {
    AnimationSet set = new AnimationSet(false);
    Animation anim1 = getTranslateAnimation(0, 0, 0, -50, 110);
    Animation anim2 = getTranslateAnimation(0, 0, -50, 0, 80);
    Animation anim3 = getTranslateAnimation(0, 0, 0, -25, 25);
    Animation anim4 = getTranslateAnimation(0, 0, -25, 0, 25);
    anim1.setStartOffset(20);
    anim2.setStartOffset(230);
    anim3.setStartOffset(360);
    anim4.setStartOffset(400);
    set.addAnimation(anim1);
    set.addAnimation(anim2);
    set.addAnimation(anim3);
    set.addAnimation(anim4);
    v.startAnimation(set);
}

8. KJAnimations#shakeCurtain()

Project: KJBlog
File: KJAnimations.java
public static void shakeCurtain(View v) {
    AnimationSet set = new AnimationSet(false);
    Animation anim1 = getTranslateAnimation(0, 0, 0, -200, 110);
    Animation anim2 = getTranslateAnimation(0, 0, -200, 0, 80);
    Animation anim3 = getTranslateAnimation(0, 0, 0, -50, 25);
    Animation anim4 = getTranslateAnimation(0, 0, -50, 0, 25);
    anim1.setStartOffset(20);
    anim2.setStartOffset(230);
    anim3.setStartOffset(360);
    anim4.setStartOffset(400);
    set.addAnimation(anim1);
    set.addAnimation(anim2);
    set.addAnimation(anim3);
    set.addAnimation(anim4);
    v.startAnimation(set);
}

9. TweenAnimActivity#showAnimSet01()

Project: AndroidStudyDemo
File: TweenAnimActivity.java
/*
    ???1
     */
public void showAnimSet01(View v) {
    boolean isLoadFromXml = this.mLoadAnimByXmlCB.isChecked();
    boolean isKeepAnimStatus = this.mKeepAnimStatusCB.isChecked();
    if (isLoadFromXml) {
        mTranslateAnimation = AnimationUtils.loadAnimation(TweenAnimActivity.this, R.anim.sda_translate_anim);
        mAlphaAnimation = AnimationUtils.loadAnimation(TweenAnimActivity.this, R.anim.sda_alpha_anim);
    } else {
        mTranslateAnimation = new TranslateAnimation(0.1f, 100.0f, 0.1f, 100.0f);
        mAlphaAnimation = new AlphaAnimation(0.1f, 1.0f);
    }
    // ???
    AnimationSet set = new AnimationSet(true);
    set.addAnimation(mTranslateAnimation);
    set.addAnimation(mAlphaAnimation);
    // ???????????????
    set.setDuration(C.Int.ANIM_DURATION);
    set.setFillAfter(isKeepAnimStatus);
    this.mAnimImgIV.startAnimation(set);
}

10. KJAnimations#clickCurtain()

Project: KJFrameForAndroid
File: KJAnimations.java
public static void clickCurtain(View v) {
    AnimationSet set = new AnimationSet(false);
    Animation anim1 = getTranslateAnimation(0, 0, 0, -50, 110);
    Animation anim2 = getTranslateAnimation(0, 0, -50, 0, 80);
    Animation anim3 = getTranslateAnimation(0, 0, 0, -25, 25);
    Animation anim4 = getTranslateAnimation(0, 0, -25, 0, 25);
    anim1.setStartOffset(20);
    anim2.setStartOffset(230);
    anim3.setStartOffset(360);
    anim4.setStartOffset(400);
    set.addAnimation(anim1);
    set.addAnimation(anim2);
    set.addAnimation(anim3);
    set.addAnimation(anim4);
    v.startAnimation(set);
}

11. KJAnimations#shakeCurtain()

Project: KJFrameForAndroid
File: KJAnimations.java
public static void shakeCurtain(View v) {
    AnimationSet set = new AnimationSet(false);
    Animation anim1 = getTranslateAnimation(0, 0, 0, -200, 110);
    Animation anim2 = getTranslateAnimation(0, 0, -200, 0, 80);
    Animation anim3 = getTranslateAnimation(0, 0, 0, -50, 25);
    Animation anim4 = getTranslateAnimation(0, 0, -50, 0, 25);
    anim1.setStartOffset(20);
    anim2.setStartOffset(230);
    anim3.setStartOffset(360);
    anim4.setStartOffset(400);
    set.addAnimation(anim1);
    set.addAnimation(anim2);
    set.addAnimation(anim3);
    set.addAnimation(anim4);
    v.startAnimation(set);
}

12. RayLayout#createShrinkAnimation()

Project: UltimateAndroid
File: RayLayout.java
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, long startOffset, long duration, Interpolator interpolator) {
    AnimationSet animationSet = new AnimationSet(false);
    animationSet.setFillAfter(true);
    final long preDuration = duration / 2;
    Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    rotateAnimation.setStartOffset(startOffset);
    rotateAnimation.setDuration(preDuration);
    rotateAnimation.setInterpolator(new LinearInterpolator());
    rotateAnimation.setFillAfter(true);
    animationSet.addAnimation(rotateAnimation);
    Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720);
    translateAnimation.setStartOffset(startOffset + preDuration);
    translateAnimation.setDuration(duration - preDuration);
    translateAnimation.setInterpolator(interpolator);
    translateAnimation.setFillAfter(true);
    animationSet.addAnimation(translateAnimation);
    return animationSet;
}

13. ArcLayout#createShrinkAnimation()

Project: UltimateAndroid
File: ArcLayout.java
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, long startOffset, long duration, Interpolator interpolator) {
    AnimationSet animationSet = new AnimationSet(false);
    animationSet.setFillAfter(true);
    final long preDuration = duration / 2;
    Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    rotateAnimation.setStartOffset(startOffset);
    rotateAnimation.setDuration(preDuration);
    rotateAnimation.setInterpolator(new LinearInterpolator());
    rotateAnimation.setFillAfter(true);
    animationSet.addAnimation(rotateAnimation);
    Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720);
    translateAnimation.setStartOffset(startOffset + preDuration);
    translateAnimation.setDuration(duration - preDuration);
    translateAnimation.setInterpolator(interpolator);
    translateAnimation.setFillAfter(true);
    animationSet.addAnimation(translateAnimation);
    return animationSet;
}

14. RayLayout#createShrinkAnimation()

Project: UltimateAndroid
File: RayLayout.java
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, long startOffset, long duration, Interpolator interpolator) {
    AnimationSet animationSet = new AnimationSet(false);
    animationSet.setFillAfter(true);
    final long preDuration = duration / 2;
    Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    rotateAnimation.setStartOffset(startOffset);
    rotateAnimation.setDuration(preDuration);
    rotateAnimation.setInterpolator(new LinearInterpolator());
    rotateAnimation.setFillAfter(true);
    animationSet.addAnimation(rotateAnimation);
    Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720);
    translateAnimation.setStartOffset(startOffset + preDuration);
    translateAnimation.setDuration(duration - preDuration);
    translateAnimation.setInterpolator(interpolator);
    translateAnimation.setFillAfter(true);
    animationSet.addAnimation(translateAnimation);
    return animationSet;
}

15. ArcLayout#createShrinkAnimation()

Project: UltimateAndroid
File: ArcLayout.java
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, long startOffset, long duration, Interpolator interpolator) {
    AnimationSet animationSet = new AnimationSet(false);
    animationSet.setFillAfter(true);
    final long preDuration = duration / 2;
    Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    rotateAnimation.setStartOffset(startOffset);
    rotateAnimation.setDuration(preDuration);
    rotateAnimation.setInterpolator(new LinearInterpolator());
    rotateAnimation.setFillAfter(true);
    animationSet.addAnimation(rotateAnimation);
    Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720);
    translateAnimation.setStartOffset(startOffset + preDuration);
    translateAnimation.setDuration(duration - preDuration);
    translateAnimation.setInterpolator(interpolator);
    translateAnimation.setFillAfter(true);
    animationSet.addAnimation(translateAnimation);
    return animationSet;
}

16. AnimationFactory#fadeInThenOut()

Project: flip
File: AnimationFactory.java
/**
	 * Fades the view in, delays the specified amount of time, then fades the view out
	 * @param v the view to be faded in then out
	 * @param delay how long the view will be visible for
	 */
public static void fadeInThenOut(final View v, long delay) {
    if (v == null)
        return;
    v.setVisibility(View.VISIBLE);
    AnimationSet animation = new AnimationSet(true);
    Animation[] fadeInOut = fadeInThenOutAnimation(500, delay);
    animation.addAnimation(fadeInOut[0]);
    animation.addAnimation(fadeInOut[1]);
    animation.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationEnd(Animation animation) {
            v.setVisibility(View.GONE);
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }

        @Override
        public void onAnimationStart(Animation animation) {
            v.setVisibility(View.VISIBLE);
        }
    });
    v.startAnimation(animation);
}

17. SampleCallout#transitionIn()

Project: TileView
File: SampleCallout.java
public void transitionIn() {
    ScaleAnimation scaleAnimation = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 1f);
    scaleAnimation.setInterpolator(new OvershootInterpolator(1.2f));
    scaleAnimation.setDuration(250);
    AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1f);
    alphaAnimation.setDuration(200);
    AnimationSet animationSet = new AnimationSet(false);
    animationSet.addAnimation(scaleAnimation);
    animationSet.addAnimation(alphaAnimation);
    startAnimation(animationSet);
}

18. FragmentManager#makeOpenCloseAnimation()

Project: CodenameOne
File: FragmentManager.java
static Animation makeOpenCloseAnimation(Context context, float startScale, float endScale, float startAlpha, float endAlpha) {
    AnimationSet set = new AnimationSet(false);
    ScaleAnimation scale = new ScaleAnimation(startScale, endScale, startScale, endScale, Animation.RELATIVE_TO_SELF, .5f, Animation.RELATIVE_TO_SELF, .5f);
    scale.setInterpolator(DECELERATE_QUINT);
    scale.setDuration(ANIM_DUR);
    set.addAnimation(scale);
    AlphaAnimation alpha = new AlphaAnimation(startAlpha, endAlpha);
    alpha.setInterpolator(DECELERATE_CUBIC);
    alpha.setDuration(ANIM_DUR);
    set.addAnimation(alpha);
    return set;
}

19. LayoutAnimation2#onCreate()

Project: codeexamples-android
File: LayoutAnimation2.java
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mStrings));
    AnimationSet set = new AnimationSet(true);
    Animation animation = new AlphaAnimation(0.0f, 1.0f);
    animation.setDuration(50);
    set.addAnimation(animation);
    animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
    animation.setDuration(100);
    set.addAnimation(animation);
    LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f);
    ListView listView = getListView();
    listView.setLayoutAnimation(controller);
}

20. DynamicRotationGuideView#playCenter()

Project: AndroidStudyDemo
File: DynamicRotationGuideView.java
/**
     * ???View????
     */
private void playCenter() {
    AnimationSet animationSet = new AnimationSet(false);
    ScaleAnimation scaleSmall = new ScaleAnimation(1.0f, 0.6f, 1.0f, 0.6f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    ScaleAnimation scaleBig = new ScaleAnimation(1.0f, 5.0f / 3, 1.0f, 5.0f / 3, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    scaleBig.setDuration(2 * 1000);
    scaleBig.setInterpolator(interpolator);
    scaleSmall.setDuration(2 * 1000);
    scaleSmall.setStartOffset(2 * 1000);
    scaleSmall.setRepeatCount(-1);
    scaleSmall.setFillEnabled(true);
    scaleSmall.setFillAfter(true);
    scaleBig.setStartOffset(2 * 1000);
    scaleBig.setRepeatCount(-1);
    scaleBig.setFillEnabled(true);
    scaleBig.setFillAfter(true);
    scaleSmall.setInterpolator(interpolator);
    animationSet.addAnimation(scaleBig);
    animationSet.addAnimation(scaleSmall);
    center.startAnimation(animationSet);
}

21. DynamicRotationGuideView#playLeft()

Project: AndroidStudyDemo
File: DynamicRotationGuideView.java
/**
     * ?????
     */
private void playLeft() {
    AnimationSet animationSet = new AnimationSet(false);
    RotateAnimation rotateLeft = new RotateAnimation(0, 359, Animation.ABSOLUTE, screenW / 2 - left.getLeft(), Animation.ABSOLUTE, (left.getBottom() - left.getTop()) / 2);
    rotateLeft.setDuration(10 * 1000);
    rotateLeft.setInterpolator(interpolator);
    rotateLeft.setRepeatCount(-1);
    RotateAnimation rotateSelf = new RotateAnimation(0, -359, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    rotateSelf.setDuration(10 * 1000);
    rotateSelf.setRepeatCount(-1);
    rotateSelf.setInterpolator(interpolator);
    animationSet.addAnimation(rotateSelf);
    animationSet.addAnimation(rotateLeft);
    left.startAnimation(animationSet);
}

22. DynamicRotationGuideView#playRight()

Project: AndroidStudyDemo
File: DynamicRotationGuideView.java
/**
     * ?????
     */
private void playRight() {
    //????
    AnimationSet animationSet = new AnimationSet(false);
    RotateAnimation rotateRight = new RotateAnimation(0, 359, Animation.ABSOLUTE, screenW / 2 - right.getLeft(), Animation.ABSOLUTE, (right.getBottom() - right.getTop()) / 2);
    RotateAnimation rotateSelf = new RotateAnimation(0, -359, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    //????
    rotateSelf.setDuration(10 * 1000);
    //???????
    rotateSelf.setInterpolator(interpolator);
    //??????
    rotateSelf.setRepeatCount(-1);
    rotateRight.setDuration(10 * 1000);
    rotateRight.setRepeatCount(-1);
    rotateRight.setInterpolator(interpolator);
    animationSet.addAnimation(rotateSelf);
    animationSet.addAnimation(rotateRight);
    //??????
    right.startAnimation(animationSet);
}

23. MenuAnimationUtils#loadAnimation2()

Project: Android-tv-widget
File: MenuAnimationUtils.java
/**
     * ????2.
     */
public static LayoutAnimationController loadAnimation2() {
    int duration = 300;
    AnimationSet set = new AnimationSet(true);
    Animation animation = new AlphaAnimation(0.0f, 1.0f);
    animation.setDuration(duration);
    set.addAnimation(animation);
    animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
    animation.setDuration(duration);
    set.addAnimation(animation);
    LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f);
    controller.setOrder(LayoutAnimationController.ORDER_NORMAL);
    return controller;
}

24. LayoutAnimation2#onCreate()

Project: android-maven-plugin
File: LayoutAnimation2.java
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mStrings));
    AnimationSet set = new AnimationSet(true);
    Animation animation = new AlphaAnimation(0.0f, 1.0f);
    animation.setDuration(50);
    set.addAnimation(animation);
    animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
    animation.setDuration(100);
    set.addAnimation(animation);
    LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f);
    ListView listView = getListView();
    listView.setLayoutAnimation(controller);
}

25. MenuAnimationUtils#loadAnimation()

Project: Android-tv-widget
File: MenuAnimationUtils.java
/**
     * ????.
     */
@SuppressWarnings("ResourceType")
public static LayoutAnimationController loadAnimation(Context context) {
    /*
		 * ???????
		 */
    AnimationSet set = new AnimationSet(false);
    Animation animation;
    /*
		 * ??????
		 */
    animation = new RotateAnimation(180, 10);
    animation.setDuration(1000);
    set.addAnimation(animation);
    LayoutAnimationController controller = new LayoutAnimationController(set, 1);
    controller.setInterpolator(context, android.R.anim.accelerate_interpolator);
    controller.setAnimation(set);
    return controller;
}

26. RadialMenuWidget#onCloseAnimation()

Project: afwall
File: RadialMenuWidget.java
private void onCloseAnimation() {
    //rotate = new RotateAnimation(360, 0, xPosition, yPosition);
    scale = new ScaleAnimation(1, 0, 1, 0, xPosition, yPosition);
    scale.setInterpolator(new AccelerateInterpolator());
    move = new TranslateAnimation(0, xSource - xPosition, 0, ySource - yPosition);
    spriteAnimation = new AnimationSet(true);
    //spriteAnimation.addAnimation(rotate); 
    spriteAnimation.addAnimation(scale);
    spriteAnimation.addAnimation(move);
    spriteAnimation.setDuration(animationSpeed);
    startAnimation(spriteAnimation);
}

27. RadialMenuWidget#onOpenAnimation()

Project: afwall
File: RadialMenuWidget.java
private void onOpenAnimation() {
    //rotate = new RotateAnimation(0, 360, xPosition, yPosition);
    //rotate.setRepeatMode(Animation.REVERSE); 
    //rotate.setRepeatCount(Animation.INFINITE); 
    scale = new ScaleAnimation(0, 1, 0, 1, xPosition, yPosition);
    //scale.setRepeatMode(Animation.REVERSE); 
    //scale.setRepeatCount(Animation.INFINITE); 
    scale.setInterpolator(new DecelerateInterpolator());
    move = new TranslateAnimation(xSource - xPosition, 0, ySource - yPosition, 0);
    spriteAnimation = new AnimationSet(true);
    //spriteAnimation.addAnimation(rotate); 
    spriteAnimation.addAnimation(scale);
    spriteAnimation.addAnimation(move);
    spriteAnimation.setDuration(animationSpeed);
    startAnimation(spriteAnimation);
}

28. LoadingHeader#setError()

Project: braintree_android
File: LoadingHeader.java
public void setError(String errorMessage) {
    mCurrentState = HeaderState.ERROR;
    mLoadingSpinner.setVisibility(GONE);
    mHeaderMessage.setVisibility(GONE);
    mHeaderMessage.setText(errorMessage);
    setBackgroundColor(getResources().getColor(R.color.bt_red));
    mStatusIcon.setImageResource(R.drawable.bt_error);
    mStatusIcon.setVisibility(VISIBLE);
    Animation fadeIn = new AlphaAnimation(0, 1);
    fadeIn.setInterpolator(new DecelerateInterpolator());
    fadeIn.setStartOffset(500);
    fadeIn.setDuration(200);
    AnimationSet fadeInAnimation = new AnimationSet(false);
    fadeInAnimation.addAnimation(fadeIn);
    fadeInAnimation.setRepeatMode(0);
    fadeInAnimation.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
            mHeaderMessage.setVisibility(VISIBLE);
        }

        @Override
        public void onAnimationEnd(Animation animation) {
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    Animation fadeOut = new AlphaAnimation(1, 0);
    fadeOut.setInterpolator(new AccelerateInterpolator());
    fadeOut.setDuration(500);
    AnimationSet fadeOutAnimation = new AnimationSet(false);
    fadeOutAnimation.addAnimation(fadeOut);
    fadeOutAnimation.setRepeatMode(0);
    fadeOutAnimation.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            mStatusIcon.setVisibility(GONE);
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    mStatusIcon.setAnimation(fadeOutAnimation);
    mHeaderMessage.setAnimation(fadeInAnimation);
    setVisibility(VISIBLE);
}

29. SuperImageView#createAnimation()

Project: droid-comic-viewer
File: SuperImageView.java
private AnimationSet createAnimation(final int newWidth, final int newScrollX, final int newScrollY, long duration) {
    final AnimationSet animation = new AnimationSet(true);
    animation.setFillAfter(true);
    animation.setInterpolator(new DecelerateInterpolator());
    final float scale = (float) newWidth / (float) getWidth();
    final int fromXDelta = getScrollX();
    final int fromYDelta = getScrollY();
    this.scrollTo(0, 0);
    int toXDelta = Math.round((float) newScrollX / scale);
    int toYDelta = Math.round((float) newScrollY / scale);
    // Because the imageSwitcher centers the view if smaller
    final int fromXCenteringDelta = Math.max(getRootViewWidth() - getWidth(), 0) / 2;
    final int toXCenteringDelta = Math.max(getRootViewWidth() - newWidth, 0) / 2;
    final int xCenteringDelta = Math.round((toXCenteringDelta - fromXCenteringDelta) / scale);
    toXDelta -= xCenteringDelta;
    final int newHeight = Math.round((float) getOriginalHeight() * (float) newWidth / (float) getOriginalWidth());
    final int fromYCenteringDelta = Math.max(getRootViewHeight() - getHeight(), 0) / 2;
    final int toYCenteringDelta = Math.max(getRootViewHeight() - newHeight, 0) / 2;
    final int yCenteringDelta = Math.round((toYCenteringDelta - fromYCenteringDelta) / scale);
    toYDelta -= yCenteringDelta;
    final TranslateAnimation translateAnimation = new TranslateAnimation(-fromXDelta, -toXDelta, -fromYDelta, -toYDelta);
    translateAnimation.setDuration(duration);
    animation.addAnimation(translateAnimation);
    final ScaleAnimation scaleAnimation = new ScaleAnimation(1, scale, 1, scale);
    scaleAnimation.setDuration(duration);
    animation.addAnimation(scaleAnimation);
    return animation;
}

30. ShowFullScreenQrView#showPicFromPosition()

Project: bither-android
File: ShowFullScreenQrView.java
public void showPicFromPosition(final String content, final Bitmap placeHolder, final int x, final int y, final int width) {
    initView();
    setVisibility(View.VISIBLE);
    iv.setVisibility(View.INVISIBLE);
    ivPlaceHolder.setImageBitmap(placeHolder);
    final int size = Math.min(screenHeight, screenWidth);
    new Thread() {

        public void run() {
            final Bitmap bmp = Qr.bitmap(content, size);
            post(new Runnable() {

                @Override
                public void run() {
                    iv.setImageBitmap(bmp);
                    iv.setVisibility(View.VISIBLE);
                }
            });
        }

        ;
    }.start();
    AlphaAnimation animAlpha = new AlphaAnimation(0, 1);
    animAlpha.setDuration(AnimationDuration);
    vMask.startAnimation(animAlpha);
    int toX = 0;
    int toY = (screenHeight - statusBarHeight - screenWidth) / 2 + statusBarHeight;
    int toWidth = UIUtil.getScreenWidth();
    float scale = (float) width / (float) toWidth;
    ScaleAnimation animScale = new ScaleAnimation(scale, 1, scale, 1);
    animScale.setDuration(AnimationDuration);
    TranslateAnimation animTrans = new TranslateAnimation(x - toX, 0, y - toY, 0);
    animTrans.setDuration(AnimationDuration);
    AnimationSet animSet = new AnimationSet(true);
    animSet.setFillBefore(true);
    animSet.setDuration(AnimationDuration);
    animSet.addAnimation(animScale);
    animSet.addAnimation(animTrans);
    flImages.startAnimation(animSet);
}

31. RightCircleView#startSecondaryCircleAnimation()

Project: AnimatedCircleLoadingView
File: RightCircleView.java
public void startSecondaryCircleAnimation() {
    int bottomMovementAddition = (260 * parentWidth) / 700;
    TranslateAnimation translateAnimation = new TranslateAnimation(getX(), getX(), getY(), getY() + bottomMovementAddition);
    translateAnimation.setStartOffset(200);
    translateAnimation.setDuration(1000);
    AlphaAnimation alphaAnimation = new AlphaAnimation(1, 0);
    alphaAnimation.setStartOffset(1300);
    alphaAnimation.setDuration(200);
    AnimationSet animationSet = new AnimationSet(true);
    animationSet.addAnimation(translateAnimation);
    animationSet.addAnimation(alphaAnimation);
    animationSet.setFillAfter(true);
    animationSet.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        // Empty
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            setState(AnimationState.SECONDARY_CIRCLE_FINISHED);
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        // Empty
        }
    });
    startAnimation(animationSet);
}

32. SplashActivity#startAnim()

Project: zhsz
File: SplashActivity.java
private void startAnim() {
    AnimationSet set = new AnimationSet(false);
    //????
    RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    //??????
    rotateAnimation.setDuration(1000);
    // ??????
    rotateAnimation.setFillAfter(true);
    //????
    ScaleAnimation scaleAnimation = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    scaleAnimation.setDuration(1000);
    scaleAnimation.setFillAfter(true);
    //????
    AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1);
    alphaAnimation.setDuration(2000);
    alphaAnimation.setFillAfter(true);
    set.addAnimation(rotateAnimation);
    set.addAnimation(scaleAnimation);
    set.addAnimation(alphaAnimation);
    // ??????
    set.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        // ??????
        @Override
        public void onAnimationEnd(Animation animation) {
            jumpNextPage();
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    rl_root.startAnimation(set);
}

33. SplashActivity#onCreate()

Project: weex
File: SplashActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);
    View textView = findViewById(R.id.fullscreen_content);
    ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    RotateAnimation rotateAnimation = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    AnimationSet animationSet = new AnimationSet(false);
    animationSet.addAnimation(scaleAnimation);
    animationSet.addAnimation(rotateAnimation);
    animationSet.setDuration(1500);
    animationSet.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            startActivity(new Intent(SplashActivity.this, IndexActivity.class));
            finish();
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    textView.startAnimation(animationSet);
}

34. RevealatorHelper#translateAndHideView()

Project: Revealator
File: RevealatorHelper.java
/**
     * Helps to translate a view to another view.
     *
     * @param fromView From view.
     * @param toView   Target view.
     * @param duration Duration.
     */
static void translateAndHideView(final View fromView, View toView, long duration) {
    // - Determine translate delta.
    int[] fromLocation = new int[2];
    fromView.getLocationOnScreen(fromLocation);
    int[] toLocation = new int[2];
    toView.getLocationOnScreen(toLocation);
    int toX = toLocation[0] - fromLocation[0] + toView.getMeasuredWidth() / 2 - fromView.getMeasuredWidth() / 2;
    int toY = toLocation[1] - fromLocation[1] + toView.getMeasuredHeight() / 2 - fromView.getMeasuredHeight() / 2;
    // - Prepare translate animation.
    final TranslateAnimation translateAnimation = new TranslateAnimation(0, toX, 0, toY);
    translateAnimation.setDuration(duration);
    translateAnimation.setInterpolator(new AccelerateInterpolator());
    // - Prepare hide animation.
    final ScaleAnimation hideAnimation = new ScaleAnimation(fromView.getScaleX(), 0, fromView.getScaleY(), 0, Animation.ABSOLUTE, toX + fromView.getMeasuredWidth() / 2, Animation.ABSOLUTE, toY + fromView.getMeasuredHeight() / 2);
    hideAnimation.setDuration(duration / 5);
    hideAnimation.setStartOffset((long) (duration * 0.9));
    hideAnimation.setInterpolator(new BounceInterpolator());
    // - Prepare animations set.
    final AnimationSet animationSet = new AnimationSet(true);
    animationSet.addAnimation(translateAnimation);
    animationSet.addAnimation(hideAnimation);
    animationSet.setAnimationListener(new AnimationListenerAdapter() {

        @Override
        public void onAnimationEnd(Animation animation) {
            fromView.setVisibility(View.INVISIBLE);
        }
    });
    // - Let's move !
    fromView.startAnimation(animationSet);
}

35. CardCarouselLayout#exitLeft()

Project: mixpanel-android
File: CardCarouselLayout.java
private Animation exitLeft() {
    final AnimationSet set = new AnimationSet(false);
    final RotateAnimation rotateOut = new RotateAnimation(0, -EXIT_ANGLE, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_X, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_Y);
    rotateOut.setDuration(ANIMATION_DURATION_MILLIS);
    rotateOut.setStartOffset(ANIMATION_DURATION_MILLIS - ANIMATION_ROTATION_MILLIS);
    set.addAnimation(rotateOut);
    final ScaleAnimation scaleDown = new ScaleAnimation(1, EXIT_SIZE, 1, EXIT_SIZE, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_X, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_Y);
    scaleDown.setDuration(ANIMATION_DURATION_MILLIS);
    scaleDown.setStartOffset(ANIMATION_DURATION_MILLIS - ANIMATION_ROTATION_MILLIS);
    set.addAnimation(scaleDown);
    final TranslateAnimation slideX = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, -1, Animation.RELATIVE_TO_PARENT, -2.3f, Animation.RELATIVE_TO_PARENT, 0, Animation.RELATIVE_TO_PARENT, 0);
    slideX.setInterpolator(new AccelerateInterpolator());
    slideX.setDuration(ANIMATION_DURATION_MILLIS);
    set.addAnimation(slideX);
    return set;
}

36. CardCarouselLayout#enterLeft()

Project: mixpanel-android
File: CardCarouselLayout.java
private Animation enterLeft() {
    final AnimationSet set = new AnimationSet(false);
    final RotateAnimation rotateIn = new RotateAnimation(-EXIT_ANGLE, 0, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_X, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_Y);
    rotateIn.setDuration(ANIMATION_ROTATION_MILLIS);
    set.addAnimation(rotateIn);
    final ScaleAnimation scaleUp = new ScaleAnimation(EXIT_SIZE, 1, EXIT_SIZE, 1, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_X, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_Y);
    scaleUp.setDuration(ANIMATION_ROTATION_MILLIS);
    set.addAnimation(scaleUp);
    final TranslateAnimation slideX = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, -1.3f, Animation.RELATIVE_TO_PARENT, 0, Animation.RELATIVE_TO_PARENT, 0, Animation.RELATIVE_TO_PARENT, 0);
    slideX.setDuration(ANIMATION_DURATION_MILLIS);
    set.addAnimation(slideX);
    return set;
}

37. CardCarouselLayout#exitRight()

Project: mixpanel-android
File: CardCarouselLayout.java
private Animation exitRight() {
    final AnimationSet set = new AnimationSet(false);
    final RotateAnimation rotateOut = new RotateAnimation(0, EXIT_ANGLE, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_X, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_Y);
    rotateOut.setDuration(ANIMATION_ROTATION_MILLIS);
    rotateOut.setStartOffset(ANIMATION_DURATION_MILLIS - ANIMATION_ROTATION_MILLIS);
    set.addAnimation(rotateOut);
    final ScaleAnimation scaleDown = new ScaleAnimation(1, EXIT_SIZE, 1, EXIT_SIZE, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_X, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_Y);
    scaleDown.setDuration(ANIMATION_ROTATION_MILLIS);
    scaleDown.setStartOffset(ANIMATION_DURATION_MILLIS - ANIMATION_ROTATION_MILLIS);
    set.addAnimation(scaleDown);
    final TranslateAnimation slideX = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, -1.0f, Animation.RELATIVE_TO_PARENT, 0.3f, Animation.RELATIVE_TO_PARENT, 0, Animation.RELATIVE_TO_PARENT, 0);
    slideX.setInterpolator(new AccelerateInterpolator());
    slideX.setDuration(ANIMATION_DURATION_MILLIS);
    set.addAnimation(slideX);
    return set;
}

38. CardCarouselLayout#enterRight()

Project: mixpanel-android
File: CardCarouselLayout.java
private Animation enterRight() {
    final AnimationSet set = new AnimationSet(false);
    final RotateAnimation rotateIn = new RotateAnimation(EXIT_ANGLE, 0, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_X, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_Y);
    rotateIn.setDuration(ANIMATION_ROTATION_MILLIS);
    set.addAnimation(rotateIn);
    final ScaleAnimation scaleUp = new ScaleAnimation(EXIT_SIZE, 1, EXIT_SIZE, 1, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_X, Animation.RELATIVE_TO_SELF, EXIT_ROTATION_CENTER_Y);
    scaleUp.setDuration(ANIMATION_ROTATION_MILLIS);
    set.addAnimation(scaleUp);
    final TranslateAnimation slideX = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 1.3f, Animation.RELATIVE_TO_PARENT, 0, Animation.RELATIVE_TO_PARENT, 0, Animation.RELATIVE_TO_PARENT, 0);
    slideX.setDuration(ANIMATION_DURATION_MILLIS);
    set.addAnimation(slideX);
    return set;
}

39. KJAnimations#clickAnimation()

Project: KJFrameForAndroid
File: KJAnimations.java
public static Animation clickAnimation(long durationMillis) {
    AnimationSet set = new AnimationSet(true);
    set.addAnimation(getAlphaAnimation(1.0f, 0.3f, durationMillis));
    set.addAnimation(getScaleAnimation(durationMillis));
    set.setDuration(durationMillis);
    return set;
}

40. KJAnimations#clickAnimation()

Project: KJBlog
File: KJAnimations.java
public static Animation clickAnimation(long durationMillis) {
    AnimationSet set = new AnimationSet(true);
    set.addAnimation(getAlphaAnimation(1.0f, 0.3f, durationMillis));
    set.addAnimation(getScaleAnimation(durationMillis));
    set.setDuration(durationMillis);
    return set;
}

41. AnimationFactory#flipAnimation()

Project: flip
File: AnimationFactory.java
/**
	 * Create a pair of {@link FlipAnimation} that can be used to flip 3D transition from {@code fromView} to {@code toView}. A typical use case is with {@link ViewAnimator} as an out and in transition.
	 * 
	 * NOTE: Avoid using this method. Instead, use {@link #flipTransition}.
	 *  
	 * @param fromView the view transition away from
	 * @param toView the view transition to
	 * @param dir the flip direction
	 * @param duration the transition duration in milliseconds
	 * @param interpolator the interpolator to use (pass {@code null} to use the {@link AccelerateInterpolator} interpolator) 
	 * @return
	 */
public static Animation[] flipAnimation(final View fromView, final View toView, FlipDirection dir, long duration, Interpolator interpolator) {
    Animation[] result = new Animation[2];
    float centerX;
    float centerY;
    centerX = fromView.getWidth() / 2.0f;
    centerY = fromView.getHeight() / 2.0f;
    FlipAnimation outFlip = new FlipAnimation(dir.getStartDegreeForFirstView(), dir.getEndDegreeForFirstView(), centerX, centerY, FlipAnimation.SCALE_DEFAULT, FlipAnimation.ScaleUpDownEnum.SCALE_DOWN);
    outFlip.setDuration(duration);
    outFlip.setFillAfter(true);
    outFlip.setInterpolator(interpolator == null ? new AccelerateInterpolator() : interpolator);
    if (dir == FlipDirection.BOTTOM_TOP || dir == FlipDirection.TOP_BOTTOM)
        outFlip.setDirection(FlipAnimation.ROTATION_X);
    else
        outFlip.setDirection(FlipAnimation.ROTATION_Y);
    AnimationSet outAnimation = new AnimationSet(true);
    outAnimation.addAnimation(outFlip);
    result[0] = outAnimation;
    // Uncomment the following if toView has its layout established (not the case if using ViewFlipper and on first show)
    //centerX = toView.getWidth() / 2.0f;
    //centerY = toView.getHeight() / 2.0f; 
    FlipAnimation inFlip = new FlipAnimation(dir.getStartDegreeForSecondView(), dir.getEndDegreeForSecondView(), centerX, centerY, FlipAnimation.SCALE_DEFAULT, FlipAnimation.ScaleUpDownEnum.SCALE_UP);
    inFlip.setDuration(duration);
    inFlip.setFillAfter(true);
    inFlip.setInterpolator(interpolator == null ? new AccelerateInterpolator() : interpolator);
    inFlip.setStartOffset(duration);
    if (dir == FlipDirection.BOTTOM_TOP || dir == FlipDirection.TOP_BOTTOM)
        inFlip.setDirection(FlipAnimation.ROTATION_X);
    else
        inFlip.setDirection(FlipAnimation.ROTATION_Y);
    AnimationSet inAnimation = new AnimationSet(true);
    inAnimation.addAnimation(inFlip);
    result[1] = inAnimation;
    return result;
}

42. KJAnimations#clickAnimation()

Project: KJFrameForAndroid
File: KJAnimations.java
public static Animation clickAnimation(float scaleXY, long durationMillis) {
    AnimationSet set = new AnimationSet(true);
    set.addAnimation(getScaleAnimation(scaleXY, durationMillis));
    set.setDuration(durationMillis);
    return set;
}

43. KJAnimations#openLoginAnim()

Project: KJFrameForAndroid
File: KJAnimations.java
public static void openLoginAnim(View v) {
    AnimationSet set = new AnimationSet(true);
    v.measure(0, 0);
    set.addAnimation(getTranslateAnimation(0, 0, v.getMeasuredHeight(), 0, 600));
    set.addAnimation(getAlphaAnimation(0.8F, 1, 600));
    v.setAnimation(set);
}

44. KJAnimations#clickAnimation()

Project: KJBlog
File: KJAnimations.java
public static Animation clickAnimation(float scaleXY, long durationMillis) {
    AnimationSet set = new AnimationSet(true);
    set.addAnimation(getScaleAnimation(scaleXY, durationMillis));
    set.setDuration(durationMillis);
    return set;
}

45. KJAnimations#openLoginAnim()

Project: KJBlog
File: KJAnimations.java
public static void openLoginAnim(View v) {
    AnimationSet set = new AnimationSet(true);
    v.measure(0, 0);
    set.addAnimation(getTranslateAnimation(0, 0, v.getMeasuredHeight(), 0, 600));
    set.addAnimation(getAlphaAnimation(0.8F, 1, 600));
    v.setAnimation(set);
}

46. SuperImageView#animateTo()

Project: droid-comic-viewer
File: SuperImageView.java
public Rect animateTo(final Rect frame, final boolean keepInside, long duration) {
    mAnimating = true;
    abortScrollerAnimation();
    final int newWidth = scaleFit(frame.width(), frame.height(), false);
    final Rect newFrame = resize(frame, newWidth, keepInside);
    final AnimationSet animation = createAnimation(newWidth, newFrame.left, newFrame.top, duration);
    animation.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationEnd(Animation arg0) {
            SuperImageView.this.postDelayed(new Runnable() {

                @Override
                public void run() {
                    SuperImageView.this.scrollTo(frame, keepInside);
                    SuperImageView.this.clearAnimation();
                    mAnimating = false;
                    if (mCSVListener != null) {
                        mCSVListener.onAnimationEnd(SuperImageView.this);
                    }
                }
            }, 50);
        }

        @Override
        public void onAnimationRepeat(Animation arg0) {
        }

        @Override
        public void onAnimationStart(Animation arg0) {
        }
    });
    this.startAnimation(animation);
    return newFrame;
}

47. ComicView#vibrate()

Project: droid-comic-viewer
File: ComicView.java
private void vibrate(final boolean stopAnimationWhenDone) {
    final Vibrator vibrator = (Vibrator) getContext().getSystemService(Context.VIBRATOR_SERVICE);
    if (vibrator != null) {
        vibrator.vibrate(500);
    }
    final AnimationSet set = new AnimationSet(true);
    int fromXDelta = 1;
    int fromYDelta = 1;
    final int maxDeltaScaled = MathUtils.dipToPixel(getContext(), 30);
    for (int i = 0; i < 5; i++) {
        int toXDelta = Math.round((float) (Math.random() * maxDeltaScaled) - ((float) maxDeltaScaled / 2f));
        int toYDelta = Math.round((float) (Math.random() * maxDeltaScaled) - ((float) maxDeltaScaled / 2f));
        TranslateAnimation t = new TranslateAnimation(fromXDelta, toXDelta, fromYDelta, toYDelta);
        t.setDuration(50);
        t.setStartOffset(50 * i);
        set.addAnimation(t);
        fromXDelta = toXDelta;
        fromYDelta = toYDelta;
    }
    set.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationEnd(Animation arg0) {
            if (stopAnimationWhenDone)
                stopAnimating();
        }

        @Override
        public void onAnimationRepeat(Animation arg0) {
        }

        @Override
        public void onAnimationStart(Animation arg0) {
            startAnimating();
        }
    });
    this.startAnimation(set);
}

48. VideoPlayerActivity#startLoading()

Project: VCL-Android
File: VideoPlayerActivity.java
/**
     * Start the video loading animation.
     */
private void startLoading() {
    mIsLoading = true;
    mOverlayProgress.setVisibility(View.INVISIBLE);
    AnimationSet anim = new AnimationSet(true);
    RotateAnimation rotate = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    rotate.setDuration(800);
    rotate.setInterpolator(new DecelerateInterpolator());
    rotate.setRepeatCount(RotateAnimation.INFINITE);
    anim.addAnimation(rotate);
    mLoading.startAnimation(anim);
}

49. MasterLayout#setAnimation()

Project: TH-ProgressButton
File: MasterLayout.java
private void setAnimation() {
    // Setting up and defining view animations.
    arcRotation = new RotateAnimation(0.0f, 360.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    arcRotation.setDuration(1000);
    in = new AnimationSet(true);
    out = new AnimationSet(true);
    out.setInterpolator(new AccelerateDecelerateInterpolator());
    in.setInterpolator(new AccelerateDecelerateInterpolator());
    scale_in = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    scale_out = new ScaleAnimation(1.0f, 3.0f, 1.0f, 3.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    new_scale_in = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    new_scale_in.setDuration(200);
    fade_in = new AlphaAnimation(0.0f, 1.0f);
    fade_out = new AlphaAnimation(1.0f, 0.0f);
    scale_in.setDuration(150);
    scale_out.setDuration(150);
    fade_in.setDuration(150);
    fade_out.setDuration(150);
    in.addAnimation(scale_in);
    in.addAnimation(fade_in);
    out.addAnimation(fade_out);
    out.addAnimation(scale_out);
    arcRotation.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationStart(Animation arg0) {
        // TODO Auto-generated method stub
        }

        @Override
        public void onAnimationRepeat(Animation arg0) {
        // TODO Auto-generated method stub
        }

        @Override
        public void onAnimationEnd(Animation arg0) {
            // TODO Auto-generated method stub
            first_click = false;
            buttonimage.startAnimation(out);
        }
    });
    out.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
            // TODO Auto-generated method stub
            System.out.println("print this");
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        // TODO Auto-generated method stub
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            // TODO Auto-generated method stub
            buttonimage.setVisibility(View.GONE);
            buttonimage.setImageBitmap(second_icon_bmp);
            buttonimage.setVisibility(View.VISIBLE);
            buttonimage.startAnimation(in);
            arc_image.setVisibility(View.GONE);
            full_circle_image.setVisibility(View.VISIBLE);
            cusview.setVisibility(View.VISIBLE);
            flg_frmwrk_mode = 2;
            System.out.println("flg_frmwrk_mode" + flg_frmwrk_mode);
        }
    });
    new_scale_in.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        // TODO Auto-generated method stub
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        // TODO Auto-generated method stub
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            // TODO Auto-generated method stub
            cusview.setVisibility(View.GONE);
            buttonimage.setVisibility(View.VISIBLE);
            buttonimage.setImageBitmap(third_icon_bmp);
            flg_frmwrk_mode = 3;
            buttonimage.startAnimation(in);
        }
    });
}

50. FlyTxtView#init()

Project: FlyTxtView
File: FlyTxtView.java
// init
public void init() {
    animationSet = new AnimationSet(true);
    layoutAnimationController = new LayoutAnimationController(animationSet, 0.3f);
    layoutAnimationController.setOrder(LayoutAnimationController.ORDER_NORMAL);
    setAnimation(null);
    setLayoutAnimation(layoutAnimationController);
}

51. DialogCropPhotoTransit#initInAnim()

Project: bither-android
File: DialogCropPhotoTransit.java
private void initInAnim() {
    inAnim = new AnimationSet(true);
    int imageWidth = mFromRect.right - mFromRect.left;
    int imageHeight = mFromRect.bottom - mFromRect.top;
    pauseScaleFactor = (float) imageSize / (float) Math.min(imageWidth, imageHeight);
    ScaleAnimation scaleAnim = new ScaleAnimation(1, pauseScaleFactor, 1, pauseScaleFactor, 0.5f, 0.5f);
    pauseLeft = (screenWidth - imageWidth * pauseScaleFactor) / 2 - mFromRect.left;
    pauseTop = (screenHeight - imageHeight * pauseScaleFactor) / 2 - mFromRect.top;
    TranslateAnimation transAnim = new TranslateAnimation(0, pauseLeft, 0, pauseTop);
    inAnim.addAnimation(scaleAnim);
    inAnim.addAnimation(transAnim);
    inAnim.setDuration(500);
    inAnim.setFillAfter(true);
    inAnim.setAnimationListener(new AnimationListener() {

        public void onAnimationStart(Animation animation) {
            inAnimFinished = false;
            isAnimationStarted = true;
        }

        public void onAnimationRepeat(Animation animation) {
        }

        public void onAnimationEnd(Animation animation) {
            inAnimFinished = true;
        }
    });
}

52. DialogCropPhotoTransit#initOutAnim()

Project: bither-android
File: DialogCropPhotoTransit.java
private void initOutAnim() {
    outAnim = new AnimationSet(true);
    int imageWidth = mToRect.right - mToRect.left;
    int imageHeight = mToRect.bottom - mToRect.top;
    float scaleFactor = (float) Math.min(imageWidth, imageHeight) / (float) Math.min(mFromRect.right - mFromRect.left, mFromRect.bottom - mFromRect.top);
    ScaleAnimation scaleAnim = new ScaleAnimation(pauseScaleFactor, scaleFactor, pauseScaleFactor, scaleFactor, 0.5f, 0.5f);
    TranslateAnimation transAnim = new TranslateAnimation(pauseLeft, mToRect.left - mFromRect.left, pauseTop, mToRect.top - mFromRect.top);
    outAnim.addAnimation(scaleAnim);
    outAnim.addAnimation(transAnim);
    outAnim.setDuration(500);
    outAnim.setFillAfter(true);
    outAnim.setAnimationListener(new AnimationListener() {

        public void onAnimationStart(Animation animation) {
        }

        public void onAnimationRepeat(Animation animation) {
        }

        public void onAnimationEnd(Animation animation) {
            mIv.setImageBitmap(null);
            if (finalImageView != null) {
                finalImageView.setImageBitmap(bitmap);
                if (postRun != null) {
                    finalImageView.postDelayed(postRun, 50);
                }
            }
            if (finalImage != null) {
                finalImage.setVisibility(View.VISIBLE);
            }
            dismiss();
        }
    });
}