アニメーションの順番
3249 ワード
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
android:duration="800"
android:fromYDelta="-100%"
android:toYDelta="0" />
<translate
android:duration="800"
android:fromYDelta="0"
android:startOffset="1800"
android:toYDelta="-100%" />
</set>
パラメータ:startOffsetによると、動画はどれぐらい遅れて放送開始されますか? これでアニメの順番を満たす効果が現れます。 public void popInfo() {
Animation anim = AnimationUtils.loadAnimation(mContext, R.anim.custom_home_text_info);
textInfo.setVisibility(View.VISIBLE); // , , bug。
anim.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
textInfo.setVisibility(View.GONE);
}
});
textInfo.startAnimation(anim);
}