Refactor TodoWidgetConfigureActivity with Material3 components - #7121
Refactor TodoWidgetConfigureActivity with Material3 components#7121blackredit wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Hi @blackredit
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!
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
There was a problem hiding this comment.
Pull request overview
This PR migrates TodoWidgetConfigureActivity’s Compose UI to Material3 and Home Assistant’s Compose design system (HATheme, HATopBar, HASwitch, HAAccentButton) to improve visual consistency with the rest of the app’s modernized screens.
Changes:
- Replace the legacy
HomeAssistantAppTheme(Material2) withHATheme(Material3) - Move from Material2
Scaffold/TopAppBar/Switch/Buttonto Material3Scaffold+ HA design-system components - Simplify insets/color handling by relying on Material3 scaffold insets and HA theme tokens, and remove the extra
HAThemewrapper aroundEntityPicker
Comments suppressed due to low confidence (2)
app/src/main/kotlin/io/homeassistant/companion/android/widgets/todo/TodoWidgetConfigureActivity.kt:225
- This screen is now wrapped in HATheme (Material3), but the server selector still uses the legacy
ServerExposedDropdownMenu/ExposedDropdownMenuimplementation which is built on Material2ExposedDropdownMenuBox/TextField(seeapp/src/main/kotlin/io/homeassistant/companion/android/util/compose/ExposedDropdownMenu.kt). That will pick up default Material2 theming and can look inconsistent with the HA design system; consider switching toHADropdownMenu(used elsewhere, e.g.AssistSettingsScreen.kt).
if (servers.size > 1) {
ServerExposedDropdownMenu(
servers = servers,
current = selectedServerId,
onSelected = { onServerSelected(it) },
app/src/main/kotlin/io/homeassistant/companion/android/widgets/todo/TodoWidgetConfigureActivity.kt:259
- Now that this screen uses HATheme (Material3),
WidgetBackgroundTypeExposedDropdownMenuwill render using legacy Material2ExposedDropdownMenuBox/TextField(seeapp/.../util/compose/ExposedDropdownMenu.kt). That can cause inconsistent styling compared to the surrounding HA components; consider replacing it withHADropdownMenuto keep the screen fully on the HA design system.
}
WidgetBackgroundTypeExposedDropdownMenu(
current = selectedBackgroundType,
onSelected = { onBackgroundTypeSelected(it) },
…ith HADropdownMenu and improve text color selection
…ith custom dropdown menus and improve layout styling
The tiles changes have now been merged and improved in later PRs. See the settings/qs package in the app module. Probably the best example to follow right now. |





Summary
Migrate the TodoWidgetConfigureScreen UI from Material2 to Material3 and align it with the rest of the application's design system. The TodoWidgetConfigureScreen was using raw Material2 components and didn't match the look and feel of the rest of the app. This migration brings it in line with other screens that already use HATheme, HATopBar, HASwitch, and HAAccentButton.
Changes:
--> Visual consistency improvement for widget configuration screens. No functional changes.
Checklist
Any other notes
This PR is part of the ongoing Material3 migration (ref: #6303). The EntityPicker component used in this screen was introduced in #6253.