Skip to content

Refactor TodoWidgetConfigureActivity with Material3 components - #7121

Closed
blackredit wants to merge 7 commits into
home-assistant:mainfrom
blackredit:main
Closed

Refactor TodoWidgetConfigureActivity with Material3 components#7121
blackredit wants to merge 7 commits into
home-assistant:mainfrom
blackredit:main

Conversation

@blackredit

Copy link
Copy Markdown

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:

  • HomeAssistantAppTheme → HATheme
  • material.TopAppBar → HATopBar
  • material.Switch + SwitchDefaults.colors → HASwitch
  • material.Button → HAAccentButton
  • material.Scaffold → material3.Scaffold with contentWindowInsets
  • material.Text → material3.Text
  • Removed HATheme wrapper around EntityPicker (no longer needed)
  • Removed colorResource references (handled by HATheme)
  • Removed manual WindowInsets management (handled by M3 Scaffold)
  • Added missing safeDrawing import that caused a compile error

--> Visual consistency improvement for widget configuration screens. No functional changes.

Checklist

  • New or updated tests have been added to cover the changes following the testing guidelines.
  • The code follows the project's code style and best_practices.
  • The changes have been thoroughly tested, and edge cases have been considered.
  • Changes are backward compatible whenever feasible. Any breaking changes are documented in the changelog for users and/or in the code for developers depending on the relevance.

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.

Copilot AI review requested due to automatic review settings July 2, 2026 18:37

@home-assistant home-assistant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@home-assistant
home-assistant Bot marked this pull request as draft July 2, 2026 18:37
@home-assistant

home-assistant Bot commented Jul 2, 2026

Copy link
Copy Markdown

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) with HATheme (Material3)
  • Move from Material2 Scaffold/TopAppBar/Switch/Button to Material3 Scaffold + HA design-system components
  • Simplify insets/color handling by relying on Material3 scaffold insets and HA theme tokens, and remove the extra HATheme wrapper around EntityPicker
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/ExposedDropdownMenu implementation which is built on Material2 ExposedDropdownMenuBox/TextField (see app/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 to HADropdownMenu (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), WidgetBackgroundTypeExposedDropdownMenu will render using legacy Material2 ExposedDropdownMenuBox/TextField (see app/.../util/compose/ExposedDropdownMenu.kt). That can cause inconsistent styling compared to the surrounding HA components; consider replacing it with HADropdownMenu to keep the screen fully on the HA design system.
            }

            WidgetBackgroundTypeExposedDropdownMenu(
                current = selectedBackgroundType,
                onSelected = { onBackgroundTypeSelected(it) },

…ith HADropdownMenu and improve text color selection
@jpelgrom jpelgrom changed the title Refactor TodoWidgetConfigureActivity with Material3 components ( CLOSES: #6303 ) Refactor TodoWidgetConfigureActivity with Material3 components Jul 2, 2026
@jpelgrom jpelgrom linked an issue Jul 2, 2026 that may be closed by this pull request
@blackredit

blackredit commented Jul 2, 2026

Copy link
Copy Markdown
Author

Ready to re-run the checks + merge. Final screenshots:

new: (debug version)

new1 new2 new3

old: (playstore version)

old1 old2

@TimoPtr

TimoPtr commented Jul 3, 2026

Copy link
Copy Markdown
Member

I invite you to check these PR to see what kind of changes we are going to ask on your PR it's going to make the process faster than redoing a full review.

#7052
#7018

@TimoPtr
TimoPtr marked this pull request as draft July 7, 2026 10:44
@jpelgrom

Copy link
Copy Markdown
Member

I invite you to check these PR to see what kind of changes we are going to ask on your PR it's going to make the process faster than redoing a full review.

#7052 #7018

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.

@blackredit blackredit closed this Jul 17, 2026
@TimoPtr TimoPtr reopened this Jul 28, 2026
@TimoPtr TimoPtr closed this Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rework UI of TodoWidgetConfigureScreen to use Material3

4 participants