Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Clean up incorrect XML uses of @+id #12755

Closed
NotWoods opened this issue Jul 20, 2020 · 3 comments
Closed

Clean up incorrect XML uses of @+id #12755

NotWoods opened this issue Jul 20, 2020 · 3 comments
Assignees
Labels
eng:health Improve code health good first issue Good for newcomers help wanted Help wanted from a contributor. More complex than good first issue.

Comments

@NotWoods
Copy link
Contributor

NotWoods commented Jul 20, 2020

In our XML files there are two similar ways to refer to IDs: @+id/example_id and @id/example_id. The "plus" variant should only be used to create a new ID, and should only be used inside android:id.

In other attributes, the ID is used to reference another value (such as app:destination, app:layout_constraintStart_toStartOf). In these locations, the @id variant with no plus should be used. Incorrect usage doesn't have runtime issues, but makes the IDE confused sometimes.

We may want to create a lint rule for this later on.

┆Issue is synchronized with this Jira Task

@NotWoods NotWoods added good first issue Good for newcomers eng:health Improve code health help wanted Help wanted from a contributor. More complex than good first issue. labels Jul 20, 2020
@github-actions github-actions bot added the needs:triage Issue needs triage label Jul 20, 2020
@person808 person808 removed the needs:triage Issue needs triage label Jul 20, 2020
@leonardoamurca
Copy link
Contributor

Hi @NotWoods! Can I help you with these changings as my good first issue ?

@NotWoods
Copy link
Contributor Author

Sure @leonardoamurca! Please look through our docs so you can check out a copy of the codebase locally and edit it with Android Studio. Let me know if you need tips for how to proceed with the changes.

leonardoamurca added a commit to leonardoamurca/fenix that referenced this issue Jul 21, 2020
…dy declared ids

When referencing an Android resource ID, you do not need the
plus-symbol if you declared before.
Caution: make sure that the resource you are referring to
is defined EARLIER and not LATER.
boek pushed a commit to boek/fenix that referenced this issue Jul 28, 2020
…dy declared ids

When referencing an Android resource ID, you do not need the
plus-symbol if you declared before.
Caution: make sure that the resource you are referring to
is defined EARLIER and not LATER.
boek pushed a commit to boek/fenix that referenced this issue Jul 28, 2020
…dy declared ids

When referencing an Android resource ID, you do not need the
plus-symbol if you declared before.
Caution: make sure that the resource you are referring to
is defined EARLIER and not LATER.
boek pushed a commit to boek/fenix that referenced this issue Jul 28, 2020
…dy declared ids

When referencing an Android resource ID, you do not need the
plus-symbol if you declared before.
Caution: make sure that the resource you are referring to
is defined EARLIER and not LATER.
boek pushed a commit that referenced this issue Jul 28, 2020
When referencing an Android resource ID, you do not need the
plus-symbol if you declared before.
Caution: make sure that the resource you are referring to
is defined EARLIER and not LATER.
@NotWoods
Copy link
Contributor Author

Closing since this has been fixed by @leonardoamurca 😄

@data-sync-user data-sync-user changed the title Clean up incorrect XML uses of @+id FNX3-21875 ⁃ Clean up incorrect XML uses of @+id Aug 11, 2020
@data-sync-user data-sync-user changed the title FNX3-21875 ⁃ Clean up incorrect XML uses of @+id FNX-13870 ⁃ Clean up incorrect XML uses of @+id Aug 11, 2020
@data-sync-user data-sync-user changed the title FNX-13870 ⁃ Clean up incorrect XML uses of @+id FNX2-15453 ⁃ Clean up incorrect XML uses of @+id Aug 11, 2020
@data-sync-user data-sync-user changed the title FNX2-15453 ⁃ Clean up incorrect XML uses of @+id Clean up incorrect XML uses of @+id May 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
eng:health Improve code health good first issue Good for newcomers help wanted Help wanted from a contributor. More complex than good first issue.
Projects
None yet
Development

No branches or pull requests

4 participants