Skip to content
RedirectGlide empowers Glide to load images with indirect URLs.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
app
gradle
redirectglide
.gitignore
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
publish.sh
screenshot.png
settings.gradle

README.md

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);
You can’t perform that action at this time.