Search in sources :

Example 41 with AnimationSet

use of android.view.animation.AnimationSet in project weex-example by KalicyZhou.

the class SplashActivity method onCreate.

@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);
    AnimationSet animationSet = new AnimationSet(false);
    animationSet.addAnimation(scaleAnimation);
    animationSet.setDuration(1000);
    animationSet.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            startMainActivity();
            finish();
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    textView.startAnimation(animationSet);
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation) Animation(android.view.animation.Animation) View(android.view.View) AnimationSet(android.view.animation.AnimationSet) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 42 with AnimationSet

use of android.view.animation.AnimationSet in project android-satellite-menu by siyamed.

the class SatelliteAnimationCreator method createItemOutAnimation.

public static Animation createItemOutAnimation(Context context, int index, long expandDuration, int x, int y) {
    AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f);
    long alphaDuration = 60;
    if (expandDuration < 60) {
        alphaDuration = expandDuration / 4;
    }
    alphaAnimation.setDuration(alphaDuration);
    alphaAnimation.setStartOffset(0);
    TranslateAnimation translate = new TranslateAnimation(0, x, 0, y);
    translate.setStartOffset(0);
    translate.setDuration(expandDuration);
    translate.setInterpolator(context, R.anim.sat_item_overshoot_interpolator);
    RotateAnimation rotate = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    rotate.setInterpolator(context, R.anim.sat_item_out_rotate_interpolator);
    long duration = 100;
    if (expandDuration <= 150) {
        duration = expandDuration / 3;
    }
    rotate.setDuration(expandDuration - duration);
    rotate.setStartOffset(duration);
    AnimationSet animationSet = new AnimationSet(false);
    animationSet.setFillAfter(false);
    animationSet.setFillBefore(true);
    animationSet.setFillEnabled(true);
    //animationSet.addAnimation(alphaAnimation);
    //animationSet.addAnimation(rotate);
    animationSet.addAnimation(translate);
    animationSet.setStartOffset(30 * index);
    return animationSet;
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) AnimationSet(android.view.animation.AnimationSet) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 43 with AnimationSet

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

the class AbAnimationUtil method playRotateAnimation.

/**
     * 旋转动画
     * @param v
     * @param durationMillis
     * @param repeatCount  Animation.INFINITE
     * @param repeatMode  Animation.RESTART
     */
public static void playRotateAnimation(View v, long durationMillis, int repeatCount, int repeatMode) {
    //创建AnimationSet对象
    AnimationSet animationSet = new AnimationSet(true);
    //创建RotateAnimation对象
    RotateAnimation rotateAnimation = new RotateAnimation(0f, +360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    //设置动画持续
    rotateAnimation.setDuration(durationMillis);
    rotateAnimation.setRepeatCount(repeatCount);
    //Animation.RESTART
    rotateAnimation.setRepeatMode(repeatMode);
    //动画插入器
    rotateAnimation.setInterpolator(v.getContext(), android.R.anim.decelerate_interpolator);
    //添加到AnimationSet
    animationSet.addAnimation(rotateAnimation);
    //开始动画 
    v.startAnimation(animationSet);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) AnimationSet(android.view.animation.AnimationSet)

Example 44 with AnimationSet

use of android.view.animation.AnimationSet in project smartmodule by carozhu.

the class AnimationController method slideFadeIn.

public void slideFadeIn(View view, long durationMillis, long delayMillis) {
    TranslateAnimation animation1 = new TranslateAnimation(rela2, 1, rela2, 0, rela2, 0, rela2, 0);
    AlphaAnimation animation2 = new AlphaAnimation(0, 1);
    AnimationSet animation = new AnimationSet(false);
    animation.addAnimation(animation1);
    animation.addAnimation(animation2);
    baseIn(view, animation, durationMillis, delayMillis);
}
Also used : TranslateAnimation(android.view.animation.TranslateAnimation) AnimationSet(android.view.animation.AnimationSet) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 45 with AnimationSet

use of android.view.animation.AnimationSet in project smartmodule by carozhu.

the class AnimationController method slideFadeOut.

public void slideFadeOut(View view, long durationMillis, long delayMillis) {
    TranslateAnimation animation1 = new TranslateAnimation(rela2, 0, rela2, -1, rela2, 0, rela2, 0);
    AlphaAnimation animation2 = new AlphaAnimation(1, 0);
    AnimationSet animation = new AnimationSet(false);
    animation.addAnimation(animation1);
    animation.addAnimation(animation2);
    baseOut(view, animation, durationMillis, delayMillis);
}
Also used : TranslateAnimation(android.view.animation.TranslateAnimation) AnimationSet(android.view.animation.AnimationSet) AlphaAnimation(android.view.animation.AlphaAnimation)

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