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

Make counter sample consistent across phone and watch #1991

Merged
merged 3 commits into from
Jan 18, 2024
Merged

Conversation

kul3r4
Copy link
Collaborator

@kul3r4 kul3r4 commented Jan 18, 2024

WHAT

Make counter sample consistent across phone and watch

WHY

To improve understanding of what the sample shows

HOW

Rename description and labels, use the same button

Checklist 📋

  • Add explicit visibility modifier and explicit return types for public declarations
  • Run spotless check
  • Run tests
  • Update metalava's signature text files

@kul3r4 kul3r4 requested a review from luizgrp January 18, 2024 12:18
Copy link
Member

@luizgrp luizgrp left a comment

Choose a reason for hiding this comment

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

Looking good, just a comment regarding the value placeholder

@@ -72,7 +72,8 @@
<!-- Counter screen -->
<string name="app_helper_counter_label">Counter: %1$s</string>
<string name="app_helper_counter_increase_btn_content_description">Increase counter</string>
<string name="app_helper_counter_increase_explanation">Open the datalayer sample on your watch to observe how the counter number is incremented</string>
<string name="app_helper_counter_message">Value: </string>
Copy link
Member

Choose a reason for hiding this comment

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

for proper translation, the placeholder for the value should be in the string definition, e.g.: Value: %1$s

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, fixed

Text(
modifier = Modifier
.padding(16.dp),
text = stringResource(R.string.app_helper_counter_message) + state.counter,
Copy link
Member

Choose a reason for hiding this comment

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

after adding the placeholder to the string definition, this should be changed to:

text = stringResource(R.string.app_helper_counter_message, state.counter),

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks, fixed

@luizgrp luizgrp merged commit 623ba53 into google:main Jan 18, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants