Search in sources :

Example 51 with Provides

use of dagger.Provides in project DevRing by LJYcoder.

the class MovieActivityModule method playingMovieFragment.

@ActivityScope
@Provides
@Named("playing")
MovieFragment playingMovieFragment() {
    Bundle bundle = new Bundle();
    bundle.putInt("type", MovieFragment.TYPE_PLAYING);
    MovieFragment fragment = new MovieFragment();
    fragment.setArguments(bundle);
    return fragment;
}
Also used : Bundle(android.os.Bundle) MovieFragment(com.dev.base.mvp.view.fragment.MovieFragment) Named(javax.inject.Named) ActivityScope(com.ljy.devring.di.scope.ActivityScope) Provides(dagger.Provides)

Example 52 with Provides

use of dagger.Provides in project bugzy by cpunq.

the class NetModule method provideFogBugzService.

@Provides
@Singleton
FogbugzApiService provideFogBugzService(Application application, PrefsHelper prefsHelper, Gson gson) {
    OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
    Retrofit.Builder builder = new Retrofit.Builder().baseUrl(mBaseUrl).addCallAdapterFactory(new LiveDataCallAdapterFactory(gson)).addConverterFactory(GsonConverterFactory.create(gson));
    Retrofit retrofit = builder.client(httpClient.addInterceptor(new ConnectivityInterceptor(application.getApplicationContext())).addInterceptor(new RequestInterceptor(prefsHelper)).build()).build();
    return retrofit.create(FogbugzApiService.class);
}
Also used : LiveDataCallAdapterFactory(com.bluestacks.bugzy.utils.LiveDataCallAdapterFactory) Retrofit(retrofit2.Retrofit) OkHttpClient(okhttp3.OkHttpClient) GsonBuilder(com.google.gson.GsonBuilder) RequestInterceptor(com.bluestacks.bugzy.data.remote.RequestInterceptor) ConnectivityInterceptor(com.bluestacks.bugzy.data.remote.ConnectivityInterceptor) Singleton(javax.inject.Singleton) Provides(dagger.Provides)

Aggregations

Provides (dagger.Provides)52 Singleton (javax.inject.Singleton)39 OkHttpClient (okhttp3.OkHttpClient)11 HttpLoggingInterceptor (okhttp3.logging.HttpLoggingInterceptor)11 OkHttpClient (com.squareup.okhttp.OkHttpClient)5 GsonBuilder (com.google.gson.GsonBuilder)4 Cache (okhttp3.Cache)4 StethoInterceptor (com.facebook.stetho.okhttp3.StethoInterceptor)3 File (java.io.File)3 Named (javax.inject.Named)3 Retrofit (retrofit2.Retrofit)3 Bundle (android.os.Bundle)2 LoginManager (com.byoutline.kickmaterial.managers.LoginManager)2 MovieFragment (com.dev.base.mvp.view.fragment.MovieFragment)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