nstudio / nativescript-floatingactionbutton

Material Design Floating Action Button in NativeScript apps.
Other
137 stars 33 forks source link

How to use svg images #108

Open vikasacharya16 opened 4 years ago

vikasacharya16 commented 4 years ago

Is there any way to use SVG images instead of png and icons.

bradmartin commented 4 years ago

I don't believe the native Android widget supports SVGs by default. So the usage of the native widget would need to be extended/customized to add support for SVG as the icons of the FAB.

Quick look at the docs: https://developer.android.com/reference/com/google/android/material/floatingactionbutton/FloatingActionButton.html#setImageDrawable(android.graphics.drawable.Drawable) looks like a Drawable is accepted and android has the VectorDrawable which extends Drawable so it might be possible to actually pass an instance of VectorDrawable to the method inside the plugin.

I'll mark this as an enhancement because it will require checking for SVG and then creating a VectorDrawable from the resource and then passing to the method.

Stanteq commented 4 years ago

@vick16ach Covert svg to font (with icomoon for example)