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

Revisit id, string, color and dimensions resource naming convention advice #154

Open
peter-tackage opened this issue Jul 16, 2017 · 2 comments
Labels

Comments

@peter-tackage
Copy link
Contributor

  • Are there improvements that we have made in projects since the original advice was given?
@peter-tackage peter-tackage changed the title Revisit string, color and dimensions resource naming convention advice Revisit id, string, color and dimensions resource naming convention advice Jul 16, 2017
@shubham08gupta
Copy link

I generally use this approach and find it easier to understand and recognize all the id's.
https://jeroenmols.com/img/blog/resourcenaming/resourcenaming_cheatsheet.pdf. It uses 4 things to name a resource id: WHAT, WHERE, DESCRIPTION, SIZE.
WHAT - what type of id is this. For eg- For TextView, it should be: tv. For activity layout, it should be :activity.
WHERE- where it is being used. For eg in main activity, it should be: activity_main.
DESCRIPTION- a small description of id. For eg - For username, it should be: et_main_username.
SIZE(Optional)- the size of the resource. For eg - 24 dp.
Therefore, a complete id name can be: activity_main, btn_signup_submit, error_main_username_not_provided, ic_add_24dp.

@peter-tackage
Copy link
Contributor Author

@shubham171294, thanks that was guide that I had in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants