StickySwitch icon indicating copy to clipboard operation
StickySwitch copied to clipboard

SVG icons not working in SDK version 17

Open ghost opened this issue 7 years ago • 1 comments

Hi,

thanks for this awesome switch. My app supports SDK versions up to version 17 and I use SVG icons for the sticky switch. So I've tested my app in a virtual device with SDK version 17 and the app crahses by inflating the layout with following exception exception.txt

It seems that the sticky switch doesn't support SVGs in older versions. If I use PNG icons, the app doesn't crash.

ghost avatar Jan 04 '18 09:01 ghost

@khmegger I fixed the problem not loading the assets in the layout definition, instead in code with following snippet:

styickySwitch.setLeftIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.my_vector_resource, null));

Please use this code also in the library to fix the issue

estebanflores avatar Oct 04 '19 12:10 estebanflores