Using alpha
as the propertyName
of the objectAnimator
does nothing at all. The objectAnimator
is connected to a path
inside the vector
.
fading_animator.xml:
<set xmlns:android="http://schemas.android.com/apk/res/android">
<objectAnimator
android:duration="700"
android:propertyName="alpha"
android:valueFrom="1"
android:valueTo="0"
android:valueType="floatType"
android:repeatCount="infinite"
android:repeatMode="restart"/>
</set>
animated_vector.xml:
<animated-vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/vector_drawable">
<target
android:name="pathTarget"
android:animation="@animator/fading_animator"/>
</animated-vector>
When trying to animate the alpha of a path, you have to use either fillAlpha
or strokeAlpha
. Similarly, scaleX
and scaleY
will not work on a path
but it will work on a group
inside the vector
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With