-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
Patch mdi:home-assistant
icon
#4587
base: master
Are you sure you want to change the base?
Patch mdi:home-assistant
icon
#4587
Conversation
de8abab
to
59ff38a
Compare
59ff38a
to
f95c209
Compare
Can you share how you generated the font?
In other places where the |
That was honestly a lot of just messy trial and error using some online font generators to get the HA icon in the mikepenz CommunityMaterial Fonts replaced with the new SVG logo from the HA assets repo, and getting it lined up with the font borders so it would render at the same size and offset as all other icons in that set. After I figured out we'd only need the one glyph in the font I used
What this PR covers thus far is the direct use of the old icon ( If we can reach consensus about the best way of globally updating the old Broad use of the |
I agree with this solution and would accept it, but it needs to be implemented consistently/everywhere which is why I commented. The @dshokouhi any objections? |
none from me :) |
100d527
to
4ad12e1
Compare
4ad12e1
to
cd0efee
Compare
val mdiIcon = icon.split(":")[1] | ||
if (mdiIcon == "home-assistant") { | ||
return HaIconTypeface.Icon.mdi_home_assistant | ||
} | ||
return IconicsDrawable(context, "cmd-$mdiIcon").icon ?: CommunityMaterial.Icon.cmd_bookmark |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason for not using CommunityMaterial.getIconByMdiName
here?
Summary
Replace the old
mdi:home-assistant
icon with the new one, wherever the MDI icon is used. (e.g. entity icons in WearOS app, and custom notification icons)As the used mikepenz.iconics icon library uses Fonts as the underlying mechanism that is used throughout this codebase, a 1 glyph font is added and a wrapper class that provides that font with the interfaces used to render it through the aforementioned library.
It does feel like a bit of a workaround, but the alternative would likely require much more changes throughout the codebase and this change is as contained as can be.
Screenshots
Based on work done in #4556, as I'm not sure what other places the
mdi:home-assistant
icon could appear.Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes
This PR would be a prerequisite for #4556.