alexjlockwood / ShapeShifter

SVG icon animation tool for Android, iOS, and the web
https://shapeshifter.design
Apache License 2.0
3.97k stars 200 forks source link

Option to export as animation-list drawable #214

Open DarkionAvey opened 6 years ago

DarkionAvey commented 6 years ago

Hi. I'm not sure if this is the right place to ask for features, but anyway. Is there any chance you could implement an option to export the animation sequence as animation-list drawable for android? I know it's an outdated format, but it could come in handy when making Android themes.

It looks something like this (or sometimes with inline drawables)

<animation-list>
    <item android:drawable="@drawable/drawable1" android:duration="50" />
    <item android:drawable="@drawable/drawable2" android:duration="50" />
    <item android:drawable="@drawable/drawable3" android:duration="50" />
    <item android:drawable="@drawable/drawable4" android:duration="50" />
    <item android:drawable="@drawable/drawable5" android:duration="50" />
    <item android:drawable="@drawable/drawable6" android:duration="50" />
 </animation-list>

Thanks!

alexjlockwood commented 6 years ago

Hmm, interesting idea. Is there a specific scenario that you are thinking of where it isn't possible to use an AnimatedVectorDrawable (and you would have to use an animation-list instead?).

DarkionAvey commented 6 years ago

Thanks for your reply! Yes, there's one particular case where animation-list is the only option for animations - it's OMS themes (aka Substratum). Basically, the OMS doesn't allow themes to introduce new IDs to the package that is to be themed. So if I were to use AVDs (create new IDs), the app will crash. For example, if I wanted to theme the status bar screenshot icon, I will have to replace only one file, and to be able to animate the icon, this one file will have to contain all frames without using @drawable. I've tried it on different SDKs, and it works only on Android 7+. Earlier versions of Android don't render inline drawables correctly. I will send you an example file in few hours. I'm away from my PC at the moment. Thanks!