use of dagger.Provides in project ngAndroid by davityle.
the class UtilsModule method messageUtils.
@Provides
@Singleton
public MessageUtils messageUtils(ProcessingEnvironment processingEnvironment) {
if (this.messageUtils == null || this.processingEnvironment != processingEnvironment) {
this.messageUtils = new MessageUtils(processingEnvironment);
this.processingEnvironment = processingEnvironment;
}
return messageUtils;
}
use of dagger.Provides in project Varis-Android by dkhmelenko.
the class TestNetworkModule method provideTravisRestClient.
@Singleton
@Provides
public TravisRestClient provideTravisRestClient() {
TravisRestClient travisRestClient = Mockito.mock(TravisRestClient.class);
TravisApiService apiService = Mockito.mock(TravisApiService.class);
Mockito.when(travisRestClient.getApiService()).thenReturn(apiService);
return travisRestClient;
}
use of dagger.Provides in project Varis-Android by dkhmelenko.
the class TestNetworkModule method provideGitHubRestClient.
@Singleton
@Provides
public GitHubRestClient provideGitHubRestClient() {
GitHubRestClient gitHubRestClient = Mockito.mock(GitHubRestClient.class);
GithubApiService githubApiService = Mockito.mock(GithubApiService.class);
Mockito.when(gitHubRestClient.getApiService()).thenReturn(githubApiService);
return gitHubRestClient;
}
use of dagger.Provides in project Just-Another-Android-App by athkalia.
the class NetworkModule method provideOkHttpClient.
@Provides
@Singleton
public static OkHttpClient provideOkHttpClient(PropertiesManager propertiesManager, HttpLoggingInterceptor httpLoggingInterceptor, List<Interceptor> networkInterceptors, BaseUrlInterceptor baseUrlInterceptor) {
final OkHttpClient.Builder okHttpBuilder = new OkHttpClient.Builder();
// Logs network calls for debug builds
okHttpBuilder.addInterceptor(httpLoggingInterceptor);
// Adds authentication headers when required in network calls
okHttpBuilder.addInterceptor(new AuthenticationInterceptor(propertiesManager));
// Helps with changing base url of network calls in espresso tests to the MockWebServer base url.
okHttpBuilder.addInterceptor(baseUrlInterceptor);
// For release builds nothing is added, the list is empty. For debug builds Stetho interceptor is added.
for (Interceptor networkInterceptor : networkInterceptors) {
okHttpBuilder.addNetworkInterceptor(networkInterceptor);
}
return okHttpBuilder.build();
}
use of dagger.Provides in project kickmaterial by byoutline.
the class GlobalModule method providesLoginManager.
@Provides
@GlobalScope
public LoginManager providesLoginManager(Bus bus, KickMaterialService service, AccessTokenProvider accessTokenProvider) {
LoginManager instance = new LoginManager(service, accessTokenProvider);
bus.register(instance);
return instance;
}
Aggregations