Skip to content
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

Begin migrating Wear OS components to Material 3 #3904

Merged
merged 5 commits into from
Oct 5, 2023

Conversation

dshokouhi
Copy link
Member

@dshokouhi dshokouhi commented Oct 1, 2023

Summary

Begin migration from Material 2 to Material 3 in Wear OS.

I have used the Material theme builder using the starting recommendation https://developer.android.com/jetpack/compose/designsystems/material2-material3#color

Not everything can be migrated just yet as Iconics does not support the new material 3 changes, I have opted to switch to material icons in places I was able to. Others I opted to keep the Button the same until the library is updated.

For this update I have migrated any components that could be migrated without additional changes. I have also migrated material 2 buttons to material 3.

Additional corrections:

  • in SettingsView several variables were incorrectly used so I have updated
  • in SettingsView switched from checkboxes to switches for consistency
  • Cleaned up some warnings on pages that have been updated

We still need to migrate Chip to Button and ToggleChip to ToggleButton. I am not sure if we will be able to migrate WearToggleChip just yet.

Screenshots

Toggle chip colors when selected are different
image

WearToggleChip colors are different
image

Details pane colors are different, new sliders
image

Example of how text is no longer bold by default
image

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

Placing screen shots of fixes here:

Wear toggle chip fixed (for the most part)
image

Settings toggle chip
image

details pane
image

@dshokouhi
Copy link
Member Author

This is probably ready to look at visually to see if colors are where they should be, still need to clean up some commented out code but wanted to keep it for reference while we get the colors right

@dshokouhi
Copy link
Member Author

Started reading the release notes more closely now. Going to do another update and migrate from Chip to Button based on the following.

We have added the Material 3 Button component - this is our stadium-shaped button and was formerly named Chip in the Wear Compose Material library (it has been renamed to Button for consistency with the Compose Material 3 library).

https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0-alpha03

I may also look into replacing ToggleChip with ToggleButton if possible too.

@dshokouhi
Copy link
Member Author

after spending some time on the above comment thats going to take a lot of time and probably the review will be impacted. I will focus on cleaning up the current state unless we find other areas that should be addressed. We should migrate all features to material 3 but we dont have to rush to do them all.

@dshokouhi dshokouhi marked this pull request as ready for review October 3, 2023 23:02
@dshokouhi dshokouhi changed the title First commit of migrating Wear OS components to Material 3 Begin migrating Wear OS components to Material 3 Oct 4, 2023
@JBassett JBassett merged commit d3a1f31 into home-assistant:master Oct 5, 2023
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.

2 participants