Add HAFloatingActionButton component#7204
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a reusable HAFloatingActionButton Compose component in :common so features (e.g., Shortcuts V2) can share a Home Assistant–themed FAB implementation and validate its visuals via screenshot tests.
Changes:
- Added
HAFloatingActionButtoncomponent withButtonVariant-driven color theming viaLocalHAColorScheme. - Added a light/dark screenshot test that renders the FAB across all
ButtonVariantvalues. - Included a preview for quick local inspection of the component.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| common/src/main/kotlin/io/homeassistant/companion/android/common/compose/composable/HAFloatingActionButton.kt | Adds the new HA-themed FAB composable + preview. |
| common/src/screenshotTest/kotlin/io/homeassistant/companion/android/compose/composable/HAFloatingActionButtonScreenshotTest.kt | Adds screenshot coverage for the FAB across variants in light/dark. |
66a1fcf to
7b71946
Compare
TimoPtr
left a comment
There was a problem hiding this comment.
Small changes and we are ready to go. As for UI feedback for now we don't have, so let's go with the default and use the custom component so that we can change everywhere in one shot when needed.
| contentColor = colors.contentColor, | ||
| content = { | ||
| Icon( | ||
| imageVector = icon, |
There was a problem hiding this comment.
I wonder if you should actually use the contentColor there? no or M3 is already handling this properly
There was a problem hiding this comment.
It is needed because we are using variants. If we want this one to be primary only, then we could probably drop the explicit colors.
There was a problem hiding this comment.
The imageVector is tint with the contentColor?
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Co-authored-by: Timothy <6560631+TimoPtr@users.noreply.github.com>
Co-authored-by: Timothy <6560631+TimoPtr@users.noreply.github.com>
Summary
As part of the Shortcuts V2 work we're building, we added a reusable HAFloatingActionButton component so it can be shared across features.
Checklist
Screenshots
Link to pull request in documentation repositories
User Documentation: home-assistant/companion.home-assistant#
Developer Documentation: home-assistant/developers.home-assistant#
Any other notes