use of android.view.animation.ScaleAnimation in project KJFrameForAndroid by kymjs.
the class KJAnimations method getScaleAnimation.
/**
* 缩放 Scale
*/
public static Animation getScaleAnimation(float scaleXY, long durationMillis) {
ScaleAnimation scale = new ScaleAnimation(1.0f, scaleXY, 1.0f, scaleXY, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
scale.setDuration(durationMillis);
return scale;
}
use of android.view.animation.ScaleAnimation in project photo-picker-plus-android by chute.
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 Lazy by l123456789jy.
the class AnimationUtils method getAmplificationAnimation.
/**
* 获取一个放大动画
* @param durationMillis 时间
* @param animationListener 监听
*
* @return 返回一个放大的效果
*/
public static ScaleAnimation getAmplificationAnimation(long durationMillis, AnimationListener animationListener) {
ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, ScaleAnimation.RELATIVE_TO_SELF, ScaleAnimation.RELATIVE_TO_SELF);
scaleAnimation.setDuration(durationMillis);
scaleAnimation.setAnimationListener(animationListener);
return scaleAnimation;
}
use of android.view.animation.ScaleAnimation in project ArcMenu by daCapricorn.
the class ArcMenu method createItemDisapperAnimation.
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;
}
use of android.view.animation.ScaleAnimation in project material-sheet-fab by gowong.
the class Fab method show.
/**
* Shows the FAB and sets the FAB's translation.
*
* @param translationX translation X value
* @param translationY translation Y value
*/
@Override
public void show(float translationX, float translationY) {
// Set FAB's translation
setTranslation(translationX, translationY);
// Only use scale animation if FAB is hidden
if (getVisibility() != View.VISIBLE) {
// Pivots indicate where the animation begins from
float pivotX = getPivotX() + translationX;
float pivotY = getPivotY() + translationY;
ScaleAnimation anim;
// center of the FAB
if (pivotX == 0 || pivotY == 0) {
anim = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
} else {
anim = new ScaleAnimation(0, 1, 0, 1, pivotX, pivotY);
}
// Animate FAB expanding
anim.setDuration(FAB_ANIM_DURATION);
anim.setInterpolator(getInterpolator());
startAnimation(anim);
}
setVisibility(View.VISIBLE);
}
Aggregations