romannurik / AndroidIconAnimator

Android vector icon animation tool
Apache License 2.0
815 stars 52 forks source link

Add ability to set/animate the <vector> tag's android:alpha property #32

Closed alexjlockwood closed 7 years ago

alexjlockwood commented 7 years ago

It is possible to animate the entire vector's opacity by animating the <vector> tag's android:alpha property. AndroidIconAnimator doesn't yet support setting or animating this property.

Here is an example AVD that animates this property.

romannurik commented 7 years ago

Hm, are there legit use-cases for this? I don't think it's a huge change, but feels a little odd.

alexjlockwood commented 7 years ago

The System UI quick setting tiles use it a bunch:

Example animated vector drawables

You can see the property being animated in the airplane and flashlight icons. It's useful in cases where you want to apply a single alpha value on the entire drawable (rather than on each individual path, which won't look the same if two translucent paths overlap each other). I assume it is also a setting in After Effects, because Ari's thing seems to support this attribute as well.

alexjlockwood commented 7 years ago

Also, even if no translucent paths overlap each other, using this property still might be useful because modifying the colors of the paths themselves will alter the behavior of whatever tintMode is currently set on the drawable I think (since the tint will only be applied to the completely opaque path pixels).