Agregue ObjectAnimator a AnimatedVectorDrawable en tiempo de ejecución

Puedo cambiar el fillColor de un AnimatedVectorDrawable usando archivos xml.

<?xml version="1.0" encoding="utf-8"?> <animated-vector xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/my_svg"> <target android:animation="@animator/myanimator" android:name="color" /> </animated-vector> <?xml version="1.0" encoding="utf-8"?> <set> <objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" android:duration="3000" android:propertyName="fillColor" android:valueType="intType" android:interpolator="@android:interpolator/decelerate_cubic" android:valueFrom="@color/blue" android:valueTo="@color/green" /> </set> 

  mImageView = (ImageView)findViewById(R.id.ImageView); Drawable drawable = mImageView.getDrawable(); if (drawable instanceof Animatable) { ((Animatable) drawable).start(); } 

¿Pero hay una manera de cambiar el color en tiempo de ejecución?

FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.