Skip to content

chore: snake_case navigation graph XML ids - #3993

Open
Devil1716 wants to merge 1 commit into
google:masterfrom
Devil1716:fix/issue-2916-snake-case-xml-ids
Open

Devil1716 wants to merge 1 commit into
google:masterfrom
Devil1716:fix/issue-2916-snake-case-xml-ids

Conversation

@Devil1716

Copy link
Copy Markdown

Summary

Rename remaining camelCase android:id values in the navigation graph to snake_case and update matching R.id references in tests.

Motivation

Fixes #2916 — XML ids should be snake_case. Layout ids were already compliant; only nav_graph.xml still had camelCase ids.

Changes

  • Convert 17 unique camelCase navigation ids (21 declarations) in nav_graph.xml to snake_case
  • Update R.id uses in MainActivityTest, SurveySelectorFragmentTest, AboutFragmentTest, HomeScreenFragmentTest
  • Leave Safe Args *Directions call sites unchanged (generator camelCases snake_case action ids back to the same method names)

Test plan

  • xmllint accepts the navigation graph; every @id / @+id resolves
  • Repo scan: no remaining camelCase android:id
  • Every project R.id.* matches a declared XML id (except framework R.id.content)
  • Full unit / Gradle suite on CI (Android SDK not available in the agent VM for this branch)
  • CI green on this branch

Notes for reviewers

Scoped to navigation graph + test R.id updates. Tip author is Sharan S with the Google CLA Gmail.


Checklist

  • Diff is minimal; no unrelated refactors
  • Matches project style / CONTRIBUTING
  • No secrets, credentials, or proprietary code
  • Commit messages are clear

Every camelCase android:id in the repo lived in the navigation graph.
Rename those ids to snake_case and update the matching R.id references.
Safe Args Directions methods stay the same, because the generator
camel-cases snake_case action ids.

Fixes google#2916

Co-authored-by: Sharan S <Devil1716@users.noreply.github.com>

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the navigation graph IDs in nav_graph.xml from camelCase to snake_case to ensure naming consistency. Corresponding test files, including AboutFragmentTest, HomeScreenFragmentTest, MainActivityTest, and SurveySelectorFragmentTest, have been updated to use the new snake_case resource IDs. There are no review comments, so I have no feedback to provide.

This branch has not been deployed

No deployments
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.

[Code health] Use snake_case for all XML IDs for consistency

1 participant