74 lines
2.3 KiB
Java
74 lines
2.3 KiB
Java
package com.bumptech.glide;
|
|
|
|
import android.content.Context;
|
|
import android.content.ContextWrapper;
|
|
import android.os.Handler;
|
|
import android.os.Looper;
|
|
import android.widget.ImageView;
|
|
import com.bumptech.glide.load.engine.Engine;
|
|
import com.bumptech.glide.load.engine.bitmap_recycle.ArrayPool;
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
import com.bumptech.glide.request.target.ImageViewTargetFactory;
|
|
import com.bumptech.glide.request.target.ViewTarget;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class GlideContext extends ContextWrapper {
|
|
static final TransitionOptions<?, ?> h = new GenericTransitionOptions();
|
|
private final ArrayPool a;
|
|
private final Registry b;
|
|
private final ImageViewTargetFactory c;
|
|
private final RequestOptions d;
|
|
private final Map<Class<?>, TransitionOptions<?, ?>> e;
|
|
private final Engine f;
|
|
private final int g;
|
|
|
|
public GlideContext(Context context, ArrayPool arrayPool, Registry registry, ImageViewTargetFactory imageViewTargetFactory, RequestOptions requestOptions, Map<Class<?>, TransitionOptions<?, ?>> map, Engine engine, int i) {
|
|
super(context.getApplicationContext());
|
|
this.a = arrayPool;
|
|
this.b = registry;
|
|
this.c = imageViewTargetFactory;
|
|
this.d = requestOptions;
|
|
this.e = map;
|
|
this.f = engine;
|
|
this.g = i;
|
|
new Handler(Looper.getMainLooper());
|
|
}
|
|
|
|
public <T> TransitionOptions<?, T> a(Class<T> cls) {
|
|
TransitionOptions<?, T> transitionOptions = (TransitionOptions) this.e.get(cls);
|
|
if (transitionOptions == null) {
|
|
for (Map.Entry<Class<?>, TransitionOptions<?, ?>> entry : this.e.entrySet()) {
|
|
if (entry.getKey().isAssignableFrom(cls)) {
|
|
transitionOptions = (TransitionOptions) entry.getValue();
|
|
}
|
|
}
|
|
}
|
|
return transitionOptions == null ? (TransitionOptions<?, T>) h : transitionOptions;
|
|
}
|
|
|
|
public RequestOptions b() {
|
|
return this.d;
|
|
}
|
|
|
|
public Engine c() {
|
|
return this.f;
|
|
}
|
|
|
|
public int d() {
|
|
return this.g;
|
|
}
|
|
|
|
public Registry e() {
|
|
return this.b;
|
|
}
|
|
|
|
public <X> ViewTarget<ImageView, X> a(ImageView imageView, Class<X> cls) {
|
|
return this.c.a(imageView, cls);
|
|
}
|
|
|
|
public ArrayPool a() {
|
|
return this.a;
|
|
}
|
|
}
|