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

Why grayscaleFilter has been removed ? #74

Closed
afaucogney opened this issue Sep 16, 2020 · 3 comments
Closed

Why grayscaleFilter has been removed ? #74

afaucogney opened this issue Sep 16, 2020 · 3 comments
Labels
information needed Further information is requested

Comments

@afaucogney
Copy link

afaucogney commented Sep 16, 2020

First thanks to maintain a fork, that will definitively usefull

Why grayscaleFilter has been removed and how could we replace it ?

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label question to this issue, with a confidence of 0.88. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the information needed Further information is requested label Sep 16, 2020
@afaucogney afaucogney changed the title Why grayFilter has been removed ? Why grayscaleFilter has been removed ? Sep 16, 2020
@mateuszkwiecinski
Copy link
Member

Hello @afaucogney 👋
The history of grayscaleFilter is that my primary goal was to add vector icons support, as from my experience most apps use such (related issue: akaita/easylauncher-gradle-plugin#9).
To make that happen I almost completely rewrote the plugin changing base mechanism of how the filters are being applied. (I tried to describe that in the article I wrote)
Previously, the plugin applied customizations directly to your launcher icon, so to make icon greyscale it redraws app icon pixel by pixel removing the color. After library rework, plugin generates layers which are then merged into single LayerDrawable.
That makes it impossible to modify original icon and remove color.
Moreover, having in mind Adaptive icons support, the customization would have be to applied both to the foreground and to the background layer, which the plugin doesn't currently support (it only modifies the foreground).
I'm not sure I can commit to add support for such modification type. I briefly tried to add such at the very beginning, but heavily failed :/

how could we replace it?

The easiest solution that comes to my mind is to use adaptive icons and have background layer overriden per each build variant. In the simplest form:

<background android:drawable="@color/icon_background_color" />

and override icon_background_color accroding to your needs.

@afaucogney
Copy link
Author

Ok thanks, I used 2 ribbons. Before, I like to have always greyscale for debug build + ribbon depending on the flavor.
But that's ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
information needed Further information is requested
Development

No branches or pull requests

2 participants