android icon indicating copy to clipboard operation
android copied to clipboard

UI updates for ButtonWidget

Open PizzaMarinara opened this issue 1 year ago • 6 comments

Summary

Implementation of a fresher look for Button widget as suggested in #4549, adding a parameter to make the icon's color customizable.

Screenshots

Config: Day: Night: Dynamic: Transparent:

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#1097

Any other notes

PizzaMarinara avatar Aug 26 '24 14:08 PizzaMarinara

Thats looks nice! I see some different top and leading padding, can you check that? For reference, this is the iOS view https://github.com/home-assistant/iOS/blob/master/Sources/Extensions/Widgets/Common/WidgetBasicView.swift Also, how big of a change it would be to allow multiple items inside the same widget like iOS has?

bgoncal avatar Aug 27 '24 08:08 bgoncal

Also, how big of a change it would be to allow multiple items inside the same widget like iOS has?

Quite big, let's not increase the scope of the PR here. (And personally, I think a combined widget with entity state, which has an easy toggle/run instead of requiring you to configure each action, would make more sense for large amounts of items.)

jpelgrom avatar Aug 27 '24 09:08 jpelgrom

Thats looks nice! I see some different top and leading padding, can you check that? For reference, this is the iOS view https://github.com/home-assistant/iOS/blob/master/Sources/Extensions/Widgets/Common/WidgetBasicView.swift Also, how big of a change it would be to allow multiple items inside the same widget like iOS has?

Hi @bgoncal, the different padding is totally a personal preference given the default appearance of the widget is more rectangular shaped I tried leaving less padding horizontally than vertically to allow a little bit more space for the label. I can change it to an uniform padding (given the widget can be also resized). Also as @jpelgrom mentioned, I assume a multi-item widget would be a completely different kind of widget, with its own configuration so possibly a bit too outside the scope of the PR.

PizzaMarinara avatar Aug 27 '24 10:08 PizzaMarinara

Agree on having a separate PR for multiple items widget ✅ About the UI, it's not really personal preference, you are proposing a change to align it more with iOS widget style, so, while for the text I may agree it is useful to have more space, for the icon it looks misaligned when it's top marging is different from it's leading margin, unless this is something common in Material Design and I am unaware

bgoncal avatar Aug 27 '24 10:08 bgoncal

Added a commit that fixes most of @jpelgrom's remarks.

Why use translationZ which is relative, instead of elevation?

I believe they're equivalent? I'm not sure if there's any specific reason to use either.

PizzaMarinara avatar Aug 27 '24 14:08 PizzaMarinara

Hi @PizzaMarinara just wanted to check in with you to see if you wanted to pick up this PR again? its about 4 months old with some conflicts as well. I know a lot of users will be very happy with this if you decide to pick it back up!

dshokouhi avatar Dec 11 '24 16:12 dshokouhi