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

Update tiles sample for 1.1.0 #497

Merged
merged 4 commits into from
Aug 5, 2022
Merged

Conversation

ataulm
Copy link
Contributor

@ataulm ataulm commented Aug 5, 2022

Before After
image tile_messaging
  • Updated Messaging Tile to match one of the Golden Layouts (Timer)
  • Updated the README to add references to Tiles Material Components and Horologist
  • Add copyrights to XML files (and corresponding Spotless setup)
  • Removed unused resources, moved Golden Tiles back to debug (since we're not using it in the sample, and they can be previewed with the composable annotation in the IDE)
  • Extracted messagingTileLayout from MessagingTileRenderer

@ataulm ataulm added the tiles label Aug 5, 2022
WearTilesKotlin/README.md Show resolved Hide resolved
@@ -40,15 +40,15 @@ class MessagingRepo(private val context: Context) {
suspend fun updateContacts(contacts: List<Contact>) {
context.dataStore.edit {
it.clear()
knownContacts.forEachIndexed { index, contact ->
contacts.forEachIndexed { index, contact ->
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think a bug. No change in behavior since knownContacts is what gets passed to this function from the outside, but for correctness, this function doesn't know about the knownContacts property.

emptyClickable,
deviceParameters
)
.setChipColors(ChipColors.primaryChipColors(MessagingTileTheme.colors))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this ok?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think it's the right approach for samples, unless we want to advocate for dynamically changing themes. Maybe for media, we should show that when artwork changes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Tangential: related to the repetition of context, context.getString(), deviceParameters, MessagingTileTheme.colors. This was something that I wanted to improve by having a Renderer type that could simplify these repetitions. https://github.com/google/horologist/blob/ab8ae486d43b55e46423979d9ad2aacf382d323c/tiles/src/main/java/com/google/android/horologist/tiles/render/SingleTileLayoutRenderer.kt

But not for here, maybe something we can review these and get a nice streamlined API.

Copy link
Contributor Author

@ataulm ataulm Aug 5, 2022

Choose a reason for hiding this comment

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

unless we want to advocate for dynamically changing themes. Maybe for media, we should show that when artwork changes?

yeah let's see how it looks/feels in practice when we do those samples

@ataulm ataulm marked this pull request as ready for review August 5, 2022 10:19
@ataulm ataulm requested a review from yschimke August 5, 2022 10:19
Copy link
Contributor

@yschimke yschimke left a comment

Choose a reason for hiding this comment

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

Looks great

emptyClickable,
deviceParameters
)
.setChipColors(ChipColors.primaryChipColors(MessagingTileTheme.colors))
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think it's the right approach for samples, unless we want to advocate for dynamically changing themes. Maybe for media, we should show that when artwork changes?

emptyClickable,
deviceParameters
)
.setChipColors(ChipColors.primaryChipColors(MessagingTileTheme.colors))
Copy link
Contributor

Choose a reason for hiding this comment

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

Tangential: related to the repetition of context, context.getString(), deviceParameters, MessagingTileTheme.colors. This was something that I wanted to improve by having a Renderer type that could simplify these repetitions. https://github.com/google/horologist/blob/ab8ae486d43b55e46423979d9ad2aacf382d323c/tiles/src/main/java/com/google/android/horologist/tiles/render/SingleTileLayoutRenderer.kt

But not for here, maybe something we can review these and get a nice streamlined API.

@ataulm ataulm merged commit d2fdcac into main Aug 5, 2022
@ataulm ataulm deleted the ataulm/update-tiles-sample-1.1.0 branch August 5, 2022 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants