8000 Use correct block for method injection of ViewById and ViewsById by dodgex · Pull Request #1967 · androidannotations/androidannotations · GitHub
[go: up one dir, main page]

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

Conversation

@dodgex
Copy link
Member
8000 dodgex commented Mar 7, 2017

fix #1966

@dodgex dodgex requested a review from WonderCsabo March 7, 2017 18:54
@WonderCsabo
Copy link
Member

@dodgex i do not understand this. The current code is using the injection block, and these are injection annotations.

@dodgex
Copy link
Member Author
dodgex commented Mar 12, 2017

There is an issue with the order of injections. If you use method injection for a list of views there is a chance that you get an empty or only partially filled list in the injecting method. With this change the method injection is ensured to be called after all views have been resolved. you can see an example of generated code in the issue #1966

@WonderCsabo
Copy link
Member

@dodgex but with your change, the view injections end up in the same block as @AfterViews. And in that case, in case of wrong handler order, @AfterViews generated code could be added before the view injections... We created the blocks to add code in correct order, and this change would revert that, making the blocks redundant.

@dodgex
Copy link
Member Author
dodgex commented Mar 13, 2017

Oh damn... yeah. I forgot about @AfterViews. I'll see if i can find a better solution. :)

@dodgex
Copy link
Member Author
dodgex commented Mar 14, 2017

PR Updated. I added a new block for viewholder lookups between "before injection" and "injection" blocks.

@dodgex dodgex merged commit 4535c6e into androidannotations:develop Mar 14, 2017
@dodgex dodgex deleted the 1966_use_correct_injection_block branch March 14, 2017 21:06
@WonderCsabo WonderCsabo added this to the 4.3 milestone Mar 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Method based @ViewsById isEmpty()

2 participants

0