Tôi đang cố gắng tạo hoạt ảnh bóng chuyển động trong ứng dụng của mình mọi thứ đang hoạt động tốt, bóng được di chuyển theo ý muốn nhưng không mượt mà. Tôi đã thử tất cả mọi thứ để làm cho nó trơn tru nhưng không may mắn mỗi khi tôi thất bại.Di chuyển hoạt hình không trơn tru trong android
đây là mã xml của tôi:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="true" >
<translate
android:duration="3000"
android:fromXDelta="-1%p"
android:fromYDelta="-87%p"
android:toXDelta="1%p"
android:toYDelta="-40%p" />
<translate
android:duration="3000"
android:fromXDelta="2%p"
android:fromYDelta="0%p"
android:startOffset="2200"
android:toXDelta="0%p"
android:toYDelta="42%p" />
<translate
android:duration="4000"
android:fromXDelta="0%p"
android:fromYDelta="42%p"
android:startOffset="4500"
android:toXDelta="-5%p"
android:toYDelta="0%p" />
<translate
android:duration="4000"
android:fromXDelta="0%p"
android:fromYDelta="0%p"
android:startOffset="5500"
android:toXDelta="4%p"
android:toYDelta="-47%p" />
</set>
và đây là mã java của tôi:
ImageView image = (ImageView)findViewById(R.id.imageView1);
Animation anim = AnimationUtils.loadAnimation(this, R.drawable.moveing_ball_anim);
image.startAnimation(anim);
tôi di chuyển hình ảnh trong hình này.