562 lines
16 KiB
Java
562 lines
16 KiB
Java
package com.bumptech.glide.request;
|
|
|
|
import android.content.res.Resources;
|
|
import android.graphics.Bitmap;
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
import android.graphics.drawable.Drawable;
|
|
import com.bumptech.glide.Priority;
|
|
import com.bumptech.glide.load.Key;
|
|
import com.bumptech.glide.load.Option;
|
|
import com.bumptech.glide.load.Options;
|
|
import com.bumptech.glide.load.Transformation;
|
|
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
|
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
|
import com.bumptech.glide.load.resource.bitmap.CenterInside;
|
|
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
|
import com.bumptech.glide.load.resource.bitmap.DownsampleStrategy;
|
|
import com.bumptech.glide.load.resource.bitmap.DrawableTransformation;
|
|
import com.bumptech.glide.load.resource.bitmap.FitCenter;
|
|
import com.bumptech.glide.load.resource.gif.GifDrawable;
|
|
import com.bumptech.glide.load.resource.gif.GifDrawableTransformation;
|
|
import com.bumptech.glide.signature.EmptySignature;
|
|
import com.bumptech.glide.util.CachedHashCodeArrayMap;
|
|
import com.bumptech.glide.util.Preconditions;
|
|
import com.bumptech.glide.util.Util;
|
|
import com.ijm.dataencryption.de.DataDecryptTool;
|
|
import com.ubt.jimu.base.util.FileUtil;
|
|
import com.ubt.jimu.unity.bluetooth.UnityActivity;
|
|
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class RequestOptions implements Cloneable {
|
|
private static RequestOptions B;
|
|
private static RequestOptions C;
|
|
private static RequestOptions D;
|
|
private boolean A;
|
|
private int a;
|
|
private Drawable e;
|
|
private int f;
|
|
private Drawable g;
|
|
private int h;
|
|
private boolean m;
|
|
private Drawable o;
|
|
private int p;
|
|
private boolean t;
|
|
private Resources.Theme u;
|
|
private boolean v;
|
|
private boolean x;
|
|
private boolean y;
|
|
private float b = 1.0f;
|
|
private DiskCacheStrategy c = DiskCacheStrategy.d;
|
|
private Priority d = Priority.NORMAL;
|
|
private boolean i = true;
|
|
private int j = -1;
|
|
private int k = -1;
|
|
private Key l = EmptySignature.a();
|
|
private boolean n = true;
|
|
private Options q = new Options();
|
|
private Map<Class<?>, Transformation<?>> r = new CachedHashCodeArrayMap();
|
|
private Class<?> s = Object.class;
|
|
private boolean z = true;
|
|
|
|
public static RequestOptions N() {
|
|
if (C == null) {
|
|
RequestOptions b = new RequestOptions().b();
|
|
b.a();
|
|
C = b;
|
|
}
|
|
return C;
|
|
}
|
|
|
|
public static RequestOptions O() {
|
|
if (D == null) {
|
|
RequestOptions h = new RequestOptions().h();
|
|
h.a();
|
|
D = h;
|
|
}
|
|
return D;
|
|
}
|
|
|
|
public static RequestOptions P() {
|
|
if (B == null) {
|
|
RequestOptions i = new RequestOptions().i();
|
|
i.a();
|
|
B = i;
|
|
}
|
|
return B;
|
|
}
|
|
|
|
private RequestOptions Q() {
|
|
if (this.t) {
|
|
throw new IllegalStateException("You cannot modify locked RequestOptions, consider clone()");
|
|
}
|
|
return this;
|
|
}
|
|
|
|
public static RequestOptions b(DiskCacheStrategy diskCacheStrategy) {
|
|
return new RequestOptions().a(diskCacheStrategy);
|
|
}
|
|
|
|
private static boolean b(int i, int i2) {
|
|
return (i & i2) != 0;
|
|
}
|
|
|
|
private RequestOptions c(DownsampleStrategy downsampleStrategy, Transformation<Bitmap> transformation) {
|
|
return a(downsampleStrategy, transformation, false);
|
|
}
|
|
|
|
private RequestOptions d(DownsampleStrategy downsampleStrategy, Transformation<Bitmap> transformation) {
|
|
return a(downsampleStrategy, transformation, true);
|
|
}
|
|
|
|
public final boolean A() {
|
|
return this.A;
|
|
}
|
|
|
|
public final boolean B() {
|
|
return this.x;
|
|
}
|
|
|
|
public final boolean C() {
|
|
return this.i;
|
|
}
|
|
|
|
public final boolean D() {
|
|
return c(8);
|
|
}
|
|
|
|
boolean E() {
|
|
return this.z;
|
|
}
|
|
|
|
public final boolean F() {
|
|
return this.n;
|
|
}
|
|
|
|
public final boolean G() {
|
|
return this.m;
|
|
}
|
|
|
|
public final boolean H() {
|
|
return c(2048);
|
|
}
|
|
|
|
public final boolean I() {
|
|
return Util.b(this.k, this.j);
|
|
}
|
|
|
|
public RequestOptions J() {
|
|
this.t = true;
|
|
return this;
|
|
}
|
|
|
|
public RequestOptions K() {
|
|
return a(DownsampleStrategy.b, new CenterCrop());
|
|
}
|
|
|
|
public RequestOptions L() {
|
|
return c(DownsampleStrategy.c, new CenterInside());
|
|
}
|
|
|
|
public RequestOptions M() {
|
|
return c(DownsampleStrategy.a, new FitCenter());
|
|
}
|
|
|
|
public RequestOptions a(float f) {
|
|
if (this.v) {
|
|
return m6clone().a(f);
|
|
}
|
|
if (f < 0.0f || f > 1.0f) {
|
|
throw new IllegalArgumentException("sizeMultiplier must be between 0 and 1");
|
|
}
|
|
this.b = f;
|
|
this.a |= 2;
|
|
Q();
|
|
return this;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (!(obj instanceof RequestOptions)) {
|
|
return false;
|
|
}
|
|
RequestOptions requestOptions = (RequestOptions) obj;
|
|
return Float.compare(requestOptions.b, this.b) == 0 && this.f == requestOptions.f && Util.b(this.e, requestOptions.e) && this.h == requestOptions.h && Util.b(this.g, requestOptions.g) && this.p == requestOptions.p && Util.b(this.o, requestOptions.o) && this.i == requestOptions.i && this.j == requestOptions.j && this.k == requestOptions.k && this.m == requestOptions.m && this.n == requestOptions.n && this.x == requestOptions.x && this.y == requestOptions.y && this.c.equals(requestOptions.c) && this.d == requestOptions.d && this.q.equals(requestOptions.q) && this.r.equals(requestOptions.r) && this.s.equals(requestOptions.s) && Util.b(this.l, requestOptions.l) && Util.b(this.u, requestOptions.u);
|
|
}
|
|
|
|
public RequestOptions h() {
|
|
return b(DownsampleStrategy.c, new CircleCrop());
|
|
}
|
|
|
|
public int hashCode() {
|
|
return Util.a(this.u, Util.a(this.l, Util.a(this.s, Util.a(this.r, Util.a(this.q, Util.a(this.d, Util.a(this.c, Util.a(this.y, Util.a(this.x, Util.a(this.n, Util.a(this.m, Util.a(this.k, Util.a(this.j, Util.a(this.i, Util.a(this.o, Util.a(this.p, Util.a(this.g, Util.a(this.h, Util.a(this.e, Util.a(this.f, Util.a(this.b)))))))))))))))))))));
|
|
}
|
|
|
|
public RequestOptions i() {
|
|
return d(DownsampleStrategy.a, new FitCenter());
|
|
}
|
|
|
|
public final DiskCacheStrategy j() {
|
|
return this.c;
|
|
}
|
|
|
|
public final int k() {
|
|
return this.f;
|
|
}
|
|
|
|
public final Drawable l() {
|
|
return this.e;
|
|
}
|
|
|
|
public final Drawable m() {
|
|
return this.o;
|
|
}
|
|
|
|
public final int n() {
|
|
return this.p;
|
|
}
|
|
|
|
public final boolean o() {
|
|
return this.y;
|
|
}
|
|
|
|
public final Options p() {
|
|
return this.q;
|
|
}
|
|
|
|
public final int q() {
|
|
return this.j;
|
|
}
|
|
|
|
public final int r() {
|
|
return this.k;
|
|
}
|
|
|
|
public final Drawable s() {
|
|
return this.g;
|
|
}
|
|
|
|
public final int t() {
|
|
return this.h;
|
|
}
|
|
|
|
public final Priority u() {
|
|
return this.d;
|
|
}
|
|
|
|
public final Class<?> v() {
|
|
return this.s;
|
|
}
|
|
|
|
public final Key w() {
|
|
return this.l;
|
|
}
|
|
|
|
public final float x() {
|
|
return this.b;
|
|
}
|
|
|
|
public final Resources.Theme y() {
|
|
return this.u;
|
|
}
|
|
|
|
public final Map<Class<?>, Transformation<?>> z() {
|
|
return this.r;
|
|
}
|
|
|
|
public static RequestOptions b(Key key) {
|
|
return new RequestOptions().a(key);
|
|
}
|
|
|
|
private boolean c(int i) {
|
|
return b(this.a, i);
|
|
}
|
|
|
|
/* renamed from: clone, reason: merged with bridge method [inline-methods] */
|
|
public RequestOptions m6clone() {
|
|
try {
|
|
RequestOptions requestOptions = (RequestOptions) super.clone();
|
|
requestOptions.q = new Options();
|
|
requestOptions.q.a(this.q);
|
|
requestOptions.r = new CachedHashCodeArrayMap();
|
|
requestOptions.r.putAll(this.r);
|
|
requestOptions.t = false;
|
|
requestOptions.v = false;
|
|
return requestOptions;
|
|
} catch (CloneNotSupportedException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
|
|
public static RequestOptions b(Transformation<Bitmap> transformation) {
|
|
return new RequestOptions().a(transformation);
|
|
}
|
|
|
|
public static RequestOptions b(Class<?> cls) {
|
|
return new RequestOptions().a(cls);
|
|
}
|
|
|
|
public RequestOptions b(boolean z) {
|
|
if (this.v) {
|
|
return m6clone().b(z);
|
|
}
|
|
this.A = z;
|
|
this.a |= 1048576;
|
|
Q();
|
|
return this;
|
|
}
|
|
|
|
public RequestOptions a(DiskCacheStrategy diskCacheStrategy) {
|
|
if (this.v) {
|
|
return m6clone().a(diskCacheStrategy);
|
|
}
|
|
Preconditions.a(diskCacheStrategy);
|
|
this.c = diskCacheStrategy;
|
|
this.a |= 4;
|
|
Q();
|
|
return this;
|
|
}
|
|
|
|
public RequestOptions b(int i) {
|
|
if (this.v) {
|
|
return m6clone().b(i);
|
|
}
|
|
this.h = i;
|
|
this.a |= PeripheralType.SERVO;
|
|
Q();
|
|
return this;
|
|
}
|
|
|
|
public RequestOptions a(Priority priority) {
|
|
if (this.v) {
|
|
return m6clone().a(priority);
|
|
}
|
|
Preconditions.a(priority);
|
|
this.d = priority;
|
|
this.a |= 8;
|
|
Q();
|
|
return this;
|
|
}
|
|
|
|
public RequestOptions b() {
|
|
return b(DownsampleStrategy.b, new CenterCrop());
|
|
}
|
|
|
|
final RequestOptions b(DownsampleStrategy downsampleStrategy, Transformation<Bitmap> transformation) {
|
|
if (this.v) {
|
|
return m6clone().b(downsampleStrategy, transformation);
|
|
}
|
|
a(downsampleStrategy);
|
|
return a(transformation);
|
|
}
|
|
|
|
public RequestOptions a(int i) {
|
|
if (this.v) {
|
|
return m6clone().a(i);
|
|
}
|
|
this.f = i;
|
|
this.a |= 32;
|
|
Q();
|
|
return this;
|
|
}
|
|
|
|
public RequestOptions a(boolean z) {
|
|
if (this.v) {
|
|
return m6clone().a(true);
|
|
}
|
|
this.i = !z;
|
|
this.a |= DataDecryptTool.DECRYPT_ALL_FILE;
|
|
Q();
|
|
return this;
|
|
}
|
|
|
|
public RequestOptions a(int i, int i2) {
|
|
if (this.v) {
|
|
return m6clone().a(i, i2);
|
|
}
|
|
this.k = i;
|
|
this.j = i2;
|
|
this.a |= DataDecryptTool.DECRYPT_DB_FILE;
|
|
Q();
|
|
return this;
|
|
}
|
|
|
|
public RequestOptions a(Key key) {
|
|
if (this.v) {
|
|
return m6clone().a(key);
|
|
}
|
|
Preconditions.a(key);
|
|
this.l = key;
|
|
this.a |= DataDecryptTool.DECRYPT_SP_FILE;
|
|
Q();
|
|
return this;
|
|
}
|
|
|
|
public <T> RequestOptions a(Option<T> option, T t) {
|
|
if (this.v) {
|
|
return m6clone().a((Option<Option<T>>) option, (Option<T>) t);
|
|
}
|
|
Preconditions.a(option);
|
|
Preconditions.a(t);
|
|
this.q.a(option, t);
|
|
Q();
|
|
return this;
|
|
}
|
|
|
|
public RequestOptions a(Class<?> cls) {
|
|
if (this.v) {
|
|
return m6clone().a(cls);
|
|
}
|
|
Preconditions.a(cls);
|
|
this.s = cls;
|
|
this.a |= FileUtil.ZIP_BUFFER_SIZE;
|
|
Q();
|
|
return this;
|
|
}
|
|
|
|
public RequestOptions a(DownsampleStrategy downsampleStrategy) {
|
|
Option<DownsampleStrategy> option = DownsampleStrategy.f;
|
|
Preconditions.a(downsampleStrategy);
|
|
return a((Option<Option<DownsampleStrategy>>) option, (Option<DownsampleStrategy>) downsampleStrategy);
|
|
}
|
|
|
|
final RequestOptions a(DownsampleStrategy downsampleStrategy, Transformation<Bitmap> transformation) {
|
|
if (this.v) {
|
|
return m6clone().a(downsampleStrategy, transformation);
|
|
}
|
|
a(downsampleStrategy);
|
|
return a(transformation, false);
|
|
}
|
|
|
|
private RequestOptions a(DownsampleStrategy downsampleStrategy, Transformation<Bitmap> transformation, boolean z) {
|
|
RequestOptions b = z ? b(downsampleStrategy, transformation) : a(downsampleStrategy, transformation);
|
|
b.z = true;
|
|
return b;
|
|
}
|
|
|
|
public RequestOptions a(Transformation<Bitmap> transformation) {
|
|
return a(transformation, true);
|
|
}
|
|
|
|
private RequestOptions a(Transformation<Bitmap> transformation, boolean z) {
|
|
if (this.v) {
|
|
return m6clone().a(transformation, z);
|
|
}
|
|
DrawableTransformation drawableTransformation = new DrawableTransformation(transformation, z);
|
|
a(Bitmap.class, transformation, z);
|
|
a(Drawable.class, drawableTransformation, z);
|
|
drawableTransformation.a();
|
|
a(BitmapDrawable.class, drawableTransformation, z);
|
|
a(GifDrawable.class, new GifDrawableTransformation(transformation), z);
|
|
Q();
|
|
return this;
|
|
}
|
|
|
|
private <T> RequestOptions a(Class<T> cls, Transformation<T> transformation, boolean z) {
|
|
if (this.v) {
|
|
return m6clone().a(cls, transformation, z);
|
|
}
|
|
Preconditions.a(cls);
|
|
Preconditions.a(transformation);
|
|
this.r.put(cls, transformation);
|
|
this.a |= 2048;
|
|
this.n = true;
|
|
this.a |= 65536;
|
|
this.z = false;
|
|
if (z) {
|
|
this.a |= 131072;
|
|
this.m = true;
|
|
}
|
|
Q();
|
|
return this;
|
|
}
|
|
|
|
public RequestOptions a(RequestOptions requestOptions) {
|
|
if (this.v) {
|
|
return m6clone().a(requestOptions);
|
|
}
|
|
if (b(requestOptions.a, 2)) {
|
|
this.b = requestOptions.b;
|
|
}
|
|
if (b(requestOptions.a, 262144)) {
|
|
this.x = requestOptions.x;
|
|
}
|
|
if (b(requestOptions.a, 1048576)) {
|
|
this.A = requestOptions.A;
|
|
}
|
|
if (b(requestOptions.a, 4)) {
|
|
this.c = requestOptions.c;
|
|
}
|
|
if (b(requestOptions.a, 8)) {
|
|
this.d = requestOptions.d;
|
|
}
|
|
if (b(requestOptions.a, 16)) {
|
|
this.e = requestOptions.e;
|
|
}
|
|
if (b(requestOptions.a, 32)) {
|
|
this.f = requestOptions.f;
|
|
}
|
|
if (b(requestOptions.a, 64)) {
|
|
this.g = requestOptions.g;
|
|
}
|
|
if (b(requestOptions.a, PeripheralType.SERVO)) {
|
|
this.h = requestOptions.h;
|
|
}
|
|
if (b(requestOptions.a, DataDecryptTool.DECRYPT_ALL_FILE)) {
|
|
this.i = requestOptions.i;
|
|
}
|
|
if (b(requestOptions.a, DataDecryptTool.DECRYPT_DB_FILE)) {
|
|
this.k = requestOptions.k;
|
|
this.j = requestOptions.j;
|
|
}
|
|
if (b(requestOptions.a, DataDecryptTool.DECRYPT_SP_FILE)) {
|
|
this.l = requestOptions.l;
|
|
}
|
|
if (b(requestOptions.a, FileUtil.ZIP_BUFFER_SIZE)) {
|
|
this.s = requestOptions.s;
|
|
}
|
|
if (b(requestOptions.a, UnityActivity.BLOCKLY_TYPE_NONE)) {
|
|
this.o = requestOptions.o;
|
|
}
|
|
if (b(requestOptions.a, 16384)) {
|
|
this.p = requestOptions.p;
|
|
}
|
|
if (b(requestOptions.a, 32768)) {
|
|
this.u = requestOptions.u;
|
|
}
|
|
if (b(requestOptions.a, 65536)) {
|
|
this.n = requestOptions.n;
|
|
}
|
|
if (b(requestOptions.a, 131072)) {
|
|
this.m = requestOptions.m;
|
|
}
|
|
if (b(requestOptions.a, 2048)) {
|
|
this.r.putAll(requestOptions.r);
|
|
this.z = requestOptions.z;
|
|
}
|
|
if (b(requestOptions.a, 524288)) {
|
|
this.y = requestOptions.y;
|
|
}
|
|
if (!this.n) {
|
|
this.r.clear();
|
|
this.a &= -2049;
|
|
this.m = false;
|
|
this.a &= -131073;
|
|
this.z = true;
|
|
}
|
|
this.a |= requestOptions.a;
|
|
this.q.a(requestOptions.q);
|
|
Q();
|
|
return this;
|
|
}
|
|
|
|
public RequestOptions a() {
|
|
if (this.t && !this.v) {
|
|
throw new IllegalStateException("You cannot auto lock an already locked options object, try clone() first");
|
|
}
|
|
this.v = true;
|
|
J();
|
|
return this;
|
|
}
|
|
}
|