question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ribbon not applied to API 26 adaptive-icons

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:5
  • Comments:5

github_iconTop GitHub Comments

5reactions
rajdheepakcommented, Feb 10, 2020

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?

0reactions
shahsurajkcommented, May 10, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Emulator API 26 does not display adaptive icon
I'm running a Pixel emulator running Android O, but for some reason it's simply showing what appears to be the default icon (green...
Read more >
Google Play icon design specifications - Android Developers
Follow these APK icon guidelines to learn how to create adaptive launcher icons introduced in Android 8.0 (API level 26). Product icons
Read more >
unified interface not able to add icon in the ribbon.xml file in ...
Hi Ravindra,. Note that you must use a .svg icon file in the WebResource used in ModernImage, a .png file will not work....
Read more >
Android Oreo - Wikipedia
As of December 2022, 8.17% of Android devices ran Android Oreo, with and 5.11% on Android 8.1 (API 27) and 2.06% on Android...
Read more >
Android Adaptive Icons - air native extensions
Android 8.0 (API level 26) introduces adaptive launcher icons, which can display a variety of shapes across different device models.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found