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