Create ScaleAnimation : ScaleAnimation « Animation « Android






Create ScaleAnimation

  
//package jp.mrshiromi.net.onamaenaani.util;

import android.content.Context;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.OvershootInterpolator;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;

class AnimUtil {
  public static Animation createSplashLogoAnimation() {
    AnimationSet set = new AnimationSet(false);

    ScaleAnimation sa = new ScaleAnimation(1.0f, 1.1f, 1.0f, 1.1f,
        Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
        0.5f);
    sa.setDuration(1000);
    sa.setRepeatCount(5);
    sa.setRepeatMode(Animation.REVERSE);

    set.addAnimation(sa);
    set.setInterpolator(new OvershootInterpolator(1.5f));

    return set;
  }
}

   
    
  








Related examples in the same category

1.Scale