Search in sources :

Example 56 with AnimationSet

use of android.view.animation.AnimationSet in project JustAndroid by chinaltz.

the class AbAnimationUtil method playJumpAnimation.

/**
	 * 跳动-跳起动画.
	 *
	 * @param view the view
	 * @param offsetY the offset y
	 */
private void playJumpAnimation(final View view, final float offsetY) {
    float originalY = 0;
    float finalY = -offsetY;
    AnimationSet animationSet = new AnimationSet(true);
    animationSet.addAnimation(new TranslateAnimation(0, 0, originalY, finalY));
    animationSet.setDuration(300);
    animationSet.setInterpolator(new AccelerateDecelerateInterpolator());
    animationSet.setFillAfter(true);
    animationSet.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            playLandAnimation(view, offsetY);
        }
    });
    view.startAnimation(animationSet);
}
Also used : TranslateAnimation(android.view.animation.TranslateAnimation) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ScaleAnimation(android.view.animation.ScaleAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) Animation(android.view.animation.Animation) RotateAnimation(android.view.animation.RotateAnimation) AnimationListener(android.view.animation.Animation.AnimationListener) AnimationSet(android.view.animation.AnimationSet)

Example 57 with AnimationSet

use of android.view.animation.AnimationSet in project AndroidSDK-RecipeBook by gabu.

the class Recipe050 method startMix.

public void startMix(View view) {
    AnimationSet animation = new AnimationSet(true);
    // 透明になりながら
    animation.addAnimation(new AlphaAnimation(1.0F, 0.0F));
    // 回転しながら
    animation.addAnimation(new RotateAnimation(0, 360));
    // 拡大しながら
    animation.addAnimation(new ScaleAnimation(1, 2, 1, 2));
    // 移動しながら
    animation.addAnimation(new TranslateAnimation(0, 300, 0, 300));
    // 3秒で
    animation.setDuration(3000);
    mImageView.startAnimation(animation);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) AnimationSet(android.view.animation.AnimationSet) AlphaAnimation(android.view.animation.AlphaAnimation) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 58 with AnimationSet

use of android.view.animation.AnimationSet in project KJFrameForAndroid by kymjs.

the class KJAnimations method clickAnimation.

public static Animation clickAnimation(float scaleXY, long durationMillis) {
    AnimationSet set = new AnimationSet(true);
    set.addAnimation(getScaleAnimation(scaleXY, durationMillis));
    set.setDuration(durationMillis);
    return set;
}
Also used : AnimationSet(android.view.animation.AnimationSet)

Example 59 with AnimationSet

use of android.view.animation.AnimationSet in project KJFrameForAndroid by kymjs.

the class KJAnimations method clickAnimation.

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;
}
Also used : AnimationSet(android.view.animation.AnimationSet)

Example 60 with AnimationSet

use of android.view.animation.AnimationSet in project KJFrameForAndroid by kymjs.

the class KJAnimations method shakeCurtain.

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);
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) AlphaAnimation(android.view.animation.AlphaAnimation) Animation(android.view.animation.Animation) RotateAnimation(android.view.animation.RotateAnimation) AnimationSet(android.view.animation.AnimationSet)

Aggregations

AnimationSet (android.view.animation.AnimationSet)118 AlphaAnimation (android.view.animation.AlphaAnimation)86 TranslateAnimation (android.view.animation.TranslateAnimation)75 Animation (android.view.animation.Animation)71 ScaleAnimation (android.view.animation.ScaleAnimation)69 ClipRectAnimation (android.view.animation.ClipRectAnimation)32 CurvedTranslateAnimation (com.android.server.wm.animation.CurvedTranslateAnimation)32 WindowAnimation_activityCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation)30 WindowAnimation_activityCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation)30 WindowAnimation_activityOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation)30 WindowAnimation_activityOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation)30 WindowAnimation_taskCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation)30 WindowAnimation_taskCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation)30 WindowAnimation_taskOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation)30 WindowAnimation_taskOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation)30 WindowAnimation_taskToBackEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation)30 WindowAnimation_taskToBackExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation)30 WindowAnimation_taskToFrontEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation)30 WindowAnimation_taskToFrontExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation)30 WindowAnimation_wallpaperCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation)30