ドローアブルのアルファ化は、次のようにうまく機能します。
if(mAlphaAnimation == null){
mAlphaAnimation = ObjectAnimator.ofFloat(this, "alpha", 0.0f,1.0f).setDuration(TARGET_ANIM_ALPHA_DURATION);
mAlphaAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
mAlphaAnimation.setStartDelay(TARGET_ANIM_ALPHA_DELAY_BASE*power);
mAlphaAnimation.setRepeatCount(ValueAnimator.INFINITE);
mAlphaAnimation.setRepeatMode(ValueAnimator.REVERSE);
mAlphaAnimation.addUpdateListener(this);
}
しかし、下のようにドローアブルを回転させたい場合は、うまくいきません。
private void createRotateAnim(float fromDegress,float toDegress,int duration){
if(mRotateAnimation == null){
mRotateAnimation = ObjectAnimator.ofFloat(this, "rotation",fromDegress,toDegress).setDuration(duration);
mRotateAnimation.setStartDelay(100);
mRotateAnimation.setInterpolator(new AccelerateInterpolator());
mRotateAnimation.addUpdateListener(this);
}
}
誰でもこの問題を解決するのを手伝ってくれます。または、これらは回転ドローアブル アニメーションを作成する他の方法です。
下手な英語でごめんなさい。