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

Having hardcoded attributes (like colours) for assets makes maintenance hard for downstream forks #4860

Closed
benparsons opened this issue Jan 5, 2022 · 2 comments · Fixed by #5505
Assignees
Labels
A-Theming T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements

Comments

@benparsons
Copy link
Member

Your use case

Problem

We have users who maintain forks downstream of element-android. Sometimes they want to edit assets to match their own branding. Maintaining such a fork is hard when there are hard-coded attributes in assets.

Example

This value was changed: https://github.com/vector-im/element-android/blob/78bdef4e2d3f2eec67b67f93637052ee25881b3e/vector/src/main/res/drawable/ic_shield_trusted_no_border.xml#L8
By this PR: #4338

This small change created significant work downstream, because it wasn't clear what had changed

Suggestion

Could these attribute values be stored centrally?

Have you considered any alternatives?

No response

Additional context

Internal issue ref: https://element-io.atlassian.net/browse/PSC-46

@benparsons benparsons added the T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements label Jan 5, 2022
@bmarty
Copy link
Member

bmarty commented Jan 6, 2022

We can use the accent color for vector drawables, however in this particular case (the green shield), I'm not sure it is relevant.
Supposed that a fork want to change the accent color to red. The green shield will become a red shield and this is not what we are expecting.
What we can do is extract this specific color #0DBD8B to one or several variables (for instance trust_shield_color which can have the value #0DBD8B by default) so that they can be customized more easily on forks.

@bmarty
Copy link
Member

bmarty commented Mar 10, 2022

Fixed in 1.4.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Theming T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants