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

Ribbon not applied to API 26 adaptive-icons #23

Open
mensly opened this issue Aug 1, 2017 · 5 comments
Open

Ribbon not applied to API 26 adaptive-icons #23

mensly opened this issue Aug 1, 2017 · 5 comments
Labels

Comments

@mensly
Copy link
Collaborator

mensly commented Aug 1, 2017

Currently, no visible changes will be made to the icons when using this plugin with the default template project in Canary Android Studio 3.0 and run on a device running the Android 8 Beta. This is due to changes in how icons are specified to allow vector formats and masked layers.

A few approaches I am considering in order to fix this if I have the time would be to (optionally) trash the mipmap-anydpi-v26 directory when applying a ribbon or draw a ribbon in a more central position when applying to ic_launcher_foreground. It should also be possible to apply colour filters (ie grayScaleFilter) to vector assets by modifying fillColor and strokeColor in the xml attributes.

See: https://developer.android.com/preview/features/adaptive-icons.html

@gfx gfx added the bug label Aug 14, 2017
@ValCanBuild
Copy link

Any timeline on this? I use a vector for my foreground adaptive icon layer and would like to be able to apply the ribbon to it.

@mensly
Copy link
Collaborator Author

mensly commented Sep 20, 2017

Unlikely to be soon as I've fixed it for our use-case, but once I get some free time or open-source contribution time at work, this is the top of my priority list.

@mfrtrifork
Copy link

mfrtrifork commented Nov 16, 2017

+1 - @mensly can we see your workaround ?

@shahsurajk
Copy link

Well as for a workaround, adaptive icons use a foreground and a background for the launcher icon, what could be done is:

  1. check for ic_launcher_foreground.xml in your res/drawable folder, this would be an svg icon for most users copy this and paste it in a separate variant-specific path, for ex. for debug builds paste it in debug/res/drawable/ic_launcher_foreground.xml, in the path element find the fillColor variable and change the color for some different value other than the one present there, this will be your identifier to that variant. Similar can be done for other variants as well.

  2. To modify the background, like the grayFilter you can find a file called ic_launcher_drawable.xml in your values folder, copy it and paste it in a variant-specific folder, for ex for debug it can be /debug/res/values/ic_launcher_background.xml and change the value ic_laucher_background.xml to something specific to your variant. run your app and try!

ps. thank you for this lib. saved me a lot of effort for non-oreo devices.

@rajdheepak
Copy link

This library is super cool but unfortunately we are not able to use it since this does not work for oreo and above devices. Any timeline on when we can have this working for adaptive icons?

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

No branches or pull requests

6 participants