-
-
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
UI updates for ButtonWidget #4594
base: master
Are you sure you want to change the base?
Conversation
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.
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
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 |
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.) |
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. |
Agree on having a separate PR for multiple items widget ✅ |
app/src/main/java/io/homeassistant/companion/android/widgets/button/ButtonWidget.kt
Outdated
Show resolved
Hide resolved
...main/java/io/homeassistant/companion/android/widgets/button/ButtonWidgetConfigureActivity.kt
Outdated
Show resolved
Hide resolved
android:id="@+id/widgetImageButtonLayout" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:paddingVertical="4dp" | ||
android:layout_height="wrap_content" |
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.
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.
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.
Yeah I figured the issue is now caused by the text's size rather than its layout overlapping the above icon. I can reproduce it only if I manually set my font size in the phone's setting to the maximum, otherwise it looks good to me. Is that the case here as well?
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.
No, this is on the default text and display size for me (Pixel 7a; text size 2/7, display size 2/5).
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.
Please see this review comment.
Added a commit that fixes most of @jpelgrom's remarks.
I believe they're equivalent? I'm not sure if there's any specific reason to use either. |
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.
@@ -228,6 +233,10 @@ class ButtonWidget : AppWidgetProvider() { | |||
// Render the icon into the Button's ImageView | |||
setImageViewBitmap(R.id.widgetImageButton, icon.toBitmap(width, height)) | |||
|
|||
widget?.iconColor?.let { | |||
setCustomColorToIcon(it, this) |
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.
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