在ObjectAnimator中使用不同视图大小时的不同目标位置

我试图实现一个动画,我创建一个ImageView的副本,缩小它,并沿曲线移动到另一个视图的位置。 目标是视图到达目标视图的位置时消失。 我的动画代码如下(代码简化了这个问题):

 fun animate(imageViewToCopy: ImageView, targetView: ImageView) { // create copy of ImageView val copy = imageViewToCopy.createCopy() // draw it on the decor view (params excluded, from example code) activity.window.decorView.addView(copy) startAnimation(copy, targetView) } private fun startAnimation(imageView: ImageView, targetView: ImageView) { val dest = IntArray(2) targetView.getLocationOnScreen(dest) val targetX = dest[0] val targetY = dest[1] val disappearAnimatorY = ObjectAnimator.ofFloat(imageView, View.SCALE_Y, 1f, 0f) val disappearAnimatorX = ObjectAnimator.ofFloat(imageView, View.SCALE_X, 1f, 0f) val translatorY = ObjectAnimator.ofFloat(imageView, View.Y, targetY.toFloat()) val translatorX = ObjectAnimator.ofFloat(imageView, View.X, targetX.toFloat()) translatorX.interpolator = TimeInterpolator { input -> // create curve (-Math.pow((input - 1).toDouble(), 2.0) + 1f).toFloat() } AnimatorSet().apply { playSequentially(disappearAnimatorX, disappearAnimatorY, translatorX, translatorY) duration = 1000L start() } } 

问题是,我动画的ImageView的大小改变了它结束的位置。 所以,当我使用一个小的结束在目标视图的右下角,但是当ImageView更大,它结束了在屏幕之外的地方。 我期望的大小无关紧要,视图只是收缩得更快,最终在同一个地点,无论如何。 targetXtargetY是相同的每个图像大小,所以我认为这不是问题。

任何人都可以指向正确的方向吗?