I have a problem. I want to animate the background color of a LinearLayout
, using ObjectAnimator
.
The problem is that it animates, but it does neither care about duration nor valueFrom
and valueTo
.
This is my xml file:
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="2000"
android:propertyName="backgroundColor"
android:repeatCount="infinite"
android:repeatMode="reverse"
android:valueFrom="#FF0000"
android:valueTo="#000000" />
In Java I call like this:
ObjectAnimator objAnim = (ObjectAnimator)AnimatorInflater.loadAnimator(getActivity(), R.animator.animator_bkg);
objAnim.setTarget(view);
objAnim.start();
Note that when I animate the alpha of the layout, it works as expected.
Is this an Android bug (4.0.3 on Asus Transformer), or I miss something?