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);
}
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);
}
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);
}
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);
}
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;
}
Aggregations