Open AndroidDeveloperLB opened 5 years ago
Good question, I'm not sure myself actually. I just based this code upon the samples provided by the Lottie team.
Possibly, the Lottie library is "smarter" in the sense that it is aware of the JSON file that represents the animation and that it can manipulate the data rather than the actual drawables/views being created. But that is just speculation on my end.
I'll leave the issue open for discussion so maybe someone can bump in and enlighten us all 😉
On some Android views (ImageView for example), we can set a ColorFilter: https://medium.com/over-engineering/manipulating-images-and-drawables-with-androids-colorfilter-25bf061843e7 https://developer.android.com/reference/android/graphics/ColorFilter
On some cases we can even use tinting.
But we can do the same on Lottie, using its own API :
Is there any difference between those , maybe in terms of performance? It's just that the Lottie's way is much longer...