use of com.toshi.manager.network.interceptor.AppInfoUserAgentInterceptor in project toshi-android-client by toshiapp.
the class GlideOkHttpStack method registerComponents.
@Override
public void registerComponents(Context context, Glide glide) {
final File cacheDir = new File(BaseApplication.get().getCacheDir(), "ToshiImageCache");
final Cache cache = new Cache(cacheDir, MAX_SIZE);
final OkHttpClient client = new OkHttpClient().newBuilder().cache(cache).addInterceptor(new AppInfoUserAgentInterceptor()).addInterceptor(new HttpLoggingInterceptor(new LoggingInterceptor()).setLevel(HttpLoggingInterceptor.Level.BODY)).build();
glide.register(CachedGlideUrl.class, InputStream.class, superFactory(new OkHttpUrlLoader.Factory(client), CachedGlideUrl.class));
glide.register(ForceLoadGlideUrl.class, InputStream.class, superFactory(new OkHttpUrlLoader.Factory(client), ForceLoadGlideUrl.class));
}
Aggregations