mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-12-03 11:10:22 +01:00
239 lines
6.9 KiB
Java
239 lines
6.9 KiB
Java
package com.bumptech.glide.request;
|
|
|
|
import android.graphics.Bitmap;
|
|
import android.graphics.drawable.Drawable;
|
|
import androidx.annotation.CheckResult;
|
|
import androidx.annotation.DrawableRes;
|
|
import androidx.annotation.FloatRange;
|
|
import androidx.annotation.IntRange;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import com.bumptech.glide.Priority;
|
|
import com.bumptech.glide.load.DecodeFormat;
|
|
import com.bumptech.glide.load.Key;
|
|
import com.bumptech.glide.load.Option;
|
|
import com.bumptech.glide.load.Transformation;
|
|
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
|
import com.bumptech.glide.load.resource.bitmap.DownsampleStrategy;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes6.dex */
|
|
public class RequestOptions extends BaseRequestOptions<RequestOptions> {
|
|
|
|
@Nullable
|
|
private static RequestOptions centerCropOptions;
|
|
|
|
@Nullable
|
|
private static RequestOptions centerInsideOptions;
|
|
|
|
@Nullable
|
|
private static RequestOptions circleCropOptions;
|
|
|
|
@Nullable
|
|
private static RequestOptions fitCenterOptions;
|
|
|
|
@Nullable
|
|
private static RequestOptions noAnimationOptions;
|
|
|
|
@Nullable
|
|
private static RequestOptions noTransformOptions;
|
|
|
|
@Nullable
|
|
private static RequestOptions skipMemoryCacheFalseOptions;
|
|
|
|
@Nullable
|
|
private static RequestOptions skipMemoryCacheTrueOptions;
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions bitmapTransform(@NonNull Transformation<Bitmap> transformation) {
|
|
return new RequestOptions().transform(transformation);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions centerCropTransform() {
|
|
if (centerCropOptions == null) {
|
|
centerCropOptions = new RequestOptions().centerCrop().autoClone();
|
|
}
|
|
return centerCropOptions;
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions centerInsideTransform() {
|
|
if (centerInsideOptions == null) {
|
|
centerInsideOptions = new RequestOptions().centerInside().autoClone();
|
|
}
|
|
return centerInsideOptions;
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions circleCropTransform() {
|
|
if (circleCropOptions == null) {
|
|
circleCropOptions = new RequestOptions().circleCrop().autoClone();
|
|
}
|
|
return circleCropOptions;
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions decodeTypeOf(@NonNull Class<?> cls) {
|
|
return new RequestOptions().decode(cls);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions diskCacheStrategyOf(@NonNull DiskCacheStrategy diskCacheStrategy) {
|
|
return new RequestOptions().diskCacheStrategy(diskCacheStrategy);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions downsampleOf(@NonNull DownsampleStrategy downsampleStrategy) {
|
|
return new RequestOptions().downsample(downsampleStrategy);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions encodeFormatOf(@NonNull Bitmap.CompressFormat compressFormat) {
|
|
return new RequestOptions().encodeFormat(compressFormat);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions encodeQualityOf(@IntRange(from = 0, to = 100) int i) {
|
|
return new RequestOptions().encodeQuality(i);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions errorOf(@Nullable Drawable drawable) {
|
|
return new RequestOptions().error(drawable);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions fitCenterTransform() {
|
|
if (fitCenterOptions == null) {
|
|
fitCenterOptions = new RequestOptions().fitCenter().autoClone();
|
|
}
|
|
return fitCenterOptions;
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions formatOf(@NonNull DecodeFormat decodeFormat) {
|
|
return new RequestOptions().format(decodeFormat);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions frameOf(@IntRange(from = 0) long j) {
|
|
return new RequestOptions().frame(j);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions noAnimation() {
|
|
if (noAnimationOptions == null) {
|
|
noAnimationOptions = new RequestOptions().dontAnimate().autoClone();
|
|
}
|
|
return noAnimationOptions;
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions noTransformation() {
|
|
if (noTransformOptions == null) {
|
|
noTransformOptions = new RequestOptions().dontTransform().autoClone();
|
|
}
|
|
return noTransformOptions;
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static <T> RequestOptions option(@NonNull Option<T> option, @NonNull T t) {
|
|
return new RequestOptions().set(option, t);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions overrideOf(int i, int i2) {
|
|
return new RequestOptions().override(i, i2);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions placeholderOf(@Nullable Drawable drawable) {
|
|
return new RequestOptions().placeholder(drawable);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions priorityOf(@NonNull Priority priority) {
|
|
return new RequestOptions().priority(priority);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions signatureOf(@NonNull Key key) {
|
|
return new RequestOptions().signature(key);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions sizeMultiplierOf(@FloatRange(from = 0.0d, to = 1.0d) float f) {
|
|
return new RequestOptions().sizeMultiplier(f);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions skipMemoryCacheOf(boolean z) {
|
|
if (z) {
|
|
if (skipMemoryCacheTrueOptions == null) {
|
|
skipMemoryCacheTrueOptions = new RequestOptions().skipMemoryCache(true).autoClone();
|
|
}
|
|
return skipMemoryCacheTrueOptions;
|
|
}
|
|
if (skipMemoryCacheFalseOptions == null) {
|
|
skipMemoryCacheFalseOptions = new RequestOptions().skipMemoryCache(false).autoClone();
|
|
}
|
|
return skipMemoryCacheFalseOptions;
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions timeoutOf(@IntRange(from = 0) int i) {
|
|
return new RequestOptions().timeout(i);
|
|
}
|
|
|
|
@Override // com.bumptech.glide.request.BaseRequestOptions
|
|
public boolean equals(Object obj) {
|
|
return (obj instanceof RequestOptions) && super.equals(obj);
|
|
}
|
|
|
|
@Override // com.bumptech.glide.request.BaseRequestOptions
|
|
public int hashCode() {
|
|
return super.hashCode();
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions errorOf(@DrawableRes int i) {
|
|
return new RequestOptions().error(i);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions overrideOf(int i) {
|
|
return overrideOf(i, i);
|
|
}
|
|
|
|
@NonNull
|
|
@CheckResult
|
|
public static RequestOptions placeholderOf(@DrawableRes int i) {
|
|
return new RequestOptions().placeholder(i);
|
|
}
|
|
}
|