First, in addition to the normal Fresco Gradle dependency, you have to add the OkHttp 3 dependency to your build.gradle
:
compile "com.facebook.fresco:imagepipeline-okhttp3:1.2.0" // Or a newer version.
When you initialize Fresco (usually in your custom Application
implementation), you can now specify your OkHttp client:
OkHttpClient okHttpClient = new OkHttpClient(); // Build on your own OkHttpClient.
Context context = ... // Your Application context.
ImagePipelineConfig config = OkHttpImagePipelineConfigFactory
.newBuilder(context, okHttpClient)
.build();
Fresco.initialize(context, config);