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
Button Widget: Uniform Spacing #3099
Conversation
This still isn't quite equal spacing, unless I'm missing something. The root view There is also an additional 4dp vertical padding for The entity state widget uses very similar spacing for it's elements, if the button widget is updated I feel like that one should be too in this PR to keep their layouts aligned. In combination with your previous PR, should this close the issue? |
@jpelgrom, Regarding the entity state widget what should I do ? |
Commit f3a964e, |
The widget corner radius, especially when using the Dynamic color theme like you do, will depend on the widget theme, Android version, launcher, device and/or manufacturer. If you want to use the widget corner radius (which can be >8dp), you can use
I think changes to mirror the button widget are good 👍
There is a big chance it will be too small when using a modern phone, but for less tall devices / tablets it is less of a problem. Right now the text size is configurable by users so it's not easily solved without adding more options, changing it to a less exact option like 'small/medium/large' or adding a completely different layout, which is IMO not in the scope for this PR. (Adding more padding like you've done does increase the chances of there not being enough space for the text.) |
So is the PR complete or something more should be done? |
Not uniform but close enough when there is a single line of text 😉 |
Summary
Button widget had asymmetrical top and bottom spacing. This PR tries to fix that.
Related issue: #3093
Screenshots
Portrait:
Landscape:
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes
In order to fully solve this only downside with even better but complex approach is to use multiple layouts:
https://developer.android.com/develop/ui/views/appwidgets/layouts#provide-responsive-layouts