Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Use correct block for method injection of ViewById and ViewsById#1967

Merged
dodgex merged 2 commits into
androidannotations:developandroidannotations/androidannotations:developfrom
dodgex:1966_use_correct_injection_blockCopy head branch name to clipboard
Mar 14, 2017
Merged

Use correct block for method injection of ViewById and ViewsById#1967
dodgex merged 2 commits into
androidannotations:developandroidannotations/androidannotations:developfrom
dodgex:1966_use_correct_injection_blockCopy head branch name to clipboard

Conversation

@dodgex

@dodgex dodgex commented Mar 7, 2017

Copy link
Copy Markdown
Member

fix #1966

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

Copy link
Copy Markdown
Member

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

@dodgex

dodgex commented Mar 12, 2017

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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

dodgex commented Mar 13, 2017

Copy link
Copy Markdown
Member Author

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

@dodgex

dodgex commented Mar 14, 2017

Copy link
Copy Markdown
Member Author

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.