58 lines
1.8 KiB
Java
58 lines
1.8 KiB
Java
package com.bumptech.glide.load.resource.bitmap;
|
|
|
|
import android.content.res.Resources;
|
|
import android.graphics.Bitmap;
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
import com.bumptech.glide.load.engine.Initializable;
|
|
import com.bumptech.glide.load.engine.Resource;
|
|
import com.bumptech.glide.util.Preconditions;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class LazyBitmapDrawableResource implements Resource<BitmapDrawable>, Initializable {
|
|
private final Resources a;
|
|
private final Resource<Bitmap> b;
|
|
|
|
private LazyBitmapDrawableResource(Resources resources, Resource<Bitmap> resource) {
|
|
Preconditions.a(resources);
|
|
this.a = resources;
|
|
Preconditions.a(resource);
|
|
this.b = resource;
|
|
}
|
|
|
|
public static Resource<BitmapDrawable> a(Resources resources, Resource<Bitmap> resource) {
|
|
if (resource == null) {
|
|
return null;
|
|
}
|
|
return new LazyBitmapDrawableResource(resources, resource);
|
|
}
|
|
|
|
@Override // com.bumptech.glide.load.engine.Resource
|
|
public Class<BitmapDrawable> b() {
|
|
return BitmapDrawable.class;
|
|
}
|
|
|
|
@Override // com.bumptech.glide.load.engine.Initializable
|
|
public void c() {
|
|
Resource<Bitmap> resource = this.b;
|
|
if (resource instanceof Initializable) {
|
|
((Initializable) resource).c();
|
|
}
|
|
}
|
|
|
|
@Override // com.bumptech.glide.load.engine.Resource
|
|
public int getSize() {
|
|
return this.b.getSize();
|
|
}
|
|
|
|
@Override // com.bumptech.glide.load.engine.Resource
|
|
public void a() {
|
|
this.b.a();
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.bumptech.glide.load.engine.Resource
|
|
public BitmapDrawable get() {
|
|
return new BitmapDrawable(this.a, this.b.get());
|
|
}
|
|
}
|