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

111 lines
3.1 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.graphics.Shader;
import android.util.AttributeSet;
import android.util.Xml;
import java.io.IOException;
import org.xmlpull.v1.XmlPullParserException;
/* renamed from: o.amU, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2854amU {
private final Shader c;
private int d;
private final ColorStateList e;
private C2854amU(Shader shader, ColorStateList colorStateList, int i) {
this.c = shader;
this.e = colorStateList;
this.d = i;
}
static C2854amU nH_(Shader shader) {
return new C2854amU(shader, null, 0);
}
static C2854amU nG_(ColorStateList colorStateList) {
return new C2854amU(null, colorStateList, colorStateList.getDefaultColor());
}
/* JADX INFO: Access modifiers changed from: package-private */
public static C2854amU d(int i) {
return new C2854amU(null, null, i);
}
public final boolean c() {
ColorStateList colorStateList;
return this.c == null && (colorStateList = this.e) != null && colorStateList.isStateful();
}
public final boolean a(int[] iArr) {
if (c()) {
ColorStateList colorStateList = this.e;
int colorForState = colorStateList.getColorForState(iArr, colorStateList.getDefaultColor());
if (colorForState != this.d) {
this.d = colorForState;
return true;
}
}
return false;
}
public final boolean d() {
return e() || this.d != 0;
}
public static C2854amU nI_(Resources resources, int i, Resources.Theme theme) {
try {
return nF_(resources, i, theme);
} catch (Exception unused) {
return null;
}
}
private static C2854amU nF_(Resources resources, int i, Resources.Theme theme) throws IOException, XmlPullParserException {
int next;
XmlResourceParser xml = resources.getXml(i);
AttributeSet asAttributeSet = Xml.asAttributeSet(xml);
do {
next = xml.next();
if (next == 2) {
break;
}
} while (next != 1);
if (next != 2) {
throw new XmlPullParserException("No start tag found");
}
String name = xml.getName();
name.hashCode();
if (name.equals("gradient")) {
return nH_(LpO.nR_(resources, xml, asAttributeSet, theme));
}
if (name.equals("selector")) {
return nG_(kFD.nz_(resources, xml, asAttributeSet, theme));
}
StringBuilder sb = new StringBuilder();
sb.append(xml.getPositionDescription());
sb.append(": unsupported complex color tag ");
sb.append(name);
throw new XmlPullParserException(sb.toString());
}
public final void a(int i) {
this.d = i;
}
public final boolean e() {
return this.c != null;
}
public final Shader nJ_() {
return this.c;
}
public final int b() {
return this.d;
}
}