Android中textview字体动画

package com.xyscience.lr.style;

import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.AnimationSet;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;
import android.widget.TextView;

/**
 * @author 幸运Science
 * @time 2014 10 14
 * @details 字体动画
 */
public class TextAnimation {
 
private AnimationSet textAnimationSet;

public TextAnimation(){
}

public void textAnimation(TextView textScore){
textScore.setVisibility(View.VISIBLE);
               TranslateAnimation tAnimation = new TranslateAnimation(0f,0f,0f,-80); // 位移动画效果  
               AlphaAnimation aAnimation = new AlphaAnimation(1, 0); // 透明度动画效果  
               ScaleAnimation sAnimation = new ScaleAnimation(1.0f, 1.6f, 1.0f, 1.6f, 0.5f, 0.5f);  // 缩放动画效果   
              textAnimationSet = new AnimationSet(true);
              textAnimationSet.addAnimation(tAnimation);
              textAnimationSet.addAnimation(aAnimation);
              textAnimationSet.addAnimation(sAnimation);
              textAnimationSet.setFillBefore(false);
              textAnimationSet.setFillAfter(false); 
              textAnimationSet.setFillEnabled(true);
              textAnimationSet.setDuration(700);
      textScore.setAnimation(textAnimationSet);
}


}

你可能感兴趣的:(Android中textview字体动画)