Search in sources :

Example 46 with Provides

use of dagger.Provides in project Varis-Android by dkhmelenko.

the class NetworkModule method okHttpClient.

@Provides
@Singleton
public OkHttpClient okHttpClient() {
    HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
    interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
    return new OkHttpClient.Builder().addInterceptor(interceptor).followRedirects(false).followSslRedirects(false).build();
}
Also used : GsonBuilder(com.google.gson.GsonBuilder) HttpLoggingInterceptor(okhttp3.logging.HttpLoggingInterceptor) Singleton(javax.inject.Singleton) Provides(dagger.Provides)

Aggregations

Provides (dagger.Provides)46 Singleton (javax.inject.Singleton)35 HttpLoggingInterceptor (okhttp3.logging.HttpLoggingInterceptor)11 OkHttpClient (okhttp3.OkHttpClient)10 OkHttpClient (com.squareup.okhttp.OkHttpClient)5 StethoInterceptor (com.facebook.stetho.okhttp3.StethoInterceptor)3 GsonBuilder (com.google.gson.GsonBuilder)3 Cache (okhttp3.Cache)3 LoginManager (com.byoutline.kickmaterial.managers.LoginManager)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 PlaceRenderer (com.github.pedrovgs.sample.renderer.PlaceRenderer)2 TvShowRenderer (com.github.pedrovgs.sample.renderer.TvShowRenderer)2 Gson (com.google.gson.Gson)2 BindingsGroup (dagger.internal.BindingsGroup)2 SetBinding (dagger.internal.SetBinding)2 PerApplication (io.hefuyi.listener.injector.scope.PerApplication)2 File (java.io.File)2 LinkedHashMap (java.util.LinkedHashMap)2 Named (javax.inject.Named)2 ExecutableElement (javax.lang.model.element.ExecutableElement)2