-
Notifications
You must be signed in to change notification settings - Fork 3
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
Dagger android #5
Conversation
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.
Just a couple of comments, but it looks cleeeeeeeean!
networking/build.gradle
Outdated
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
|
||
// Wolmo | ||
compile 'com.github.Wolox:wolmo-core-android:v1.0.0' | ||
compile 'com.github.Wolox:wolmo-core-android:dagger-android-SNAPSHOT' |
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.
We should change the dagger-android-SNAPSHOT
to the corresponding version when merging the PR. Maybe put a TODO
🤔?
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.
Nice catch, I'll add it 😄
*/ | ||
public abstract class NetworkingApplication extends WolmoApplication { | ||
public class LoggingUtils { |
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.
Should we build a class just to return an HttpLoggingInterceptor
?
If it provided several different Interceptor
s or something like that, i would be more in favor. But i believe this code can be inlined.
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.
I think I'll remove this class and let the client to create and configure a logger interceptor if they want. Do you think we should keep the library com.squareup.okhttp3:logging-interceptor
?
@emalamela Done 😄 |
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.
79c77d5
to
dbe1648
Compare
Summary
Update
wolmo-networking
to make it compatible with dagger.NetworkComponent
to build and configureRetrofitServices
.GsonModule
to provide aGson
instance and dependencies to build it.NetworkingModule
to provide aRetrofit
instance.OkHttpClientModule
to provideOkHttpClient
, and add interceptors to it.NetworkingApplication
that's not needed anymore.RetrofitServices
to move all the creation and configuration to the specific modules.Description
Applications that need to use
wolmo-network
doesn't need anymore to extendNetworkingApplication
.This library provides the modules to build and configure the dependencies of retrofit, Gson and OkHttp, it also provides a default
NetworkingComponent
to simplify the creation and reduce configuration on common scenarios. For it to work you only need to provide it thebaseUrl
, an optional list of interceptors to add tookHttp
and an optional list ofgson
type adapters.We can find the following modules:
NetworkingComponent
is a template component for simple uses, if the clients want to further customize it they can make a new Component and include the modules provided with this library or make their own.If you think we can separate this modules more please let me know so we can make this more modular.
All the modules and the component in this library uses
@NetworkingScope
to define a common scope.TODO