Skip to content

Instantly share code, notes, and snippets.

@atsushisakai-gh
Created May 23, 2018 15:21
Show Gist options
  • Save atsushisakai-gh/46966fc8e994b0fcb21b2d39d85b1984 to your computer and use it in GitHub Desktop.
Save atsushisakai-gh/46966fc8e994b0fcb21b2d39d85b1984 to your computer and use it in GitHub Desktop.
@GlideModule
public final class MiteneGlideModule extends AppGlideModule {
// Daggerでinjectできるように設定済みである前提
@Inject okhttp3.OkHttpClient authOkHttpClient;
@Override
public void applyOptions(Context context, GlideBuilder builder) {
// 必要なOptionを書きます
}
@Override
public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
registry.append(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(authOkHttpClient));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment