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

Android 8.0.0 #22

Closed
varo610 opened this issue Apr 27, 2018 · 7 comments
Closed

Android 8.0.0 #22

varo610 opened this issue Apr 27, 2018 · 7 comments

Comments

@varo610
Copy link

varo610 commented Apr 27, 2018

I really like the plugin but I can't make it work on Android 8.0.0 I have zero problems on previous versions. It compiles perfectly but the icon doesn't change.

Thank you

@akaita
Copy link
Owner

akaita commented Apr 29, 2018

Can you share your configuration?

@varo610
Copy link
Author

varo610 commented Apr 30, 2018

easylauncher.gradle :

apply plugin: 'com.akaita.android.easylauncher'

easylauncher {

defaultFlavorNaming = true

productFlavors {
    dev {
        filters = customColorRibbonFilter("DEV", "#CD212A", "#FFFFFF")
    }

    devGer {
        filters = customColorRibbonFilter("devGER", "#009874", "#FFFFFF")
    }
}

}

app build.gradle:

apply from: '../easylauncher.gradle'

@kylpo
Copy link

kylpo commented May 1, 2018

Based on maskarade/gradle-android-ribbonizer-plugin#23, it might be a problem with adaptive icons

@shahsurajk
Copy link

You can try this:
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.

@TamasBarta
Copy link

I understand that in fact this lib fails to generate adaptive icons (I tried it, it doesn't work for our team either), but I fail to understand why. Adaptive icons are made of background and foreground images. (In our project one is a vector, other is a raster, so that shouldn't make a difference)

Why doesn't it work, if I specify the background or foreground drawable as one to be "ribbonized"? It should, shouldn't it?

@TamasBarta
Copy link

My bad, I just checked again, and the raster images are now removed. I checked again, and with raster images, the plugin works fine, so this is not an adaptive icon issue, but rather a vector image one.

For those who still have trouble, check if your image is in mipmap or drawable, that was the confusion for us, and provide it explicitly if needed in the configuration of the plugin. Ours is in drawable for some reason, but it shouldn't be an issue, since it's a vector image, so the plugin still doesn't work for our case. :(

@akaita
Copy link
Owner

akaita commented Oct 22, 2018

I'm pretty late to the party 🙇 .
@varo610 you need to provide the path to the foreground image of the adaptive icon. For example:

easylauncher {
    foregroundIconNames "@mipmap/ic_launcher_foreground" // Foreground of adaptive launcher icon
}

btw: @TamasBarta you are right, the plugin still doesn't support vector images. I have an open issue for that #9

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

5 participants