次のアニメーションがあります。
ImageView fallingLeave = (ImageView) rootView.findViewById(R.id.lemonpiece1_large);
mButtonProxy = AnimatorProxy.wrap(fallingLeave);
// Set up the path we're animating along
AnimatorPath path = new AnimatorPath();
path.moveTo(0,0);
path.curveTo(0, 0, 0 , 80, -80, 70);
fallingLeave.setRotation(80);
path.curveTo(-80, 70, -80, 120, 80, 140);
path.curveTo(80, 140, 80, 190, -80, 210);
// Set up the animation
final ObjectAnimator anim = ObjectAnimator.ofObject(this, "buttonLoc",
new PathEvaluator(), path.getPoints().toArray());
anim.setDuration(2000);
anim.start();
問題は、パスがピクセル単位で固定されていることです。私がやりたいのは、パスピクセルを独立して設定することです。それを達成する方法はありますか?
変数をDimensions.xmlにリンクしようとしましたが、うまくいきませんでした。ピクセルパスをピクセル密度比で乗算したいのですが、デバイスの密度比の値を返すことができる関数があるかどうかわかりません.
どんな助けでも感謝します。