Search in sources :

Example 51 with ScaleAnimation

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

the class AbAnimationUtil method scaleView.

/**
	 * 缩放View的显示.
	 *
	 * @param view 需要改变的View
	 * @param toSize 缩放的大小,其中正值代表放大,负值代表缩小,数值代表缩放的倍数
	 */
private static void scaleView(final View view, float toSize) {
    ScaleAnimation scale = null;
    if (toSize == 0) {
        return;
    } else if (toSize > 0) {
        scale = new ScaleAnimation(1.0f, toSize, 1.0f, toSize, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    } else {
        scale = new ScaleAnimation(toSize * (-1), 1.0f, toSize * (-1), 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    }
    scale.setDuration(aniDurationMillis);
    scale.setInterpolator(new AccelerateDecelerateInterpolator());
    scale.setFillAfter(true);
    view.startAnimation(scale);
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 52 with ScaleAnimation

use of android.view.animation.ScaleAnimation 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 53 with ScaleAnimation

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

the class Recipe050 method startScale.

public void startScale(View view) {
    ScaleAnimation animation;
    animation = new ScaleAnimation(1, 2, 1, 2, mImageView.getWidth() / 2.0F, mImageView.getHeight() / 2.0F);
    // 3秒で
    animation.setDuration(3000);
    animation.setInterpolator(this, android.R.anim.bounce_interpolator);
    mImageView.startAnimation(animation);
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation)

Example 54 with ScaleAnimation

use of android.view.animation.ScaleAnimation in project superCleanMaster by joyoyao.

the class RippleView method onSizeChanged.

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
    super.onSizeChanged(w, h, oldw, oldh);
    WIDTH = w;
    HEIGHT = h;
    scaleAnimation = new ScaleAnimation(1.0f, zoomScale, 1.0f, zoomScale, w / 2, h / 2);
    scaleAnimation.setDuration(zoomDuration);
    scaleAnimation.setRepeatMode(Animation.REVERSE);
    scaleAnimation.setRepeatCount(1);
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation)

Example 55 with ScaleAnimation

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

the class KJAnimations method getScaleAnimation.

/**
     * 缩放 Scale
     */
public static Animation getScaleAnimation(long durationMillis) {
    ScaleAnimation scale = new ScaleAnimation(1.0f, 1.5f, 1.0f, 1.5f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    scale.setDuration(durationMillis);
    return scale;
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation)

Aggregations

ScaleAnimation (android.view.animation.ScaleAnimation)114 AnimationSet (android.view.animation.AnimationSet)60 AlphaAnimation (android.view.animation.AlphaAnimation)56 Animation (android.view.animation.Animation)50 TranslateAnimation (android.view.animation.TranslateAnimation)40 ClipRectAnimation (android.view.animation.ClipRectAnimation)28 CurvedTranslateAnimation (com.android.server.wm.animation.CurvedTranslateAnimation)28 WindowAnimation_activityCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation)26 WindowAnimation_activityCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation)26 WindowAnimation_activityOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation)26 WindowAnimation_activityOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation)26 WindowAnimation_taskCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation)26 WindowAnimation_taskCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation)26 WindowAnimation_taskOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation)26 WindowAnimation_taskOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation)26 WindowAnimation_taskToBackEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation)26 WindowAnimation_taskToBackExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation)26 WindowAnimation_taskToFrontEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation)26 WindowAnimation_taskToFrontExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation)26 WindowAnimation_wallpaperCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation)26