Skip to content

RedirectGlide empowers Glide to load images with indirect URLs.

Notifications You must be signed in to change notification settings

IRMobydick/RedirectGlide

 
 

Repository files navigation

RedirectGlide ⚡

Android Arsenal API Download

RedirectGlide empowers Glide to load images with indirect URLs.

Sometimes the images you want to show with Glide have indirect link and you should redirect the URL to reach the real direct link. RedirectGlide is an extension over Glide's OkHttp3 Integration which adds the redirection functionality to Glide.

• Currently it's implemented only for Glide-v4.

Download

Add the following lines to your build.gradle file:

repositories {
    jcenter()
}
  
dependencies {
    implementation 'com.aminography:redirectglide:1.0.2'
    
    // The normal Glide dependencies
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
}

How to use RedirectGlide?

You can simply use RedirectGlide by Glide's generated API. Note that you should clean and rebuild your project to create the GlideApp class in compile time.

String imageUrl = "https://bit.ly/2zeMrFB";

GlideApp.with(context)
        .load(imageUrl)
        .into(imageView);

Example

• Customize the maximum redirection count

The default value for maximum redirection count is set to 5. However you can change it by wrapping the image URL with an instance of RedirectGlideUrl.

GlideApp.with(context)
        .load(new RedirectGlideUrl(imageUrl, 10))
        .into(imageView);

About

RedirectGlide empowers Glide to load images with indirect URLs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 99.7%
  • Shell 0.3%