Java Code Examples for com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader#Factory

The following examples show how to use com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader#Factory . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TyGlide.java    From tysq-android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void registerComponents(@NonNull Context context,
                               @NonNull Glide glide,
                               @NonNull Registry registry) {
    OkHttpUrlLoader.Factory factory = new OkHttpUrlLoader.Factory(OkHttpHelper.getOkHttpInstance());

    registry.replace(GlideUrl.class, InputStream.class, factory);
}
 
Example 2
Source File: HomeAssistAppGlideModule.java    From homeassist with Apache License 2.0 5 votes vote down vote up
@Override
public void registerComponents(Context context, Glide glide, Registry registry) {
    OkHttpClient client = ServiceProvider.getGlideOkHttpClientInstance();
    OkHttpUrlLoader.Factory factory = new OkHttpUrlLoader.Factory(client);

    glide.getRegistry().replace(GlideUrl.class, InputStream.class, factory);
}
 
Example 3
Source File: ArtistImageLoader.java    From MusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
public Factory(Context context) {
    okHttpFactory = new OkHttpUrlLoader.Factory(new OkHttpClient.Builder()
            .connectTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .readTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .writeTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .build());
    lastFMClient = new LastFMRestClient(LastFMRestClient.createDefaultOkHttpClientBuilder(context)
            .connectTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .readTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .writeTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .build());
}
 
Example 4
Source File: ArtistImageLoader.java    From Orin with GNU General Public License v3.0 5 votes vote down vote up
public Factory(Context context) {
    okHttpFactory = new OkHttpUrlLoader.Factory(new OkHttpClient.Builder()
            .connectTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .readTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .writeTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .build());
    lastFMClient = new LastFMRestClient(LastFMRestClient.createDefaultOkHttpClientBuilder(context)
            .connectTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .readTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .writeTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .build());
}
 
Example 5
Source File: ArtistImageLoader.java    From RetroMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
public Factory(Context context) {
    okHttpFactory = new OkHttpUrlLoader.Factory(new OkHttpClient.Builder()
            .connectTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .readTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .writeTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .build());
    lastFMClient = new LastFMRestClient(LastFMRestClient.createDefaultOkHttpClientBuilder(context)
            .connectTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .readTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .writeTimeout(TIMEOUT, TimeUnit.MILLISECONDS)
            .build());
}