Skip to content

Commit

Permalink
Improve byte[] loading and consistency.
Browse files Browse the repository at this point in the history
Two significant issues are resolved here:
1. Using Glide.with().load(byte[]) and Glide.with().asDrawable().load(byte[]) used different sets of default options.
2. All byte[] loads default to using the same disk cache key unless override with a signature (which happens inconsistently depending on which variation of load() is called in #1).
sjudd committed Nov 25, 2017
1 parent f1758e5 commit 8613292
Showing 12 changed files with 879 additions and 115 deletions.
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@@ -14,9 +15,13 @@
import com.bumptech.glide.request.RequestOptions;
import java.io.File;
import java.lang.Class;
import java.lang.Deprecated;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.URL;

/**
* Includes all additions from methods in {@link com.bumptech.glide.annotation.GlideExtension}s
@@ -65,6 +70,55 @@ public GlideRequest<Drawable> asDrawable() {
return (GlideRequest<Drawable>) super.asDrawable();
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Bitmap arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Drawable arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable String arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Uri arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable File arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Integer arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@Deprecated
@CheckResult
public GlideRequest<Drawable> load(@Nullable URL arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable byte[] arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Object arg0) {
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@@ -14,10 +15,14 @@
import com.bumptech.glide.request.RequestOptions;
import java.io.File;
import java.lang.Class;
import java.lang.Deprecated;
import java.lang.Integer;
import java.lang.Number;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.URL;

/**
* Includes all additions from methods in {@link com.bumptech.glide.annotation.GlideExtension}s
@@ -73,6 +78,55 @@ public GlideRequest<Drawable> asDrawable() {
return (GlideRequest<Drawable>) super.asDrawable();
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Bitmap arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Drawable arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable String arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Uri arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable File arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Integer arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@Deprecated
@CheckResult
public GlideRequest<Drawable> load(@Nullable URL arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable byte[] arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Object arg0) {
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@@ -14,10 +15,14 @@
import com.bumptech.glide.request.RequestOptions;
import java.io.File;
import java.lang.Class;
import java.lang.Deprecated;
import java.lang.Integer;
import java.lang.Number;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.URL;

/**
* Includes all additions from methods in {@link com.bumptech.glide.annotation.GlideExtension}s
@@ -75,6 +80,55 @@ public GlideRequest<Drawable> asDrawable() {
return (GlideRequest<Drawable>) super.asDrawable();
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Bitmap arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Drawable arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable String arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Uri arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable File arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Integer arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@Deprecated
@CheckResult
public GlideRequest<Drawable> load(@Nullable URL arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable byte[] arg0) {
return (GlideRequest<Drawable>) super.load(arg0);
}

@Override
@CheckResult
public GlideRequest<Drawable> load(@Nullable Object arg0) {

This file was deleted.

Loading

0 comments on commit 8613292

Please sign in to comment.