Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG icons not working in SDK version 17 #25

Open
ghost opened this issue Jan 4, 2018 · 1 comment
Open

SVG icons not working in SDK version 17 #25

ghost opened this issue Jan 4, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 4, 2018

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.

@estebanflores
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant