タッチすると、りんごが木から「落ち」(平行移動)、自身の周りを回転して平行移動するはずです。
Animation apple3_anim = AnimationUtils.loadAnimation(this,
R.anim.apple3_animation);
apple3.startAnimation(apple3_anim);
RotateAnimation r = new RotateAnimation(0.0f,
720.0f, Animation.RELATIVE_TO_SELF,
0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
r.setDuration(2000);
apple3.startAnimation(r);
apple3_animation.xml ファイルの xml コード:
<?xml version="1.0" encoding="utf-8"?>
<translate
android:fromXDelta="0"
android:toXDelta="0"
android:fromYDelta="0"
android:toYDelta="450"
android:duration="1200"
>
</translate>
問題は、アニメーションが順番に発生せず、最後の 'r' アニメーションのみが実行されることです。リンゴは自身の周りを 720 度回転します。順番に実行するにはどうすればよいですか?すべてのものを xml ファイルに入れても、 xml で、最後のアニメーションだけが実行されます!