mistamek / Android-drawable-preview-plugin

Android studio plugin for preview drawables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request: handle adaptive-icon

AndroidDeveloperLB opened this issue · comments

Not shown:

image

Hi, this feature is already implemented, and works with the default icon. Can you provide your icon for debug?

Hmm, can you try move <color name="ic_launcher_background">#90CAF9</color>
to colors.xml and delete ic_launcher_background.xml?
I think that the problem is that sdk expects in ic_launcher_background.xml, which lies in the drawables, exactly the drawable, and not the color resource. As soon as I moved this resource to colors.xml, everything worked as expected.

Why? That's a valid configuration of the icon. I think that's also what the IDE made it.
Look. Even on a completely new project it doesn't handle the adaptive icon :

image

Hmm, that's weird. Background seems to have broken. Tomorrow I will try to solve the problem.

ok please let me know.
It's a cool plugin. Should have been the default behavior, built in the IDE. :)

Fixed a problem. I start parsing the icon only if it lies in the folder with the drawables in the path. Adaptive icon lies in mipmap folder, so parsing was not working.

But by the way, the resource that you showed is still not working. Studio itself shows that the format is not correct. And openapi that I using cannot parse this file.
screenshot_1

Maybe you should update your IDE version. Try Canary.
For me it worked fine.

Tried to use canary 3.4 still does not help. And now prints Android resource linking failed when building the project. Anyway mipmaps now working fine :)

Have you published a new version of the plugin? I don't see any new update fixing the issue. Using v 1.1.3.
Attached a sample project with this icons.
It works fine for me on the preview, but not on the file icon.

image

image

LwpBug.zip

Yep, version 1.1.4 pending approval, and will be available for download within few days.
screenshot_1

Can you please let it opened till I confirm it's ok?

Sure, btw you can try install plugin manually by following instruction in readme.

Seems to work fine now.
Thank you.
I haven't checked, but assets are working fine too, right?

Assets should work fine with binary files, but xml will not work.

xml can be used in assets folder by the app? I don't think it's needed by the plugin, if it's not possible to use them anyway...
You mean vectorDrawable or other kinds, or all kinds?

Exactly, thats why I don't added this support.
Not sure about vectors, but other drawables will not render 100%.

I see. Maybe there is a way, but I don't see much of a point to do it using assets folder.
It could be nice if the plugin had it, but I don't think it serves much purpose.