下面是一個使用我的助手實現的奧飛動漫:
public void blinkText(final TextView text_to_animate, int durationMillis) {
final AlphaAnimation fade_out = new AlphaAnimation(1.0f, 0.0f);
//ScaleAnimation scale_it = new ScaleAnimation(1.0f, 1.25f, 1.0f, 1.25f);
fade_out.setDuration(durationMillis);
final AlphaAnimation fade_in = new AlphaAnimation(0.0f, 1.0f);
//ScaleAnimation scale_it = new ScaleAnimation(1.0f, 1.25f, 1.0f, 1.25f);
fade_in.setDuration(durationMillis);
fade_out.setAnimationListener(new AnimationListener() {
public void onAnimationEnd(Animation arg0) {
// TODO Auto-generated method stub
if (recording == true)
text_to_animate.startAnimation(fade_in);
}
public void onAnimationRepeat(Animation arg0) {
// TODO Auto-generated method stub
}
public void onAnimationStart(Animation arg0) {
// TODO Auto-generated method stub
}
});
fade_in.setAnimationListener(new AnimationListener() {
public void onAnimationEnd(Animation arg0) {
// TODO Auto-generated method stub
if (recording == true)
text_to_animate.startAnimation(fade_out);
}
public void onAnimationRepeat(Animation arg0) {
// TODO Auto-generated method stub
}
public void onAnimationStart(Animation arg0) {
// TODO Auto-generated method stub
}
});
text_to_animate.startAnimation(fade_out);
}
太晚,但在這裏(https://開頭github上。com/hanks-zyh/HTextView)很多很酷的動畫 – 2016-09-09 14:25:21