我正在尝试将http://developer.android.com/training/animation/zoom.html移植回 API < 11。
我正在使用 Nineoldandroid 库来做到这一点。但是有这部分是nineoldandroid无法理解的:
AnimatorSet set = new AnimatorSet();
set.play(ObjectAnimator
.ofFloat(expandedImageView, View.X, startBounds.left))
.with(ObjectAnimator
.ofFloat(expandedImageView,
View.Y, startBounds.top))
.with(ObjectAnimator
.ofFloat(expandedImageView,
View.SCALE_X, startScaleFinal))
.with(ObjectAnimator
.ofFloat(expandedImageView,
View.SCALE_Y, startScaleFinal));
我把它变成了:
AnimatorSet set = new AnimatorSet();
set.playTogether(
ObjectAnimator.ofFloat(expandedImageView, View.X, startBounds.left, finalBounds.left),
ObjectAnimator.ofFloat(expandedImageView, View.Y, startBounds.top, finalBounds.top),
ObjectAnimator.ofFloat(expandedImageView, View.SCALE_X, startScale, 1f),
ObjectAnimator.ofFloat(expandedImageView, View.SCALE_Y, startScale, 1f)
);
但是不接受 View.X、View.Y、View.SCALE_X 和 View.SCALE_Y。
是否应该将这些替换为字符串 "translationX", translationY" 和 "scaleX", "scaleY" ?