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

Try to make @InjectViewState optional #76

Conversation

NotPerfectBlue
Copy link

@NotPerfectBlue NotPerfectBlue commented Jan 20, 2020

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

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