-
Notifications
You must be signed in to change notification settings - Fork 0
Add dagger2 support #2
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
base: develop
Are you sure you want to change the base?
Conversation
| @Provides | ||
| @Singleton | ||
| Cache provideOkHttpCache(Application application) { | ||
| int cacheSize = 5 * 1024 * 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AFGhazy extract this to a final constant
|
|
||
| ((BaseApp) getActivity().getApplication()).getNetworkComponent().inject(this); | ||
|
|
||
| setPresenter(NewTodoPresenter.getInstance(mTodosSubscriber, this)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AFGhazy this should be handled by DI, add @Inject to the presenter do the necessary changes (add @ provide .. etc) and remove this line.
IslamSalah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AFGhazy +1 For the clean easy to review PR. Keep it up
| @Module | ||
| public class NetworkModule { | ||
| @Provides | ||
| @Named("api_url") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AFGhazy I believe @Named("api_url") is redundant and can be removed. What do you think?
|
|
||
| @Provides | ||
| @Singleton | ||
| @Named("rxjava2_call_adapter") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AFGhazy I believe @Named("rxjava2_call_adapter") is redundant and can be removed. What do you think?
| @Provides | ||
| @Singleton | ||
| @Named("non_cached") | ||
| OkHttpClient provideOkHttpClientNonCached() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AFGhazy I believe this method is never used. If so we can remove it and remove @Named("cached") as well. Kindly let me know if I missed something.
No description provided.