Android Studio 1.1 Beta 4
Hello,
I am trying to animate a PagerTitleStrip to change color from a dark green to a light green and repeat itself. However, when I try and start the animation nothing changes.
This is my PagerTitleStrip
that I am trying to change the background property. Background property not specified here, as I will change it at runtime.
<android.support.v4.view.PagerTitleStrip
android:id="@+id/pager_title_strip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:paddingBottom="4dp"
android:paddingTop="4dp"
android:textColor="#fff"/>
My animation file in my res/animator/pager_title_animator.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<objectAnimator
android:propertyName="background"
android:valueTo="@android:color/holo_green_light"
android:valueFrom="@android:color/holo_green_dark"
android:duration="500"
android:repeatCount="-1"
android:repeatMode="reverse"/>
</set>
And in my java code where I start it:
AnimatorSet animatorSet = (AnimatorSet)AnimatorInflater.loadAnimator(getApplicationContext(),R.animator.pager_title_animator);
animatorSet.setTarget(mPagerTitleStrip);
animatorSet.start();
Many thanks for any suggestions,