use of dagger.Provides in project philm by chrisbanes.
the class NetworkProvider method provideTmdbClient.
@Provides
@Singleton
public Tmdb provideTmdbClient(@CacheDirectory File cacheLocation) {
Tmdb tmdb = new PhilmTmdb(cacheLocation);
tmdb.setApiKey(Constants.TMDB_API_KEY);
tmdb.setIsDebug(Constants.DEBUG_NETWORK);
return tmdb;
}
use of dagger.Provides in project DraggablePanel by pedrovgs.
the class MainModule method provideTvShowCollectionRendererBuilder.
/**
* Provisioning of a RendererBuilder implementation to work with tv shows ListView. More
* information in this library: {@link https://github.com/pedrovgs/Renderers}
*/
@Provides
protected TvShowCollectionRendererBuilder provideTvShowCollectionRendererBuilder(Context context) {
List<Renderer<TvShowViewModel>> prototypes = new LinkedList<Renderer<TvShowViewModel>>();
prototypes.add(new TvShowRenderer(context));
return new TvShowCollectionRendererBuilder(prototypes);
}
use of dagger.Provides in project reark by reark.
the class NetworkModule method provideOkHttpClient.
@Provides
@Singleton
public OkHttpClient provideOkHttpClient(@Named("networkInterceptors") List<Interceptor> networkInterceptors) {
OkHttpClient.Builder okBuilder = new OkHttpClient().newBuilder();
okBuilder.networkInterceptors().addAll(networkInterceptors);
return okBuilder.build();
}
use of dagger.Provides in project FloatingSearchView by renaudcerrato.
the class RetrofitModule method provideHttpClient.
@Provides
@Singleton
OkHttpClient provideHttpClient() {
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient httpClient = new OkHttpClient();
httpClient.interceptors().add(logging);
return httpClient;
}
use of dagger.Provides in project Rutgers-Course-Tracker by tevjef.
the class ClientModule method providesRMPClient.
@Provides
@Singleton
public RMPClient providesRMPClient(OkHttpClient client, Gson gson) {
OkHttpClient okClient = client.clone();
okClient.setConnectTimeout(CONNECT_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
okClient.setReadTimeout(READ_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
RestAdapter restAdapter = new RestAdapter.Builder().setEndpoint("http://rutgersapp.tevindev.me:8080/").setLogLevel(RestAdapter.LogLevel.FULL).setConverter(new GsonConverter(gson)).setClient(new OkClient(okClient)).build();
return new RMPClient(restAdapter.create(ClientService.class));
}
Aggregations