com.bumptech.glide.integration.okhttp3.OkHttpLibraryGlideModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of okhttp3-integration Show documentation
Show all versions of okhttp3-integration Show documentation
An integration library to use OkHttp 3.x to fetch data over http/https in Glide
package com.bumptech.glide.integration.okhttp3;
import android.content.Context;
import com.bumptech.glide.Registry;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.load.model.GlideUrl;
import com.bumptech.glide.module.AppGlideModule;
import com.bumptech.glide.module.LibraryGlideModule;
import java.io.InputStream;
/**
* Registers OkHttp related classes via Glide's annotation processor.
*
* For Applications that depend on this library and include an
* {@link AppGlideModule} and Glide's annotation processor, this class
* will be automatically included.
*/
@GlideModule
public final class OkHttpLibraryGlideModule extends LibraryGlideModule {
@Override
public void registerComponents(Context context, Registry registry) {
registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory());
}
}