what-the-bank/sources/o/C13020fOa.java

286 lines
10 KiB
Java

package o;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicInteger;
import o.fNW;
/* renamed from: o.fOa, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C13020fOa {
private static final AtomicInteger c = new AtomicInteger();
public final fNW.IeS a;
public boolean b;
public Object d;
public boolean e;
private int f;
private int g;
private int h;
private Drawable i;
private final Picasso j;
private Drawable l;
private int m;
private boolean n;
public C13020fOa(Picasso picasso, Uri uri, int i) {
this.n = true;
boolean z = picasso.n;
this.j = picasso;
this.a = new fNW.IeS(uri, i, picasso.e);
}
C13020fOa() {
this.n = true;
this.j = null;
this.a = new fNW.IeS(null, 0, null);
}
public final C13020fOa b(int i) {
if (!this.n) {
throw new IllegalStateException("Already explicitly declared as no placeholder.");
}
if (i == 0) {
throw new IllegalArgumentException("Placeholder image resource invalid.");
}
if (this.l != null) {
throw new IllegalStateException("Placeholder image already set.");
}
this.m = i;
return this;
}
public final C13020fOa aBv_(Drawable drawable) {
if (!this.n) {
throw new IllegalStateException("Already explicitly declared as no placeholder.");
}
if (this.m != 0) {
throw new IllegalStateException("Placeholder image already set.");
}
this.l = drawable;
return this;
}
public final C13020fOa e(int i) {
if (i == 0) {
throw new IllegalArgumentException("Error image resource invalid.");
}
if (this.i != null) {
throw new IllegalStateException("Error image already set.");
}
this.h = i;
return this;
}
public final C13020fOa aBs_(Drawable drawable) {
if (drawable == null) {
throw new IllegalArgumentException("Error image may not be null.");
}
if (this.h != 0) {
throw new IllegalStateException("Error image already set.");
}
this.i = drawable;
return this;
}
public final C13020fOa d() {
Resources resources = this.j.c.getResources();
this.a.e(resources.getDimensionPixelSize(com.scb.phone.R.dimen.f15972131165363), resources.getDimensionPixelSize(com.scb.phone.R.dimen.f15972131165363));
return this;
}
public final C13020fOa a(EnumC12984fNP enumC12984fNP, EnumC12984fNP... enumC12984fNPArr) {
if (enumC12984fNP == null) {
throw new IllegalArgumentException("Memory policy cannot be null.");
}
this.f = enumC12984fNP.index | this.f;
if (enumC12984fNPArr.length > 0) {
for (EnumC12984fNP enumC12984fNP2 : enumC12984fNPArr) {
if (enumC12984fNP2 == null) {
throw new IllegalArgumentException("Memory policy cannot be null.");
}
this.f = enumC12984fNP2.index | this.f;
}
}
return this;
}
public final Bitmap aBt_() throws IOException {
long nanoTime = System.nanoTime();
C13025fOf.e();
if (this.e) {
throw new IllegalStateException("Fit cannot be used with get.");
}
fNW.IeS ieS = this.a;
if (ieS.p == null && ieS.h == 0) {
return null;
}
fNW d = d(nanoTime);
C12983fNM c12983fNM = new C12983fNM(this.j, d, this.f, this.g, this.d, C13025fOf.c(d, new StringBuilder()));
Picasso picasso = this.j;
return RunnableC13011fNx.d(picasso, picasso.a, this.j.b, this.j.f8088o, c12983fNM).aBc_();
}
public final void d(InterfaceC13027fOh interfaceC13027fOh) {
Bitmap aBo_;
long nanoTime = System.nanoTime();
C13025fOf.b();
if (interfaceC13027fOh == null) {
throw new IllegalArgumentException("Target must not be null.");
}
if (this.e) {
throw new IllegalStateException("Fit cannot be used with a Target.");
}
fNW.IeS ieS = this.a;
Drawable drawable = null;
if (!((ieS.p == null && ieS.h == 0) ? false : true)) {
Picasso picasso = this.j;
if (interfaceC13027fOh == null) {
throw new IllegalArgumentException("target cannot be null.");
}
picasso.e(interfaceC13027fOh);
if (this.n) {
drawable = this.m != 0 ? this.j.c.getDrawable(this.m) : this.l;
}
interfaceC13027fOh.aBC_(drawable);
return;
}
fNW d = d(nanoTime);
String e = C13025fOf.e(d);
if (!EnumC12984fNP.e(this.f) || (aBo_ = this.j.aBo_(e)) == null) {
if (this.n) {
drawable = this.m != 0 ? this.j.c.getDrawable(this.m) : this.l;
}
interfaceC13027fOh.aBC_(drawable);
this.j.a(new C13028fOi(this.j, interfaceC13027fOh, d, this.f, this.g, this.i, e, this.d, this.h));
return;
}
Picasso picasso2 = this.j;
if (interfaceC13027fOh == null) {
throw new IllegalArgumentException("target cannot be null.");
}
picasso2.e(interfaceC13027fOh);
Picasso.HBt hBt = Picasso.HBt.MEMORY;
interfaceC13027fOh.aBB_(aBo_);
}
public final void aBu_(ImageView imageView, InterfaceC12980fNE interfaceC12980fNE) {
Bitmap aBo_;
long nanoTime = System.nanoTime();
C13025fOf.b();
if (imageView == null) {
throw new IllegalArgumentException("Target must not be null.");
}
fNW.IeS ieS = this.a;
if (ieS.p == null && ieS.h == 0) {
Picasso picasso = this.j;
if (imageView == null) {
throw new IllegalArgumentException("view cannot be null.");
}
picasso.e(imageView);
if (this.n) {
C12986fNY.aBr_(imageView, this.m != 0 ? this.j.c.getDrawable(this.m) : this.l);
return;
}
return;
}
if (this.e) {
fNW.IeS ieS2 = this.a;
if (ieS2.l != 0 || ieS2.m != 0) {
throw new IllegalStateException("Fit cannot be used with resize.");
}
int width = imageView.getWidth();
int height = imageView.getHeight();
if (width == 0 || height == 0) {
if (this.n) {
C12986fNY.aBr_(imageView, this.m != 0 ? this.j.c.getDrawable(this.m) : this.l);
}
Picasso picasso2 = this.j;
fNC fnc = new fNC(this, imageView, interfaceC12980fNE);
if (picasso2.l.containsKey(imageView)) {
picasso2.e(imageView);
}
picasso2.l.put(imageView, fnc);
return;
}
this.a.e(width, height);
}
fNW d = d(nanoTime);
String e = C13025fOf.e(d);
if (!EnumC12984fNP.e(this.f) || (aBo_ = this.j.aBo_(e)) == null) {
if (this.n) {
C12986fNY.aBr_(imageView, this.m != 0 ? this.j.c.getDrawable(this.m) : this.l);
}
this.j.a(new C12982fNL(this.j, imageView, d, this.f, this.g, this.h, this.i, e, this.d, interfaceC12980fNE, this.b));
return;
}
Picasso picasso3 = this.j;
if (imageView == null) {
throw new IllegalArgumentException("view cannot be null.");
}
picasso3.e(imageView);
C12986fNY.aBq_(imageView, this.j.c, aBo_, Picasso.HBt.MEMORY, this.b, this.j.j);
if (this.j.f) {
StringBuilder sb = new StringBuilder("[R");
sb.append(d.h);
sb.append(']');
String obj = sb.toString();
StringBuilder sb2 = new StringBuilder("from ");
sb2.append(Picasso.HBt.MEMORY);
C13025fOf.d("Main", "completed", obj, sb2.toString());
}
if (interfaceC12980fNE != null) {
interfaceC12980fNE.d();
}
}
private fNW d(long j) {
int andIncrement = c.getAndIncrement();
fNW.IeS ieS = this.a;
boolean z = ieS.d;
if (z && ieS.e) {
throw new IllegalStateException("Center crop and center inside can not be used together.");
}
if (ieS.e && ieS.l == 0 && ieS.m == 0) {
throw new IllegalStateException("Center crop requires calling resize with positive width and height.");
}
if (z && ieS.l == 0 && ieS.m == 0) {
throw new IllegalStateException("Center inside requires calling resize with positive width and height.");
}
if (ieS.i == null) {
ieS.i = Picasso.LWm.NORMAL;
}
fNW fnw = new fNW(ieS.p, ieS.h, ieS.n, ieS.s, ieS.l, ieS.m, ieS.e, ieS.d, ieS.c, ieS.g, ieS.j, ieS.k, ieS.f9100o, ieS.b, ieS.f, ieS.a, ieS.i, (byte) 0);
fnw.h = andIncrement;
fnw.q = j;
boolean z2 = this.j.f;
if (z2) {
StringBuilder sb = new StringBuilder("[R");
sb.append(fnw.h);
sb.append(']');
C13025fOf.d("Main", "created", sb.toString(), fnw.toString());
}
Picasso picasso = this.j;
fNW b = picasso.m.b(fnw);
if (b == null) {
StringBuilder sb2 = new StringBuilder("Request transformer ");
sb2.append(picasso.m.getClass().getCanonicalName());
sb2.append(" returned null for ");
sb2.append(fnw);
throw new IllegalStateException(sb2.toString());
}
if (b != fnw) {
b.h = andIncrement;
b.q = j;
if (z2) {
C13025fOf.d("Main", "changed", b.c(), "into ".concat(String.valueOf(b)));
}
}
return b;
}
}