Open dlew opened 11 years ago
It seems like this ought to be built into the library, but there is a workaround:
PropertyValuesHolder pvh = PropertyValuesHolder.ofFloat("alpha", 0f, 1f);
ObjectAnimator.ofPropertyValuesHolder(AnimatorProxy.NEEDS_PROXY ?
AnimatorProxy.wrap(myView) : myView, pvh).start();
I noticed this when I switched my code from using multiple ObjectAnimators to using a single ObjectAnimator + multiple PropertyValuesHolders.
This code will work:
This code will not work:
The culprit is pretty obvious, you see this in LogCat:
It seems to me that PVH should be able to proxy a View's properties just as well as a vanilla ObjectAnimator. Obviously it's an extra layer of indirection but if ObjectAnimator can do it, PropertyValuesHolder should be able to do so as well.