Use OkHttpClientProvider to allow extending preconfigurated clients.

This commit is contained in:
Bart Tegenbosch 2017-12-07 23:47:36 +01:00
parent c508247542
commit eac670b2dc
1 changed files with 3 additions and 2 deletions

View File

@ -34,8 +34,9 @@ public class OkHttpProgressGlideModule implements GlideModule {
@Override
public void registerComponents(Context context, Glide glide) {
OkHttpClient client = new OkHttpClient
.Builder()
OkHttpClient client = OkHttpClientProvider
.getOkHttpClient()
.newBuilder()
.addInterceptor(createInterceptor(new DispatchingProgressListener()))
.build();
glide.register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(client));