Skip to content

Try to make @InjectViewState optional#76

Merged
aasitnikov merged 5 commits intomoxy-community:developfrom
NotPerfectBlue:feature/remove_injectviewstate
Jan 22, 2020
Merged

Try to make @InjectViewState optional#76
aasitnikov merged 5 commits intomoxy-community:developfrom
NotPerfectBlue:feature/remove_injectviewstate

Conversation

@NotPerfectBlue
Copy link
Copy Markdown

@NotPerfectBlue NotPerfectBlue commented Jan 20, 2020

add @Inherited annotation to @InjectViewState and annotate MvpPresenter. It makes all instances of MvpPresenter annotated.

Copy link
Copy Markdown
Member

@aasitnikov aasitnikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! Thanks for your contribution!

I tested the changes in a new project - it really seems like annotation processor can pick up classes, that are not annotated themselves, but have a parent with an annotation. If so, it perfectly applies to Moxy presenters. We evaluated ways to make @InjectViewState optional, but never thought it would be so simple!

Overall changes are good, but could you also add a test, that checks that viewstate is being generated without explicit @InjectViewState on presenter? You can check out ViewTestKt for reference, some check like compilation.generatedSourceFiles().any { it.name.contains("${"$$"}State") } will be sufficient.

@aasitnikov aasitnikov merged commit e730beb into moxy-community:develop Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants