132 lines
3.8 KiB
Java
132 lines
3.8 KiB
Java
|
package o;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import android.content.res.Resources;
|
||
|
import android.graphics.Typeface;
|
||
|
import android.os.Build;
|
||
|
import android.os.CancellationSignal;
|
||
|
import android.os.Handler;
|
||
|
import o.Szw;
|
||
|
import o.kVs;
|
||
|
import o.ubj;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public class TaO {
|
||
|
private static final pKi<String, Typeface> b;
|
||
|
private static final TMM d;
|
||
|
|
||
|
static {
|
||
|
if (Build.VERSION.SDK_INT >= 29) {
|
||
|
d = new yHq();
|
||
|
} else if (Build.VERSION.SDK_INT >= 28) {
|
||
|
d = new Wgk();
|
||
|
} else {
|
||
|
d = new C1060Usy();
|
||
|
}
|
||
|
b = new pKi<>(16);
|
||
|
}
|
||
|
|
||
|
public static Typeface oO_(Resources resources, int i, String str, int i2, int i3) {
|
||
|
return b.get(oN_(resources, i, str, i2, i3));
|
||
|
}
|
||
|
|
||
|
private static String oN_(Resources resources, int i, String str, int i2, int i3) {
|
||
|
StringBuilder sb = new StringBuilder(resources.getResourcePackageName(i));
|
||
|
sb.append('-');
|
||
|
sb.append(str);
|
||
|
sb.append('-');
|
||
|
sb.append(i2);
|
||
|
sb.append('-');
|
||
|
sb.append(i);
|
||
|
sb.append('-');
|
||
|
sb.append(i3);
|
||
|
return sb.toString();
|
||
|
}
|
||
|
|
||
|
private static Typeface oP_(String str) {
|
||
|
if (str == null || str.isEmpty()) {
|
||
|
return null;
|
||
|
}
|
||
|
Typeface create = Typeface.create(str, 0);
|
||
|
Typeface create2 = Typeface.create(Typeface.DEFAULT, 0);
|
||
|
if (create == null || create.equals(create2)) {
|
||
|
return null;
|
||
|
}
|
||
|
return create;
|
||
|
}
|
||
|
|
||
|
public static Typeface oL_(Context context, Szw.HBt hBt, Resources resources, int i, String str, int i2, int i3, kVs.LWm lWm, Handler handler, boolean z) {
|
||
|
Typeface pj_;
|
||
|
if (hBt instanceof Szw.RVV) {
|
||
|
Szw.RVV rvv = (Szw.RVV) hBt;
|
||
|
Typeface oP_ = oP_(rvv.a());
|
||
|
if (oP_ != null) {
|
||
|
if (lWm != null) {
|
||
|
lWm.op_(oP_, handler);
|
||
|
}
|
||
|
return oP_;
|
||
|
}
|
||
|
boolean z2 = !z ? lWm != null : rvv.b() != 0;
|
||
|
int c = z ? rvv.c() : -1;
|
||
|
pj_ = ubj.qE_(context, rvv.e(), i3, z2, c, kVs.LWm.on_(handler), new HBt(lWm));
|
||
|
} else {
|
||
|
pj_ = d.pj_(context, (Szw.IeS) hBt, resources, i3);
|
||
|
if (lWm != null) {
|
||
|
if (pj_ != null) {
|
||
|
lWm.op_(pj_, handler);
|
||
|
} else {
|
||
|
lWm.oo_(-3, handler);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (pj_ != null) {
|
||
|
b.put(oN_(resources, i, str, i2, i3), pj_);
|
||
|
}
|
||
|
return pj_;
|
||
|
}
|
||
|
|
||
|
public static Typeface oM_(Context context, Resources resources, int i, String str, int i2, int i3) {
|
||
|
Typeface pm_ = d.pm_(context, resources, i, str, i3);
|
||
|
if (pm_ != null) {
|
||
|
b.put(oN_(resources, i, str, i2, i3), pm_);
|
||
|
}
|
||
|
return pm_;
|
||
|
}
|
||
|
|
||
|
public static Typeface oK_(Context context, CancellationSignal cancellationSignal, ubj.HBt[] hBtArr, int i) {
|
||
|
return d.pk_(context, cancellationSignal, hBtArr, i);
|
||
|
}
|
||
|
|
||
|
public static Typeface oJ_(Context context, Typeface typeface, int i) {
|
||
|
if (context == null) {
|
||
|
throw new IllegalArgumentException("Context cannot be null");
|
||
|
}
|
||
|
return Typeface.create(typeface, i);
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public static class HBt extends ubj.Sts {
|
||
|
private kVs.LWm c;
|
||
|
|
||
|
public HBt(kVs.LWm lWm) {
|
||
|
this.c = lWm;
|
||
|
}
|
||
|
|
||
|
@Override // o.ubj.Sts
|
||
|
public void qH_(Typeface typeface) {
|
||
|
kVs.LWm lWm = this.c;
|
||
|
if (lWm != null) {
|
||
|
lWm.oq_(typeface);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // o.ubj.Sts
|
||
|
public void d(int i) {
|
||
|
kVs.LWm lWm = this.c;
|
||
|
if (lWm != null) {
|
||
|
lWm.b(i);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|