I want to export a visual assets library and am ev...
# compose-android
f
I want to export a visual assets library and am evaluating using ImageVector or svg/android-drawable. I was planning on using ImageVector due to the kotlin API and inherit KMP support. But it seems recently that the MaterialIcons lib was deprecated due to "outdate styling" and "slow compilation times". There is an obvious byte code bloat when using ImageVector, but if we are using a compiled lib, what actually slows down App compilation? It seems a little bizarre to me. It seems svgs are support OOTB for KMP now, so maybe converting assets to Android drawables just for that target could work.
l
The problem for compilation times was because the icons library had thousands of icons, it depends on the size here
f
Cheers @Louis Pullen-Freilich [G] any idea on the scale of the slow down though? Was it slow for proguard?
m
Why don’t you just download the icons you need as Android vector icons from here https://fonts.google.com/icons ? Then manually (or automatically) substitute the Android color definition in the files. From
android:fillColor="@android:color/white"
to
android:fillColor="#FFFFFF"
After that you can just use these icons on all compose targets.
l
Yeah it makes proguard / r8 take a long time to identify unused icons
1