Initial commit
This commit is contained in:
82
sources/com/bumptech/glide/load/model/AssetUriLoader.java
Normal file
82
sources/com/bumptech/glide/load/model/AssetUriLoader.java
Normal file
@@ -0,0 +1,82 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import android.content.res.AssetManager;
|
||||
import android.net.Uri;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.data.DataFetcher;
|
||||
import com.bumptech.glide.load.data.FileDescriptorAssetPathFetcher;
|
||||
import com.bumptech.glide.load.data.StreamAssetPathFetcher;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.signature.ObjectKey;
|
||||
import java.io.InputStream;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AssetUriLoader<Data> implements ModelLoader<Uri, Data> {
|
||||
private static final int c = 22;
|
||||
private final AssetManager a;
|
||||
private final AssetFetcherFactory<Data> b;
|
||||
|
||||
public interface AssetFetcherFactory<Data> {
|
||||
DataFetcher<Data> a(AssetManager assetManager, String str);
|
||||
}
|
||||
|
||||
public static class FileDescriptorFactory implements ModelLoaderFactory<Uri, ParcelFileDescriptor>, AssetFetcherFactory<ParcelFileDescriptor> {
|
||||
private final AssetManager a;
|
||||
|
||||
public FileDescriptorFactory(AssetManager assetManager) {
|
||||
this.a = assetManager;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Uri, ParcelFileDescriptor> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new AssetUriLoader(this.a, this);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.AssetUriLoader.AssetFetcherFactory
|
||||
public DataFetcher<ParcelFileDescriptor> a(AssetManager assetManager, String str) {
|
||||
return new FileDescriptorAssetPathFetcher(assetManager, str);
|
||||
}
|
||||
}
|
||||
|
||||
public static class StreamFactory implements ModelLoaderFactory<Uri, InputStream>, AssetFetcherFactory<InputStream> {
|
||||
private final AssetManager a;
|
||||
|
||||
public StreamFactory(AssetManager assetManager) {
|
||||
this.a = assetManager;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Uri, InputStream> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new AssetUriLoader(this.a, this);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.AssetUriLoader.AssetFetcherFactory
|
||||
public DataFetcher<InputStream> a(AssetManager assetManager, String str) {
|
||||
return new StreamAssetPathFetcher(assetManager, str);
|
||||
}
|
||||
}
|
||||
|
||||
public AssetUriLoader(AssetManager assetManager, AssetFetcherFactory<Data> assetFetcherFactory) {
|
||||
this.a = assetManager;
|
||||
this.b = assetFetcherFactory;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<Data> a(Uri uri, int i, int i2, Options options) {
|
||||
return new ModelLoader.LoadData<>(new ObjectKey(uri), this.b.a(this.a, uri.toString().substring(c)));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(Uri uri) {
|
||||
return "file".equals(uri.getScheme()) && !uri.getPathSegments().isEmpty() && "android_asset".equals(uri.getPathSegments().get(0));
|
||||
}
|
||||
}
|
112
sources/com/bumptech/glide/load/model/ByteArrayLoader.java
Normal file
112
sources/com/bumptech/glide/load/model/ByteArrayLoader.java
Normal file
@@ -0,0 +1,112 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import com.bumptech.glide.Priority;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.data.DataFetcher;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.signature.ObjectKey;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ByteArrayLoader<Data> implements ModelLoader<byte[], Data> {
|
||||
private final Converter<Data> a;
|
||||
|
||||
public static class ByteBufferFactory implements ModelLoaderFactory<byte[], ByteBuffer> {
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<byte[], ByteBuffer> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new ByteArrayLoader(new Converter<ByteBuffer>(this) { // from class: com.bumptech.glide.load.model.ByteArrayLoader.ByteBufferFactory.1
|
||||
@Override // com.bumptech.glide.load.model.ByteArrayLoader.Converter
|
||||
public ByteBuffer a(byte[] bArr) {
|
||||
return ByteBuffer.wrap(bArr);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ByteArrayLoader.Converter
|
||||
public Class<ByteBuffer> a() {
|
||||
return ByteBuffer.class;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public interface Converter<Data> {
|
||||
Class<Data> a();
|
||||
|
||||
Data a(byte[] bArr);
|
||||
}
|
||||
|
||||
public static class StreamFactory implements ModelLoaderFactory<byte[], InputStream> {
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<byte[], InputStream> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new ByteArrayLoader(new Converter<InputStream>(this) { // from class: com.bumptech.glide.load.model.ByteArrayLoader.StreamFactory.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // com.bumptech.glide.load.model.ByteArrayLoader.Converter
|
||||
public InputStream a(byte[] bArr) {
|
||||
return new ByteArrayInputStream(bArr);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ByteArrayLoader.Converter
|
||||
public Class<InputStream> a() {
|
||||
return InputStream.class;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public ByteArrayLoader(Converter<Data> converter) {
|
||||
this.a = converter;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(byte[] bArr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
private static class Fetcher<Data> implements DataFetcher<Data> {
|
||||
private final byte[] a;
|
||||
private final Converter<Data> b;
|
||||
|
||||
Fetcher(byte[] bArr, Converter<Data> converter) {
|
||||
this.a = bArr;
|
||||
this.b = converter;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void a(Priority priority, DataFetcher.DataCallback<? super Data> dataCallback) {
|
||||
dataCallback.a((DataFetcher.DataCallback<? super Data>) this.b.a(this.a));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void b() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void cancel() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public DataSource getDataSource() {
|
||||
return DataSource.LOCAL;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public Class<Data> a() {
|
||||
return this.b.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<Data> a(byte[] bArr, int i, int i2, Options options) {
|
||||
return new ModelLoader.LoadData<>(new ObjectKey(bArr), new Fetcher(bArr, this.a));
|
||||
}
|
||||
}
|
25
sources/com/bumptech/glide/load/model/ByteBufferEncoder.java
Normal file
25
sources/com/bumptech/glide/load/model/ByteBufferEncoder.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import android.util.Log;
|
||||
import com.bumptech.glide.load.Encoder;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.util.ByteBufferUtil;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ByteBufferEncoder implements Encoder<ByteBuffer> {
|
||||
@Override // com.bumptech.glide.load.Encoder
|
||||
public boolean a(ByteBuffer byteBuffer, File file, Options options) {
|
||||
try {
|
||||
ByteBufferUtil.a(byteBuffer, file);
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
if (Log.isLoggable("ByteBufferEncoder", 3)) {
|
||||
Log.d("ByteBufferEncoder", "Failed to write data", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,76 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import android.util.Log;
|
||||
import com.bumptech.glide.Priority;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.data.DataFetcher;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.signature.ObjectKey;
|
||||
import com.bumptech.glide.util.ByteBufferUtil;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ByteBufferFileLoader implements ModelLoader<File, ByteBuffer> {
|
||||
|
||||
public static class Factory implements ModelLoaderFactory<File, ByteBuffer> {
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<File, ByteBuffer> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new ByteBufferFileLoader();
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(File file) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<ByteBuffer> a(File file, int i, int i2, Options options) {
|
||||
return new ModelLoader.LoadData<>(new ObjectKey(file), new ByteBufferFetcher(file));
|
||||
}
|
||||
|
||||
private static final class ByteBufferFetcher implements DataFetcher<ByteBuffer> {
|
||||
private final File a;
|
||||
|
||||
ByteBufferFetcher(File file) {
|
||||
this.a = file;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void a(Priority priority, DataFetcher.DataCallback<? super ByteBuffer> dataCallback) {
|
||||
try {
|
||||
dataCallback.a((DataFetcher.DataCallback<? super ByteBuffer>) ByteBufferUtil.a(this.a));
|
||||
} catch (IOException e) {
|
||||
if (Log.isLoggable("ByteBufferFileLoader", 3)) {
|
||||
Log.d("ByteBufferFileLoader", "Failed to obtain ByteBuffer for file", e);
|
||||
}
|
||||
dataCallback.a((Exception) e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void b() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void cancel() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public DataSource getDataSource() {
|
||||
return DataSource.LOCAL;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public Class<ByteBuffer> a() {
|
||||
return ByteBuffer.class;
|
||||
}
|
||||
}
|
||||
}
|
121
sources/com/bumptech/glide/load/model/DataUrlLoader.java
Normal file
121
sources/com/bumptech/glide/load/model/DataUrlLoader.java
Normal file
@@ -0,0 +1,121 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import android.util.Base64;
|
||||
import com.bumptech.glide.Priority;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.data.DataFetcher;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.signature.ObjectKey;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class DataUrlLoader<Model, Data> implements ModelLoader<Model, Data> {
|
||||
private final DataDecoder<Data> a;
|
||||
|
||||
public interface DataDecoder<Data> {
|
||||
Class<Data> a();
|
||||
|
||||
void a(Data data) throws IOException;
|
||||
|
||||
Data decode(String str) throws IllegalArgumentException;
|
||||
}
|
||||
|
||||
public static final class StreamFactory<Model> implements ModelLoaderFactory<Model, InputStream> {
|
||||
private final DataDecoder<InputStream> a = new DataDecoder<InputStream>(this) { // from class: com.bumptech.glide.load.model.DataUrlLoader.StreamFactory.1
|
||||
@Override // com.bumptech.glide.load.model.DataUrlLoader.DataDecoder
|
||||
public void a(InputStream inputStream) throws IOException {
|
||||
inputStream.close();
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // com.bumptech.glide.load.model.DataUrlLoader.DataDecoder
|
||||
public InputStream decode(String str) {
|
||||
if (!str.startsWith("data:image")) {
|
||||
throw new IllegalArgumentException("Not a valid image data URL.");
|
||||
}
|
||||
int indexOf = str.indexOf(44);
|
||||
if (indexOf == -1) {
|
||||
throw new IllegalArgumentException("Missing comma in data URL.");
|
||||
}
|
||||
if (str.substring(0, indexOf).endsWith(";base64")) {
|
||||
return new ByteArrayInputStream(Base64.decode(str.substring(indexOf + 1), 0));
|
||||
}
|
||||
throw new IllegalArgumentException("Not a base64 image data URL.");
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.DataUrlLoader.DataDecoder
|
||||
public Class<InputStream> a() {
|
||||
return InputStream.class;
|
||||
}
|
||||
};
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Model, InputStream> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new DataUrlLoader(this.a);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public DataUrlLoader(DataDecoder<Data> dataDecoder) {
|
||||
this.a = dataDecoder;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<Data> a(Model model, int i, int i2, Options options) {
|
||||
return new ModelLoader.LoadData<>(new ObjectKey(model), new DataUriFetcher(model.toString(), this.a));
|
||||
}
|
||||
|
||||
private static final class DataUriFetcher<Data> implements DataFetcher<Data> {
|
||||
private final String a;
|
||||
private final DataDecoder<Data> b;
|
||||
private Data c;
|
||||
|
||||
DataUriFetcher(String str, DataDecoder<Data> dataDecoder) {
|
||||
this.a = str;
|
||||
this.b = dataDecoder;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void a(Priority priority, DataFetcher.DataCallback<? super Data> dataCallback) {
|
||||
try {
|
||||
this.c = this.b.decode(this.a);
|
||||
dataCallback.a((DataFetcher.DataCallback<? super Data>) this.c);
|
||||
} catch (IllegalArgumentException e) {
|
||||
dataCallback.a((Exception) e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void b() {
|
||||
try {
|
||||
this.b.a(this.c);
|
||||
} catch (IOException unused) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void cancel() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public DataSource getDataSource() {
|
||||
return DataSource.LOCAL;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public Class<Data> a() {
|
||||
return this.b.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(Model model) {
|
||||
return model.toString().startsWith("data:image");
|
||||
}
|
||||
}
|
152
sources/com/bumptech/glide/load/model/FileLoader.java
Normal file
152
sources/com/bumptech/glide/load/model/FileLoader.java
Normal file
@@ -0,0 +1,152 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.util.Log;
|
||||
import com.bumptech.glide.Priority;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.data.DataFetcher;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.signature.ObjectKey;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class FileLoader<Data> implements ModelLoader<File, Data> {
|
||||
private final FileOpener<Data> a;
|
||||
|
||||
public static class Factory<Data> implements ModelLoaderFactory<File, Data> {
|
||||
private final FileOpener<Data> a;
|
||||
|
||||
public Factory(FileOpener<Data> fileOpener) {
|
||||
this.a = fileOpener;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public final ModelLoader<File, Data> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new FileLoader(this.a);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public final void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public static class FileDescriptorFactory extends Factory<ParcelFileDescriptor> {
|
||||
public FileDescriptorFactory() {
|
||||
super(new FileOpener<ParcelFileDescriptor>() { // from class: com.bumptech.glide.load.model.FileLoader.FileDescriptorFactory.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // com.bumptech.glide.load.model.FileLoader.FileOpener
|
||||
public ParcelFileDescriptor a(File file) throws FileNotFoundException {
|
||||
return ParcelFileDescriptor.open(file, 268435456);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.FileLoader.FileOpener
|
||||
public void a(ParcelFileDescriptor parcelFileDescriptor) throws IOException {
|
||||
parcelFileDescriptor.close();
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.FileLoader.FileOpener
|
||||
public Class<ParcelFileDescriptor> a() {
|
||||
return ParcelFileDescriptor.class;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public interface FileOpener<Data> {
|
||||
Class<Data> a();
|
||||
|
||||
Data a(File file) throws FileNotFoundException;
|
||||
|
||||
void a(Data data) throws IOException;
|
||||
}
|
||||
|
||||
public static class StreamFactory extends Factory<InputStream> {
|
||||
public StreamFactory() {
|
||||
super(new FileOpener<InputStream>() { // from class: com.bumptech.glide.load.model.FileLoader.StreamFactory.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // com.bumptech.glide.load.model.FileLoader.FileOpener
|
||||
public InputStream a(File file) throws FileNotFoundException {
|
||||
return new FileInputStream(file);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.FileLoader.FileOpener
|
||||
public void a(InputStream inputStream) throws IOException {
|
||||
inputStream.close();
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.FileLoader.FileOpener
|
||||
public Class<InputStream> a() {
|
||||
return InputStream.class;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public FileLoader(FileOpener<Data> fileOpener) {
|
||||
this.a = fileOpener;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(File file) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<Data> a(File file, int i, int i2, Options options) {
|
||||
return new ModelLoader.LoadData<>(new ObjectKey(file), new FileFetcher(file, this.a));
|
||||
}
|
||||
|
||||
private static final class FileFetcher<Data> implements DataFetcher<Data> {
|
||||
private final File a;
|
||||
private final FileOpener<Data> b;
|
||||
private Data c;
|
||||
|
||||
FileFetcher(File file, FileOpener<Data> fileOpener) {
|
||||
this.a = file;
|
||||
this.b = fileOpener;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void a(Priority priority, DataFetcher.DataCallback<? super Data> dataCallback) {
|
||||
try {
|
||||
this.c = this.b.a(this.a);
|
||||
dataCallback.a((DataFetcher.DataCallback<? super Data>) this.c);
|
||||
} catch (FileNotFoundException e) {
|
||||
if (Log.isLoggable("FileLoader", 3)) {
|
||||
Log.d("FileLoader", "Failed to open file", e);
|
||||
}
|
||||
dataCallback.a((Exception) e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void b() {
|
||||
Data data = this.c;
|
||||
if (data != null) {
|
||||
try {
|
||||
this.b.a((FileOpener<Data>) data);
|
||||
} catch (IOException unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void cancel() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public DataSource getDataSource() {
|
||||
return DataSource.LOCAL;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public Class<Data> a() {
|
||||
return this.b.a();
|
||||
}
|
||||
}
|
||||
}
|
121
sources/com/bumptech/glide/load/model/GlideUrl.java
Normal file
121
sources/com/bumptech/glide/load/model/GlideUrl.java
Normal file
@@ -0,0 +1,121 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import com.bumptech.glide.load.Key;
|
||||
import com.bumptech.glide.util.Preconditions;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GlideUrl implements Key {
|
||||
private final Headers b;
|
||||
private final URL c;
|
||||
private final String d;
|
||||
private String e;
|
||||
private URL f;
|
||||
private volatile byte[] g;
|
||||
private int h;
|
||||
|
||||
public GlideUrl(URL url) {
|
||||
this(url, Headers.a);
|
||||
}
|
||||
|
||||
private byte[] e() {
|
||||
if (this.g == null) {
|
||||
this.g = a().getBytes(Key.a);
|
||||
}
|
||||
return this.g;
|
||||
}
|
||||
|
||||
private String f() {
|
||||
if (TextUtils.isEmpty(this.e)) {
|
||||
String str = this.d;
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
URL url = this.c;
|
||||
Preconditions.a(url);
|
||||
str = url.toString();
|
||||
}
|
||||
this.e = Uri.encode(str, "@#&=*+-_.,:!?()/~'%;$");
|
||||
}
|
||||
return this.e;
|
||||
}
|
||||
|
||||
private URL g() throws MalformedURLException {
|
||||
if (this.f == null) {
|
||||
this.f = new URL(f());
|
||||
}
|
||||
return this.f;
|
||||
}
|
||||
|
||||
public String a() {
|
||||
String str = this.d;
|
||||
if (str != null) {
|
||||
return str;
|
||||
}
|
||||
URL url = this.c;
|
||||
Preconditions.a(url);
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
public Map<String, String> b() {
|
||||
return this.b.a();
|
||||
}
|
||||
|
||||
public String c() {
|
||||
return f();
|
||||
}
|
||||
|
||||
public URL d() throws MalformedURLException {
|
||||
return g();
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.Key
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof GlideUrl)) {
|
||||
return false;
|
||||
}
|
||||
GlideUrl glideUrl = (GlideUrl) obj;
|
||||
return a().equals(glideUrl.a()) && this.b.equals(glideUrl.b);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.Key
|
||||
public int hashCode() {
|
||||
if (this.h == 0) {
|
||||
this.h = a().hashCode();
|
||||
this.h = (this.h * 31) + this.b.hashCode();
|
||||
}
|
||||
return this.h;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return a();
|
||||
}
|
||||
|
||||
public GlideUrl(String str) {
|
||||
this(str, Headers.a);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.Key
|
||||
public void a(MessageDigest messageDigest) {
|
||||
messageDigest.update(e());
|
||||
}
|
||||
|
||||
public GlideUrl(URL url, Headers headers) {
|
||||
Preconditions.a(url);
|
||||
this.c = url;
|
||||
this.d = null;
|
||||
Preconditions.a(headers);
|
||||
this.b = headers;
|
||||
}
|
||||
|
||||
public GlideUrl(String str, Headers headers) {
|
||||
this.c = null;
|
||||
Preconditions.a(str);
|
||||
this.d = str;
|
||||
Preconditions.a(headers);
|
||||
this.b = headers;
|
||||
}
|
||||
}
|
22
sources/com/bumptech/glide/load/model/Headers.java
Normal file
22
sources/com/bumptech/glide/load/model/Headers.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import com.bumptech.glide.load.model.LazyHeaders;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface Headers {
|
||||
public static final Headers a;
|
||||
|
||||
static {
|
||||
new Headers() { // from class: com.bumptech.glide.load.model.Headers.1
|
||||
@Override // com.bumptech.glide.load.model.Headers
|
||||
public Map<String, String> a() {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
};
|
||||
a = new LazyHeaders.Builder().a();
|
||||
}
|
||||
|
||||
Map<String, String> a();
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface LazyHeaderFactory {
|
||||
String a();
|
||||
}
|
134
sources/com/bumptech/glide/load/model/LazyHeaders.java
Normal file
134
sources/com/bumptech/glide/load/model/LazyHeaders.java
Normal file
@@ -0,0 +1,134 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class LazyHeaders implements Headers {
|
||||
private final Map<String, List<LazyHeaderFactory>> b;
|
||||
private volatile Map<String, String> c;
|
||||
|
||||
public static final class Builder {
|
||||
private static final String b = b();
|
||||
private static final Map<String, List<LazyHeaderFactory>> c;
|
||||
private Map<String, List<LazyHeaderFactory>> a = c;
|
||||
|
||||
static {
|
||||
HashMap hashMap = new HashMap(2);
|
||||
if (!TextUtils.isEmpty(b)) {
|
||||
hashMap.put("User-Agent", Collections.singletonList(new StringHeaderFactory(b)));
|
||||
}
|
||||
c = Collections.unmodifiableMap(hashMap);
|
||||
}
|
||||
|
||||
static String b() {
|
||||
String property = System.getProperty("http.agent");
|
||||
if (TextUtils.isEmpty(property)) {
|
||||
return property;
|
||||
}
|
||||
int length = property.length();
|
||||
StringBuilder sb = new StringBuilder(property.length());
|
||||
for (int i = 0; i < length; i++) {
|
||||
char charAt = property.charAt(i);
|
||||
if ((charAt > 31 || charAt == '\t') && charAt < 127) {
|
||||
sb.append(charAt);
|
||||
} else {
|
||||
sb.append('?');
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public LazyHeaders a() {
|
||||
return new LazyHeaders(this.a);
|
||||
}
|
||||
}
|
||||
|
||||
static final class StringHeaderFactory implements LazyHeaderFactory {
|
||||
private final String a;
|
||||
|
||||
StringHeaderFactory(String str) {
|
||||
this.a = str;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.LazyHeaderFactory
|
||||
public String a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof StringHeaderFactory) {
|
||||
return this.a.equals(((StringHeaderFactory) obj).a);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.a.hashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "StringHeaderFactory{value='" + this.a + "'}";
|
||||
}
|
||||
}
|
||||
|
||||
LazyHeaders(Map<String, List<LazyHeaderFactory>> map) {
|
||||
this.b = Collections.unmodifiableMap(map);
|
||||
}
|
||||
|
||||
private Map<String, String> b() {
|
||||
HashMap hashMap = new HashMap();
|
||||
for (Map.Entry<String, List<LazyHeaderFactory>> entry : this.b.entrySet()) {
|
||||
String a = a(entry.getValue());
|
||||
if (!TextUtils.isEmpty(a)) {
|
||||
hashMap.put(entry.getKey(), a);
|
||||
}
|
||||
}
|
||||
return hashMap;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.Headers
|
||||
public Map<String, String> a() {
|
||||
if (this.c == null) {
|
||||
synchronized (this) {
|
||||
if (this.c == null) {
|
||||
this.c = Collections.unmodifiableMap(b());
|
||||
}
|
||||
}
|
||||
}
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof LazyHeaders) {
|
||||
return this.b.equals(((LazyHeaders) obj).b);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.b.hashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "LazyHeaders{headers=" + this.b + '}';
|
||||
}
|
||||
|
||||
private String a(List<LazyHeaderFactory> list) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int size = list.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
String a = list.get(i).a();
|
||||
if (!TextUtils.isEmpty(a)) {
|
||||
sb.append(a);
|
||||
if (i != list.size() - 1) {
|
||||
sb.append(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@@ -0,0 +1,97 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import com.bumptech.glide.Priority;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.data.DataFetcher;
|
||||
import com.bumptech.glide.load.data.mediastore.MediaStoreUtil;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.signature.ObjectKey;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class MediaStoreFileLoader implements ModelLoader<Uri, File> {
|
||||
private final Context a;
|
||||
|
||||
public static final class Factory implements ModelLoaderFactory<Uri, File> {
|
||||
private final Context a;
|
||||
|
||||
public Factory(Context context) {
|
||||
this.a = context;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Uri, File> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new MediaStoreFileLoader(this.a);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public MediaStoreFileLoader(Context context) {
|
||||
this.a = context;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<File> a(Uri uri, int i, int i2, Options options) {
|
||||
return new ModelLoader.LoadData<>(new ObjectKey(uri), new FilePathFetcher(this.a, uri));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(Uri uri) {
|
||||
return MediaStoreUtil.b(uri);
|
||||
}
|
||||
|
||||
private static class FilePathFetcher implements DataFetcher<File> {
|
||||
private static final String[] c = {"_data"};
|
||||
private final Context a;
|
||||
private final Uri b;
|
||||
|
||||
FilePathFetcher(Context context, Uri uri) {
|
||||
this.a = context;
|
||||
this.b = uri;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void a(Priority priority, DataFetcher.DataCallback<? super File> dataCallback) {
|
||||
Cursor query = this.a.getContentResolver().query(this.b, c, null, null, null);
|
||||
if (query != null) {
|
||||
try {
|
||||
r0 = query.moveToFirst() ? query.getString(query.getColumnIndexOrThrow("_data")) : null;
|
||||
} finally {
|
||||
query.close();
|
||||
}
|
||||
}
|
||||
if (!TextUtils.isEmpty(r0)) {
|
||||
dataCallback.a((DataFetcher.DataCallback<? super File>) new File(r0));
|
||||
return;
|
||||
}
|
||||
dataCallback.a((Exception) new FileNotFoundException("Failed to find file path for: " + this.b));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void b() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void cancel() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public DataSource getDataSource() {
|
||||
return DataSource.LOCAL;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public Class<File> a() {
|
||||
return File.class;
|
||||
}
|
||||
}
|
||||
}
|
6
sources/com/bumptech/glide/load/model/Model.java
Normal file
6
sources/com/bumptech/glide/load/model/Model.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface Model {
|
||||
boolean a(Object obj);
|
||||
}
|
80
sources/com/bumptech/glide/load/model/ModelCache.java
Normal file
80
sources/com/bumptech/glide/load/model/ModelCache.java
Normal file
@@ -0,0 +1,80 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import com.bumptech.glide.util.LruCache;
|
||||
import com.bumptech.glide.util.Util;
|
||||
import java.util.Queue;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ModelCache<A, B> {
|
||||
private final LruCache<ModelKey<A>, B> a;
|
||||
|
||||
public ModelCache(long j) {
|
||||
this.a = new LruCache<ModelKey<A>, B>(this, j) { // from class: com.bumptech.glide.load.model.ModelCache.1
|
||||
@Override // com.bumptech.glide.util.LruCache
|
||||
protected /* bridge */ /* synthetic */ void a(Object obj, Object obj2) {
|
||||
a((ModelKey) obj, (ModelKey<A>) obj2);
|
||||
}
|
||||
|
||||
protected void a(ModelKey<A> modelKey, B b) {
|
||||
modelKey.a();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public B a(A a, int i, int i2) {
|
||||
ModelKey<A> a2 = ModelKey.a(a, i, i2);
|
||||
B a3 = this.a.a((LruCache<ModelKey<A>, B>) a2);
|
||||
a2.a();
|
||||
return a3;
|
||||
}
|
||||
|
||||
public void a(A a, int i, int i2, B b) {
|
||||
this.a.b(ModelKey.a(a, i, i2), b);
|
||||
}
|
||||
|
||||
static final class ModelKey<A> {
|
||||
private static final Queue<ModelKey<?>> d = Util.a(0);
|
||||
private int a;
|
||||
private int b;
|
||||
private A c;
|
||||
|
||||
private ModelKey() {
|
||||
}
|
||||
|
||||
static <A> ModelKey<A> a(A a, int i, int i2) {
|
||||
ModelKey<A> modelKey;
|
||||
synchronized (d) {
|
||||
modelKey = (ModelKey) d.poll();
|
||||
}
|
||||
if (modelKey == null) {
|
||||
modelKey = new ModelKey<>();
|
||||
}
|
||||
modelKey.b(a, i, i2);
|
||||
return modelKey;
|
||||
}
|
||||
|
||||
private void b(A a, int i, int i2) {
|
||||
this.c = a;
|
||||
this.b = i;
|
||||
this.a = i2;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof ModelKey)) {
|
||||
return false;
|
||||
}
|
||||
ModelKey modelKey = (ModelKey) obj;
|
||||
return this.b == modelKey.b && this.a == modelKey.a && this.c.equals(modelKey.c);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return (((this.a * 31) + this.b) * 31) + this.c.hashCode();
|
||||
}
|
||||
|
||||
public void a() {
|
||||
synchronized (d) {
|
||||
d.offer(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
35
sources/com/bumptech/glide/load/model/ModelLoader.java
Normal file
35
sources/com/bumptech/glide/load/model/ModelLoader.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import com.bumptech.glide.load.Key;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.data.DataFetcher;
|
||||
import com.bumptech.glide.util.Preconditions;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ModelLoader<Model, Data> {
|
||||
|
||||
public static class LoadData<Data> {
|
||||
public final Key a;
|
||||
public final List<Key> b;
|
||||
public final DataFetcher<Data> c;
|
||||
|
||||
public LoadData(Key key, DataFetcher<Data> dataFetcher) {
|
||||
this(key, Collections.emptyList(), dataFetcher);
|
||||
}
|
||||
|
||||
public LoadData(Key key, List<Key> list, DataFetcher<Data> dataFetcher) {
|
||||
Preconditions.a(key);
|
||||
this.a = key;
|
||||
Preconditions.a(list);
|
||||
this.b = list;
|
||||
Preconditions.a(dataFetcher);
|
||||
this.c = dataFetcher;
|
||||
}
|
||||
}
|
||||
|
||||
LoadData<Data> a(Model model, int i, int i2, Options options);
|
||||
|
||||
boolean a(Model model);
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ModelLoaderFactory<T, Y> {
|
||||
ModelLoader<T, Y> a(MultiModelLoaderFactory multiModelLoaderFactory);
|
||||
|
||||
void a();
|
||||
}
|
107
sources/com/bumptech/glide/load/model/ModelLoaderRegistry.java
Normal file
107
sources/com/bumptech/glide/load/model/ModelLoaderRegistry.java
Normal file
@@ -0,0 +1,107 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import androidx.core.util.Pools$Pool;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ModelLoaderRegistry {
|
||||
private final MultiModelLoaderFactory a;
|
||||
private final ModelLoaderCache b;
|
||||
|
||||
private static class ModelLoaderCache {
|
||||
private final Map<Class<?>, Entry<?>> a = new HashMap();
|
||||
|
||||
private static class Entry<Model> {
|
||||
final List<ModelLoader<Model, ?>> a;
|
||||
|
||||
public Entry(List<ModelLoader<Model, ?>> list) {
|
||||
this.a = list;
|
||||
}
|
||||
}
|
||||
|
||||
ModelLoaderCache() {
|
||||
}
|
||||
|
||||
public void a() {
|
||||
this.a.clear();
|
||||
}
|
||||
|
||||
public <Model> void a(Class<Model> cls, List<ModelLoader<Model, ?>> list) {
|
||||
if (this.a.put(cls, new Entry<>(list)) == null) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalStateException("Already cached loaders for model: " + cls);
|
||||
}
|
||||
|
||||
public <Model> List<ModelLoader<Model, ?>> a(Class<Model> cls) {
|
||||
Entry<?> entry = this.a.get(cls);
|
||||
if (entry == null) {
|
||||
return null;
|
||||
}
|
||||
return (List<ModelLoader<Model, ?>>) entry.a;
|
||||
}
|
||||
}
|
||||
|
||||
public ModelLoaderRegistry(Pools$Pool<List<Throwable>> pools$Pool) {
|
||||
this(new MultiModelLoaderFactory(pools$Pool));
|
||||
}
|
||||
|
||||
public synchronized <Model, Data> void a(Class<Model> cls, Class<Data> cls2, ModelLoaderFactory<? extends Model, ? extends Data> modelLoaderFactory) {
|
||||
this.a.a(cls, cls2, modelLoaderFactory);
|
||||
this.b.a();
|
||||
}
|
||||
|
||||
public synchronized <Model, Data> void b(Class<Model> cls, Class<Data> cls2, ModelLoaderFactory<? extends Model, ? extends Data> modelLoaderFactory) {
|
||||
a((List) this.a.b(cls, cls2, modelLoaderFactory));
|
||||
this.b.a();
|
||||
}
|
||||
|
||||
private ModelLoaderRegistry(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
this.b = new ModelLoaderCache();
|
||||
this.a = multiModelLoaderFactory;
|
||||
}
|
||||
|
||||
private <Model, Data> void a(List<ModelLoaderFactory<? extends Model, ? extends Data>> list) {
|
||||
Iterator<ModelLoaderFactory<? extends Model, ? extends Data>> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a();
|
||||
}
|
||||
}
|
||||
|
||||
private <A> List<ModelLoader<A, ?>> b(Class<A> cls) {
|
||||
List<ModelLoader<A, ?>> a = this.b.a(cls);
|
||||
if (a != null) {
|
||||
return a;
|
||||
}
|
||||
List<ModelLoader<A, ?>> unmodifiableList = Collections.unmodifiableList(this.a.a(cls));
|
||||
this.b.a(cls, unmodifiableList);
|
||||
return unmodifiableList;
|
||||
}
|
||||
|
||||
public synchronized <A> List<ModelLoader<A, ?>> a(A a) {
|
||||
ArrayList arrayList;
|
||||
List<ModelLoader<A, ?>> b = b((Class) b(a));
|
||||
int size = b.size();
|
||||
arrayList = new ArrayList(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
ModelLoader<A, ?> modelLoader = b.get(i);
|
||||
if (modelLoader.a(a)) {
|
||||
arrayList.add(modelLoader);
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
private static <A> Class<A> b(A a) {
|
||||
return (Class<A>) a.getClass();
|
||||
}
|
||||
|
||||
public synchronized List<Class<?>> a(Class<?> cls) {
|
||||
return this.a.b(cls);
|
||||
}
|
||||
}
|
142
sources/com/bumptech/glide/load/model/MultiModelLoader.java
Normal file
142
sources/com/bumptech/glide/load/model/MultiModelLoader.java
Normal file
@@ -0,0 +1,142 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import androidx.core.util.Pools$Pool;
|
||||
import com.bumptech.glide.Priority;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.Key;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.data.DataFetcher;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.util.Preconditions;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MultiModelLoader<Model, Data> implements ModelLoader<Model, Data> {
|
||||
private final List<ModelLoader<Model, Data>> a;
|
||||
private final Pools$Pool<List<Throwable>> b;
|
||||
|
||||
MultiModelLoader(List<ModelLoader<Model, Data>> list, Pools$Pool<List<Throwable>> pools$Pool) {
|
||||
this.a = list;
|
||||
this.b = pools$Pool;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<Data> a(Model model, int i, int i2, Options options) {
|
||||
ModelLoader.LoadData<Data> a;
|
||||
int size = this.a.size();
|
||||
ArrayList arrayList = new ArrayList(size);
|
||||
Key key = null;
|
||||
for (int i3 = 0; i3 < size; i3++) {
|
||||
ModelLoader<Model, Data> modelLoader = this.a.get(i3);
|
||||
if (modelLoader.a(model) && (a = modelLoader.a(model, i, i2, options)) != null) {
|
||||
key = a.a;
|
||||
arrayList.add(a.c);
|
||||
}
|
||||
}
|
||||
if (arrayList.isEmpty() || key == null) {
|
||||
return null;
|
||||
}
|
||||
return new ModelLoader.LoadData<>(key, new MultiFetcher(arrayList, this.b));
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "MultiModelLoader{modelLoaders=" + Arrays.toString(this.a.toArray()) + '}';
|
||||
}
|
||||
|
||||
static class MultiFetcher<Data> implements DataFetcher<Data>, DataFetcher.DataCallback<Data> {
|
||||
private final List<DataFetcher<Data>> a;
|
||||
private final Pools$Pool<List<Throwable>> b;
|
||||
private int c;
|
||||
private Priority d;
|
||||
private DataFetcher.DataCallback<? super Data> e;
|
||||
private List<Throwable> f;
|
||||
|
||||
MultiFetcher(List<DataFetcher<Data>> list, Pools$Pool<List<Throwable>> pools$Pool) {
|
||||
this.b = pools$Pool;
|
||||
Preconditions.a(list);
|
||||
this.a = list;
|
||||
this.c = 0;
|
||||
}
|
||||
|
||||
private void c() {
|
||||
if (this.c < this.a.size() - 1) {
|
||||
this.c++;
|
||||
a(this.d, this.e);
|
||||
} else {
|
||||
Preconditions.a(this.f);
|
||||
this.e.a((Exception) new GlideException("Fetch failed", new ArrayList(this.f)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void a(Priority priority, DataFetcher.DataCallback<? super Data> dataCallback) {
|
||||
this.d = priority;
|
||||
this.e = dataCallback;
|
||||
this.f = this.b.a();
|
||||
this.a.get(this.c).a(priority, this);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void b() {
|
||||
List<Throwable> list = this.f;
|
||||
if (list != null) {
|
||||
this.b.a(list);
|
||||
}
|
||||
this.f = null;
|
||||
Iterator<DataFetcher<Data>> it = this.a.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().b();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void cancel() {
|
||||
Iterator<DataFetcher<Data>> it = this.a.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public DataSource getDataSource() {
|
||||
return this.a.get(0).getDataSource();
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public Class<Data> a() {
|
||||
return this.a.get(0).a();
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher.DataCallback
|
||||
public void a(Data data) {
|
||||
if (data != null) {
|
||||
this.e.a((DataFetcher.DataCallback<? super Data>) data);
|
||||
} else {
|
||||
c();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher.DataCallback
|
||||
public void a(Exception exc) {
|
||||
List<Throwable> list = this.f;
|
||||
Preconditions.a(list);
|
||||
list.add(exc);
|
||||
c();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(Model model) {
|
||||
Iterator<ModelLoader<Model, Data>> it = this.a.iterator();
|
||||
while (it.hasNext()) {
|
||||
if (it.next().a(model)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@@ -0,0 +1,180 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import androidx.core.util.Pools$Pool;
|
||||
import com.bumptech.glide.Registry;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.util.Preconditions;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MultiModelLoaderFactory {
|
||||
private static final Factory e = new Factory();
|
||||
private static final ModelLoader<Object, Object> f = new EmptyModelLoader();
|
||||
private final List<Entry<?, ?>> a;
|
||||
private final Factory b;
|
||||
private final Set<Entry<?, ?>> c;
|
||||
private final Pools$Pool<List<Throwable>> d;
|
||||
|
||||
private static class EmptyModelLoader implements ModelLoader<Object, Object> {
|
||||
EmptyModelLoader() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<Object> a(Object obj, int i, int i2, Options options) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(Object obj) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static class Entry<Model, Data> {
|
||||
private final Class<Model> a;
|
||||
final Class<Data> b;
|
||||
final ModelLoaderFactory<? extends Model, ? extends Data> c;
|
||||
|
||||
public Entry(Class<Model> cls, Class<Data> cls2, ModelLoaderFactory<? extends Model, ? extends Data> modelLoaderFactory) {
|
||||
this.a = cls;
|
||||
this.b = cls2;
|
||||
this.c = modelLoaderFactory;
|
||||
}
|
||||
|
||||
public boolean a(Class<?> cls, Class<?> cls2) {
|
||||
return a(cls) && this.b.isAssignableFrom(cls2);
|
||||
}
|
||||
|
||||
public boolean a(Class<?> cls) {
|
||||
return this.a.isAssignableFrom(cls);
|
||||
}
|
||||
}
|
||||
|
||||
static class Factory {
|
||||
Factory() {
|
||||
}
|
||||
|
||||
public <Model, Data> MultiModelLoader<Model, Data> a(List<ModelLoader<Model, Data>> list, Pools$Pool<List<Throwable>> pools$Pool) {
|
||||
return new MultiModelLoader<>(list, pools$Pool);
|
||||
}
|
||||
}
|
||||
|
||||
public MultiModelLoaderFactory(Pools$Pool<List<Throwable>> pools$Pool) {
|
||||
this(pools$Pool, e);
|
||||
}
|
||||
|
||||
synchronized <Model, Data> void a(Class<Model> cls, Class<Data> cls2, ModelLoaderFactory<? extends Model, ? extends Data> modelLoaderFactory) {
|
||||
a(cls, cls2, modelLoaderFactory, true);
|
||||
}
|
||||
|
||||
synchronized <Model, Data> List<ModelLoaderFactory<? extends Model, ? extends Data>> b(Class<Model> cls, Class<Data> cls2, ModelLoaderFactory<? extends Model, ? extends Data> modelLoaderFactory) {
|
||||
List<ModelLoaderFactory<? extends Model, ? extends Data>> b;
|
||||
b = b(cls, cls2);
|
||||
a(cls, cls2, modelLoaderFactory);
|
||||
return b;
|
||||
}
|
||||
|
||||
MultiModelLoaderFactory(Pools$Pool<List<Throwable>> pools$Pool, Factory factory) {
|
||||
this.a = new ArrayList();
|
||||
this.c = new HashSet();
|
||||
this.d = pools$Pool;
|
||||
this.b = factory;
|
||||
}
|
||||
|
||||
private <Model, Data> void a(Class<Model> cls, Class<Data> cls2, ModelLoaderFactory<? extends Model, ? extends Data> modelLoaderFactory, boolean z) {
|
||||
Entry<?, ?> entry = new Entry<>(cls, cls2, modelLoaderFactory);
|
||||
List<Entry<?, ?>> list = this.a;
|
||||
list.add(z ? list.size() : 0, entry);
|
||||
}
|
||||
|
||||
synchronized <Model, Data> List<ModelLoaderFactory<? extends Model, ? extends Data>> b(Class<Model> cls, Class<Data> cls2) {
|
||||
ArrayList arrayList;
|
||||
arrayList = new ArrayList();
|
||||
Iterator<Entry<?, ?>> it = this.a.iterator();
|
||||
while (it.hasNext()) {
|
||||
Entry<?, ?> next = it.next();
|
||||
if (next.a(cls, cls2)) {
|
||||
it.remove();
|
||||
arrayList.add(b(next));
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
synchronized <Model> List<ModelLoader<Model, ?>> a(Class<Model> cls) {
|
||||
ArrayList arrayList;
|
||||
try {
|
||||
arrayList = new ArrayList();
|
||||
for (Entry<?, ?> entry : this.a) {
|
||||
if (!this.c.contains(entry) && entry.a(cls)) {
|
||||
this.c.add(entry);
|
||||
arrayList.add(a(entry));
|
||||
this.c.remove(entry);
|
||||
}
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
this.c.clear();
|
||||
throw th;
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
synchronized List<Class<?>> b(Class<?> cls) {
|
||||
ArrayList arrayList;
|
||||
arrayList = new ArrayList();
|
||||
for (Entry<?, ?> entry : this.a) {
|
||||
if (!arrayList.contains(entry.b) && entry.a(cls)) {
|
||||
arrayList.add(entry.b);
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public synchronized <Model, Data> ModelLoader<Model, Data> a(Class<Model> cls, Class<Data> cls2) {
|
||||
try {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
boolean z = false;
|
||||
for (Entry<?, ?> entry : this.a) {
|
||||
if (this.c.contains(entry)) {
|
||||
z = true;
|
||||
} else if (entry.a(cls, cls2)) {
|
||||
this.c.add(entry);
|
||||
arrayList.add(a(entry));
|
||||
this.c.remove(entry);
|
||||
}
|
||||
}
|
||||
if (arrayList.size() > 1) {
|
||||
return this.b.a(arrayList, this.d);
|
||||
}
|
||||
if (arrayList.size() == 1) {
|
||||
return (ModelLoader) arrayList.get(0);
|
||||
}
|
||||
if (z) {
|
||||
return a();
|
||||
}
|
||||
throw new Registry.NoModelLoaderAvailableException(cls, cls2);
|
||||
} catch (Throwable th) {
|
||||
this.c.clear();
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
|
||||
private <Model, Data> ModelLoaderFactory<Model, Data> b(Entry<?, ?> entry) {
|
||||
return (ModelLoaderFactory<Model, Data>) entry.c;
|
||||
}
|
||||
|
||||
private <Model, Data> ModelLoader<Model, Data> a(Entry<?, ?> entry) {
|
||||
Object a = entry.c.a(this);
|
||||
Preconditions.a(a);
|
||||
return (ModelLoader) a;
|
||||
}
|
||||
|
||||
private static <Model, Data> ModelLoader<Model, Data> a() {
|
||||
return (ModelLoader<Model, Data>) f;
|
||||
}
|
||||
}
|
115
sources/com/bumptech/glide/load/model/ResourceLoader.java
Normal file
115
sources/com/bumptech/glide/load/model/ResourceLoader.java
Normal file
@@ -0,0 +1,115 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import android.content.res.AssetFileDescriptor;
|
||||
import android.content.res.Resources;
|
||||
import android.net.Uri;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.util.Log;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import java.io.InputStream;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ResourceLoader<Data> implements ModelLoader<Integer, Data> {
|
||||
private final ModelLoader<Uri, Data> a;
|
||||
private final Resources b;
|
||||
|
||||
public static final class AssetFileDescriptorFactory implements ModelLoaderFactory<Integer, AssetFileDescriptor> {
|
||||
private final Resources a;
|
||||
|
||||
public AssetFileDescriptorFactory(Resources resources) {
|
||||
this.a = resources;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Integer, AssetFileDescriptor> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new ResourceLoader(this.a, multiModelLoaderFactory.a(Uri.class, AssetFileDescriptor.class));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public static class FileDescriptorFactory implements ModelLoaderFactory<Integer, ParcelFileDescriptor> {
|
||||
private final Resources a;
|
||||
|
||||
public FileDescriptorFactory(Resources resources) {
|
||||
this.a = resources;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Integer, ParcelFileDescriptor> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new ResourceLoader(this.a, multiModelLoaderFactory.a(Uri.class, ParcelFileDescriptor.class));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public static class StreamFactory implements ModelLoaderFactory<Integer, InputStream> {
|
||||
private final Resources a;
|
||||
|
||||
public StreamFactory(Resources resources) {
|
||||
this.a = resources;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Integer, InputStream> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new ResourceLoader(this.a, multiModelLoaderFactory.a(Uri.class, InputStream.class));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public static class UriFactory implements ModelLoaderFactory<Integer, Uri> {
|
||||
private final Resources a;
|
||||
|
||||
public UriFactory(Resources resources) {
|
||||
this.a = resources;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Integer, Uri> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new ResourceLoader(this.a, UnitModelLoader.a());
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public ResourceLoader(Resources resources, ModelLoader<Uri, Data> modelLoader) {
|
||||
this.b = resources;
|
||||
this.a = modelLoader;
|
||||
}
|
||||
|
||||
private Uri b(Integer num) {
|
||||
try {
|
||||
return Uri.parse("android.resource://" + this.b.getResourcePackageName(num.intValue()) + '/' + this.b.getResourceTypeName(num.intValue()) + '/' + this.b.getResourceEntryName(num.intValue()));
|
||||
} catch (Resources.NotFoundException e) {
|
||||
if (!Log.isLoggable("ResourceLoader", 5)) {
|
||||
return null;
|
||||
}
|
||||
Log.w("ResourceLoader", "Received invalid resource id: " + num, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(Integer num) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<Data> a(Integer num, int i, int i2, Options options) {
|
||||
Uri b = b(num);
|
||||
if (b == null) {
|
||||
return null;
|
||||
}
|
||||
return this.a.a(b, i, i2, options);
|
||||
}
|
||||
}
|
74
sources/com/bumptech/glide/load/model/StreamEncoder.java
Normal file
74
sources/com/bumptech/glide/load/model/StreamEncoder.java
Normal file
@@ -0,0 +1,74 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import android.util.Log;
|
||||
import com.bumptech.glide.load.Encoder;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.engine.bitmap_recycle.ArrayPool;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class StreamEncoder implements Encoder<InputStream> {
|
||||
private final ArrayPool a;
|
||||
|
||||
public StreamEncoder(ArrayPool arrayPool) {
|
||||
this.a = arrayPool;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.Encoder
|
||||
public boolean a(InputStream inputStream, File file, Options options) {
|
||||
byte[] bArr = (byte[]) this.a.b(65536, byte[].class);
|
||||
boolean z = false;
|
||||
FileOutputStream fileOutputStream = null;
|
||||
try {
|
||||
try {
|
||||
try {
|
||||
FileOutputStream fileOutputStream2 = new FileOutputStream(file);
|
||||
while (true) {
|
||||
try {
|
||||
int read = inputStream.read(bArr);
|
||||
if (read == -1) {
|
||||
break;
|
||||
}
|
||||
fileOutputStream2.write(bArr, 0, read);
|
||||
} catch (IOException e) {
|
||||
e = e;
|
||||
fileOutputStream = fileOutputStream2;
|
||||
if (Log.isLoggable("StreamEncoder", 3)) {
|
||||
Log.d("StreamEncoder", "Failed to encode data onto the OutputStream", e);
|
||||
}
|
||||
if (fileOutputStream != null) {
|
||||
fileOutputStream.close();
|
||||
}
|
||||
this.a.put(bArr);
|
||||
return z;
|
||||
} catch (Throwable th) {
|
||||
th = th;
|
||||
fileOutputStream = fileOutputStream2;
|
||||
if (fileOutputStream != null) {
|
||||
try {
|
||||
fileOutputStream.close();
|
||||
} catch (IOException unused) {
|
||||
}
|
||||
}
|
||||
this.a.put(bArr);
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
fileOutputStream2.close();
|
||||
z = true;
|
||||
fileOutputStream2.close();
|
||||
} catch (Throwable th2) {
|
||||
th = th2;
|
||||
}
|
||||
} catch (IOException e2) {
|
||||
e = e2;
|
||||
}
|
||||
} catch (IOException unused2) {
|
||||
}
|
||||
this.a.put(bArr);
|
||||
return z;
|
||||
}
|
||||
}
|
81
sources/com/bumptech/glide/load/model/StringLoader.java
Normal file
81
sources/com/bumptech/glide/load/model/StringLoader.java
Normal file
@@ -0,0 +1,81 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import android.content.res.AssetFileDescriptor;
|
||||
import android.net.Uri;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.text.TextUtils;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class StringLoader<Data> implements ModelLoader<String, Data> {
|
||||
private final ModelLoader<Uri, Data> a;
|
||||
|
||||
public static final class AssetFileDescriptorFactory implements ModelLoaderFactory<String, AssetFileDescriptor> {
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<String, AssetFileDescriptor> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new StringLoader(multiModelLoaderFactory.a(Uri.class, AssetFileDescriptor.class));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public static class FileDescriptorFactory implements ModelLoaderFactory<String, ParcelFileDescriptor> {
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<String, ParcelFileDescriptor> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new StringLoader(multiModelLoaderFactory.a(Uri.class, ParcelFileDescriptor.class));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public static class StreamFactory implements ModelLoaderFactory<String, InputStream> {
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<String, InputStream> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new StringLoader(multiModelLoaderFactory.a(Uri.class, InputStream.class));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public StringLoader(ModelLoader<Uri, Data> modelLoader) {
|
||||
this.a = modelLoader;
|
||||
}
|
||||
|
||||
private static Uri b(String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return null;
|
||||
}
|
||||
if (str.charAt(0) == '/') {
|
||||
return c(str);
|
||||
}
|
||||
Uri parse = Uri.parse(str);
|
||||
return parse.getScheme() == null ? c(str) : parse;
|
||||
}
|
||||
|
||||
private static Uri c(String str) {
|
||||
return Uri.fromFile(new File(str));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(String str) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<Data> a(String str, int i, int i2, Options options) {
|
||||
Uri b = b(str);
|
||||
if (b == null) {
|
||||
return null;
|
||||
}
|
||||
return this.a.a(b, i, i2, options);
|
||||
}
|
||||
}
|
83
sources/com/bumptech/glide/load/model/UnitModelLoader.java
Normal file
83
sources/com/bumptech/glide/load/model/UnitModelLoader.java
Normal file
@@ -0,0 +1,83 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import com.bumptech.glide.Priority;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.data.DataFetcher;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.signature.ObjectKey;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class UnitModelLoader<Model> implements ModelLoader<Model, Model> {
|
||||
private static final UnitModelLoader<?> a = new UnitModelLoader<>();
|
||||
|
||||
public static class Factory<Model> implements ModelLoaderFactory<Model, Model> {
|
||||
private static final Factory<?> a = new Factory<>();
|
||||
|
||||
@Deprecated
|
||||
public Factory() {
|
||||
}
|
||||
|
||||
public static <T> Factory<T> b() {
|
||||
return (Factory<T>) a;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Model, Model> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return UnitModelLoader.a();
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
private static class UnitFetcher<Model> implements DataFetcher<Model> {
|
||||
private final Model a;
|
||||
|
||||
UnitFetcher(Model model) {
|
||||
this.a = model;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void a(Priority priority, DataFetcher.DataCallback<? super Model> dataCallback) {
|
||||
dataCallback.a((DataFetcher.DataCallback<? super Model>) this.a);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void b() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public void cancel() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public DataSource getDataSource() {
|
||||
return DataSource.LOCAL;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.data.DataFetcher
|
||||
public Class<Model> a() {
|
||||
return (Class<Model>) this.a.getClass();
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public UnitModelLoader() {
|
||||
}
|
||||
|
||||
public static <T> UnitModelLoader<T> a() {
|
||||
return (UnitModelLoader<T>) a;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(Model model) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<Model> a(Model model, int i, int i2, Options options) {
|
||||
return new ModelLoader.LoadData<>(new ObjectKey(model), new UnitFetcher(model));
|
||||
}
|
||||
}
|
108
sources/com/bumptech/glide/load/model/UriLoader.java
Normal file
108
sources/com/bumptech/glide/load/model/UriLoader.java
Normal file
@@ -0,0 +1,108 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.res.AssetFileDescriptor;
|
||||
import android.net.Uri;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.data.AssetFileDescriptorLocalUriFetcher;
|
||||
import com.bumptech.glide.load.data.DataFetcher;
|
||||
import com.bumptech.glide.load.data.FileDescriptorLocalUriFetcher;
|
||||
import com.bumptech.glide.load.data.StreamLocalUriFetcher;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.signature.ObjectKey;
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class UriLoader<Data> implements ModelLoader<Uri, Data> {
|
||||
private static final Set<String> b = Collections.unmodifiableSet(new HashSet(Arrays.asList("file", "android.resource", "content")));
|
||||
private final LocalUriFetcherFactory<Data> a;
|
||||
|
||||
public static final class AssetFileDescriptorFactory implements ModelLoaderFactory<Uri, AssetFileDescriptor>, LocalUriFetcherFactory<AssetFileDescriptor> {
|
||||
private final ContentResolver a;
|
||||
|
||||
public AssetFileDescriptorFactory(ContentResolver contentResolver) {
|
||||
this.a = contentResolver;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Uri, AssetFileDescriptor> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new UriLoader(this);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.UriLoader.LocalUriFetcherFactory
|
||||
public DataFetcher<AssetFileDescriptor> a(Uri uri) {
|
||||
return new AssetFileDescriptorLocalUriFetcher(this.a, uri);
|
||||
}
|
||||
}
|
||||
|
||||
public static class FileDescriptorFactory implements ModelLoaderFactory<Uri, ParcelFileDescriptor>, LocalUriFetcherFactory<ParcelFileDescriptor> {
|
||||
private final ContentResolver a;
|
||||
|
||||
public FileDescriptorFactory(ContentResolver contentResolver) {
|
||||
this.a = contentResolver;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.UriLoader.LocalUriFetcherFactory
|
||||
public DataFetcher<ParcelFileDescriptor> a(Uri uri) {
|
||||
return new FileDescriptorLocalUriFetcher(this.a, uri);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Uri, ParcelFileDescriptor> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new UriLoader(this);
|
||||
}
|
||||
}
|
||||
|
||||
public interface LocalUriFetcherFactory<Data> {
|
||||
DataFetcher<Data> a(Uri uri);
|
||||
}
|
||||
|
||||
public static class StreamFactory implements ModelLoaderFactory<Uri, InputStream>, LocalUriFetcherFactory<InputStream> {
|
||||
private final ContentResolver a;
|
||||
|
||||
public StreamFactory(ContentResolver contentResolver) {
|
||||
this.a = contentResolver;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.UriLoader.LocalUriFetcherFactory
|
||||
public DataFetcher<InputStream> a(Uri uri) {
|
||||
return new StreamLocalUriFetcher(this.a, uri);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Uri, InputStream> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new UriLoader(this);
|
||||
}
|
||||
}
|
||||
|
||||
public UriLoader(LocalUriFetcherFactory<Data> localUriFetcherFactory) {
|
||||
this.a = localUriFetcherFactory;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<Data> a(Uri uri, int i, int i2, Options options) {
|
||||
return new ModelLoader.LoadData<>(new ObjectKey(uri), this.a.a(uri));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(Uri uri) {
|
||||
return b.contains(uri.getScheme());
|
||||
}
|
||||
}
|
41
sources/com/bumptech/glide/load/model/UrlUriLoader.java
Normal file
41
sources/com/bumptech/glide/load/model/UrlUriLoader.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package com.bumptech.glide.load.model;
|
||||
|
||||
import android.net.Uri;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class UrlUriLoader<Data> implements ModelLoader<Uri, Data> {
|
||||
private static final Set<String> b = Collections.unmodifiableSet(new HashSet(Arrays.asList("http", "https")));
|
||||
private final ModelLoader<GlideUrl, Data> a;
|
||||
|
||||
public static class StreamFactory implements ModelLoaderFactory<Uri, InputStream> {
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Uri, InputStream> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new UrlUriLoader(multiModelLoaderFactory.a(GlideUrl.class, InputStream.class));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public UrlUriLoader(ModelLoader<GlideUrl, Data> modelLoader) {
|
||||
this.a = modelLoader;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<Data> a(Uri uri, int i, int i2, Options options) {
|
||||
return this.a.a(new GlideUrl(uri.toString()), i, i2, options);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(Uri uri) {
|
||||
return b.contains(uri.getScheme());
|
||||
}
|
||||
}
|
@@ -0,0 +1,53 @@
|
||||
package com.bumptech.glide.load.model.stream;
|
||||
|
||||
import com.bumptech.glide.load.Option;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.data.HttpUrlFetcher;
|
||||
import com.bumptech.glide.load.model.GlideUrl;
|
||||
import com.bumptech.glide.load.model.ModelCache;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.load.model.ModelLoaderFactory;
|
||||
import com.bumptech.glide.load.model.MultiModelLoaderFactory;
|
||||
import java.io.InputStream;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HttpGlideUrlLoader implements ModelLoader<GlideUrl, InputStream> {
|
||||
public static final Option<Integer> b = Option.a("com.bumptech.glide.load.model.stream.HttpGlideUrlLoader.Timeout", 2500);
|
||||
private final ModelCache<GlideUrl, GlideUrl> a;
|
||||
|
||||
public static class Factory implements ModelLoaderFactory<GlideUrl, InputStream> {
|
||||
private final ModelCache<GlideUrl, GlideUrl> a = new ModelCache<>(500);
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<GlideUrl, InputStream> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new HttpGlideUrlLoader(this.a);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public HttpGlideUrlLoader(ModelCache<GlideUrl, GlideUrl> modelCache) {
|
||||
this.a = modelCache;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(GlideUrl glideUrl) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<InputStream> a(GlideUrl glideUrl, int i, int i2, Options options) {
|
||||
ModelCache<GlideUrl, GlideUrl> modelCache = this.a;
|
||||
if (modelCache != null) {
|
||||
GlideUrl a = modelCache.a(glideUrl, 0, 0);
|
||||
if (a == null) {
|
||||
this.a.a(glideUrl, 0, 0, glideUrl);
|
||||
} else {
|
||||
glideUrl = a;
|
||||
}
|
||||
}
|
||||
return new ModelLoader.LoadData<>(glideUrl, new HttpUrlFetcher(glideUrl, ((Integer) options.a(b)).intValue()));
|
||||
}
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
package com.bumptech.glide.load.model.stream;
|
||||
|
||||
import android.net.Uri;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.model.GlideUrl;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.load.model.ModelLoaderFactory;
|
||||
import com.bumptech.glide.load.model.MultiModelLoaderFactory;
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HttpUriLoader implements ModelLoader<Uri, InputStream> {
|
||||
private static final Set<String> b = Collections.unmodifiableSet(new HashSet(Arrays.asList("http", "https")));
|
||||
private final ModelLoader<GlideUrl, InputStream> a;
|
||||
|
||||
public static class Factory implements ModelLoaderFactory<Uri, InputStream> {
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Uri, InputStream> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new HttpUriLoader(multiModelLoaderFactory.a(GlideUrl.class, InputStream.class));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public HttpUriLoader(ModelLoader<GlideUrl, InputStream> modelLoader) {
|
||||
this.a = modelLoader;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<InputStream> a(Uri uri, int i, int i2, Options options) {
|
||||
return this.a.a(new GlideUrl(uri.toString()), i, i2, options);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(Uri uri) {
|
||||
return b.contains(uri.getScheme());
|
||||
}
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
package com.bumptech.glide.load.model.stream;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.data.mediastore.MediaStoreUtil;
|
||||
import com.bumptech.glide.load.data.mediastore.ThumbFetcher;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.load.model.ModelLoaderFactory;
|
||||
import com.bumptech.glide.load.model.MultiModelLoaderFactory;
|
||||
import com.bumptech.glide.signature.ObjectKey;
|
||||
import java.io.InputStream;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MediaStoreImageThumbLoader implements ModelLoader<Uri, InputStream> {
|
||||
private final Context a;
|
||||
|
||||
public static class Factory implements ModelLoaderFactory<Uri, InputStream> {
|
||||
private final Context a;
|
||||
|
||||
public Factory(Context context) {
|
||||
this.a = context;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Uri, InputStream> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new MediaStoreImageThumbLoader(this.a);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public MediaStoreImageThumbLoader(Context context) {
|
||||
this.a = context.getApplicationContext();
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<InputStream> a(Uri uri, int i, int i2, Options options) {
|
||||
if (MediaStoreUtil.a(i, i2)) {
|
||||
return new ModelLoader.LoadData<>(new ObjectKey(uri), ThumbFetcher.a(this.a, uri));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(Uri uri) {
|
||||
return MediaStoreUtil.a(uri);
|
||||
}
|
||||
}
|
@@ -0,0 +1,57 @@
|
||||
package com.bumptech.glide.load.model.stream;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.data.mediastore.MediaStoreUtil;
|
||||
import com.bumptech.glide.load.data.mediastore.ThumbFetcher;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.load.model.ModelLoaderFactory;
|
||||
import com.bumptech.glide.load.model.MultiModelLoaderFactory;
|
||||
import com.bumptech.glide.load.resource.bitmap.VideoDecoder;
|
||||
import com.bumptech.glide.signature.ObjectKey;
|
||||
import java.io.InputStream;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MediaStoreVideoThumbLoader implements ModelLoader<Uri, InputStream> {
|
||||
private final Context a;
|
||||
|
||||
public static class Factory implements ModelLoaderFactory<Uri, InputStream> {
|
||||
private final Context a;
|
||||
|
||||
public Factory(Context context) {
|
||||
this.a = context;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<Uri, InputStream> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new MediaStoreVideoThumbLoader(this.a);
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public MediaStoreVideoThumbLoader(Context context) {
|
||||
this.a = context.getApplicationContext();
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<InputStream> a(Uri uri, int i, int i2, Options options) {
|
||||
if (MediaStoreUtil.a(i, i2) && a(options)) {
|
||||
return new ModelLoader.LoadData<>(new ObjectKey(uri), ThumbFetcher.b(this.a, uri));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean a(Options options) {
|
||||
Long l = (Long) options.a(VideoDecoder.d);
|
||||
return l != null && l.longValue() == -1;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(Uri uri) {
|
||||
return MediaStoreUtil.c(uri);
|
||||
}
|
||||
}
|
39
sources/com/bumptech/glide/load/model/stream/UrlLoader.java
Normal file
39
sources/com/bumptech/glide/load/model/stream/UrlLoader.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package com.bumptech.glide.load.model.stream;
|
||||
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.model.GlideUrl;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.load.model.ModelLoaderFactory;
|
||||
import com.bumptech.glide.load.model.MultiModelLoaderFactory;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class UrlLoader implements ModelLoader<URL, InputStream> {
|
||||
private final ModelLoader<GlideUrl, InputStream> a;
|
||||
|
||||
public static class StreamFactory implements ModelLoaderFactory<URL, InputStream> {
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public ModelLoader<URL, InputStream> a(MultiModelLoaderFactory multiModelLoaderFactory) {
|
||||
return new UrlLoader(multiModelLoaderFactory.a(GlideUrl.class, InputStream.class));
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoaderFactory
|
||||
public void a() {
|
||||
}
|
||||
}
|
||||
|
||||
public UrlLoader(ModelLoader<GlideUrl, InputStream> modelLoader) {
|
||||
this.a = modelLoader;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public boolean a(URL url) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.bumptech.glide.load.model.ModelLoader
|
||||
public ModelLoader.LoadData<InputStream> a(URL url, int i, int i2, Options options) {
|
||||
return this.a.a(new GlideUrl(url), i, i2, options);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user