Android 是否可以在设置动画时更改imageview的目标坐标

Android 是否可以在设置动画时更改imageview的目标坐标,android,animation,imageview,android-animation,Android,Animation,Imageview,Android Animation,在我的应用程序中,我能够使用animation.setRepeatCount(5)将图像从源位置动画化到目标位置,并重复动画5次 但是我想在每次重复之后更改目的地位置(yDelta) 例如: 目的地Ydelta为2,第一次重复后需要将Ydelta更改为3,下一次重复时将Ydelta更改为4,依此类推。。。最多可重复5次 下面是我的动画代码: int sourceCoords[] = new int[2]; int targetCoords[] = new int[2]; int xDelta;

在我的应用程序中,我能够使用
animation.setRepeatCount(5)将图像从源位置动画化到目标位置,并重复动画5次
但是我想在每次重复之后更改目的地位置(yDelta)

例如: 目的地Ydelta为2,第一次重复后需要将Ydelta更改为3,下一次重复时将Ydelta更改为4,依此类推。。。最多可重复5次

下面是我的动画代码:

int sourceCoords[] = new int[2];
int targetCoords[] = new int[2];
int xDelta;
int yDelta;

sourceImage.getLocationOnScreen(sourceCoords);
targetImage.getLocationOnScreen(targetCoords);
xDelta = targetCoords[0] - sourceCoords[0];
yDelta = targetCoords[1] - sourceCoords[1];

sourceImage.bringToFront();
TranslateAnimation animation = new TranslateAnimation(0, xDelta, 0, yDelta);
animation.setDuration(400);
animation.setFillAfter(false);
animation.setRepeatCount(5);
sourceImage.startAnimation(animation);
animation.setAnimationListener(new AnimationListener() {

    @Override
    public void onAnimationStart(final Animation animation) {
        sourceImage.bringToFront();     
    }

    @Override
    public void onAnimationRepeat(Animation animation) {
    }

    @Override
    public void onAnimationEnd(Animation animation) {

    }

});

名声?什么名声?你是说重复?若你们需要一些非平凡的动画,那个么扩展动画类并覆盖applyTransformation方法你们能为我的案例发布示例代码吗。。。