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

Layout View Ids: use @id instead of @+id for referenced ids #4604

Closed
bmarty opened this issue Dec 1, 2021 · 3 comments · Fixed by #4611
Closed

Layout View Ids: use @id instead of @+id for referenced ids #4604

bmarty opened this issue Dec 1, 2021 · 3 comments · Fixed by #4611
Assignees
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks

Comments

@bmarty
Copy link
Member

bmarty commented Dec 1, 2021

Using @id instead of @+id for referenced ids is better since there will be only one declaration for each id, so code navigation will be simplified. For instance the dialogs:

image

and in the code

image

will disappear and the navigation will directly goes to the view which has the searched id.

Initially reported by @Florian14 , but I do not think he has created an issue about it.

A global replacement could be done, also some rules could be added to this file: https://github.com/vector-im/element-android/blob/main/tools/check/forbidden_strings_in_layout.txt to avoid the issue to come back

@bmarty bmarty added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Dec 1, 2021
@Florian14
Copy link
Contributor

Florian14 commented Dec 1, 2021

@bmarty Note that the +id should be kept at the declaration level, + should be removed only in the references (in the constraints of another view for example)

@bmarty
Copy link
Member Author

bmarty commented Dec 1, 2021

Of course, I'm talking about "referenced ids" here :)

@bmarty bmarty self-assigned this Dec 1, 2021
@bmarty bmarty mentioned this issue Dec 1, 2021
@bmarty
Copy link
Member Author

bmarty commented Dec 2, 2021

In EA 1.3.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants