254 lines
9.9 KiB
Java
254 lines
9.9 KiB
Java
package o;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.TypedArray;
|
|
import android.content.res.XmlResourceParser;
|
|
import android.util.SparseArray;
|
|
import android.util.Xml;
|
|
import android.view.LayoutInflater;
|
|
import android.view.ViewGroup;
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
import o.C3345avm;
|
|
import org.simpleframework.xml.strategy.Name;
|
|
import org.xmlpull.v1.XmlPullParser;
|
|
import org.xmlpull.v1.XmlPullParserException;
|
|
|
|
/* renamed from: o.alz, reason: case insensitive filesystem */
|
|
/* loaded from: classes.dex */
|
|
public final class C2832alz {
|
|
private final ConstraintLayout d;
|
|
private yqQ h;
|
|
private int a = -1;
|
|
private int e = -1;
|
|
private SparseArray<LWm> i = new SparseArray<>();
|
|
private SparseArray<yqQ> b = new SparseArray<>();
|
|
public AtR c = null;
|
|
|
|
public C2832alz(Context context, ConstraintLayout constraintLayout, int i) {
|
|
char c;
|
|
LWm lWm = null;
|
|
this.d = constraintLayout;
|
|
XmlResourceParser xml = context.getResources().getXml(i);
|
|
try {
|
|
for (int eventType = xml.getEventType(); eventType != 1; eventType = xml.next()) {
|
|
if (eventType == 0) {
|
|
xml.getName();
|
|
} else if (eventType == 2) {
|
|
String name = xml.getName();
|
|
int i2 = 0;
|
|
switch (name.hashCode()) {
|
|
case -1349929691:
|
|
if (name.equals("ConstraintSet")) {
|
|
c = 4;
|
|
break;
|
|
}
|
|
break;
|
|
case 80204913:
|
|
if (name.equals("State")) {
|
|
c = 2;
|
|
break;
|
|
}
|
|
break;
|
|
case 1382829617:
|
|
if (name.equals("StateSet")) {
|
|
c = 1;
|
|
break;
|
|
}
|
|
break;
|
|
case 1657696882:
|
|
if (name.equals("layoutDescription")) {
|
|
c = 0;
|
|
break;
|
|
}
|
|
break;
|
|
case 1901439077:
|
|
if (name.equals("Variant")) {
|
|
c = 3;
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
c = 65535;
|
|
if (c == 2) {
|
|
LWm lWm2 = new LWm(context, xml);
|
|
this.i.put(lWm2.e, lWm2);
|
|
lWm = lWm2;
|
|
} else if (c == 3) {
|
|
RVV rvv = new RVV(context, xml);
|
|
if (lWm != null) {
|
|
lWm.b.add(rvv);
|
|
}
|
|
} else if (c == 4) {
|
|
yqQ yqq = new yqQ();
|
|
int attributeCount = xml.getAttributeCount();
|
|
while (true) {
|
|
if (i2 < attributeCount) {
|
|
String attributeName = xml.getAttributeName(i2);
|
|
String attributeValue = xml.getAttributeValue(i2);
|
|
if (attributeName == null || attributeValue == null || !Name.MARK.equals(attributeName)) {
|
|
i2++;
|
|
} else {
|
|
int identifier = attributeValue.contains("/") ? context.getResources().getIdentifier(attributeValue.substring(attributeValue.indexOf(47) + 1), Name.MARK, context.getPackageName()) : -1;
|
|
if (identifier == -1 && attributeValue.length() > 1) {
|
|
identifier = Integer.parseInt(attributeValue.substring(1));
|
|
}
|
|
yqq.b(context, xml);
|
|
this.b.put(identifier, yqq);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} catch (IOException | XmlPullParserException unused) {
|
|
}
|
|
}
|
|
|
|
public final void a(int i, float f, float f2) {
|
|
yqQ yqq;
|
|
LWm lWm;
|
|
int b;
|
|
int i2 = this.a;
|
|
if (i2 == i) {
|
|
if (i == -1) {
|
|
lWm = this.i.valueAt(0);
|
|
} else {
|
|
lWm = this.i.get(i2);
|
|
}
|
|
if ((this.e == -1 || !lWm.b.get(this.e).a(f, f2)) && this.e != (b = lWm.b(f, f2))) {
|
|
yqQ yqq2 = b == -1 ? this.h : lWm.b.get(b).b;
|
|
if (b == -1) {
|
|
int i3 = lWm.d;
|
|
} else {
|
|
int i4 = lWm.b.get(b).c;
|
|
}
|
|
if (yqq2 == null) {
|
|
return;
|
|
}
|
|
this.e = b;
|
|
yqq2.d(this.d);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
this.a = i;
|
|
LWm lWm2 = this.i.get(i);
|
|
int b2 = lWm2.b(f, f2);
|
|
if (b2 == -1) {
|
|
yqq = lWm2.c;
|
|
} else {
|
|
yqq = lWm2.b.get(b2).b;
|
|
}
|
|
if (b2 == -1) {
|
|
int i5 = lWm2.d;
|
|
} else {
|
|
int i6 = lWm2.b.get(b2).c;
|
|
}
|
|
if (yqq == null) {
|
|
return;
|
|
}
|
|
this.e = b2;
|
|
yqq.d(this.d);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: o.alz$LWm */
|
|
/* loaded from: classes.dex */
|
|
public static class LWm {
|
|
ArrayList<RVV> b = new ArrayList<>();
|
|
yqQ c;
|
|
int d;
|
|
int e;
|
|
|
|
public LWm(Context context, XmlPullParser xmlPullParser) {
|
|
this.d = -1;
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(Xml.asAttributeSet(xmlPullParser), C3345avm.IeS.State);
|
|
int indexCount = obtainStyledAttributes.getIndexCount();
|
|
for (int i = 0; i < indexCount; i++) {
|
|
int index = obtainStyledAttributes.getIndex(i);
|
|
if (index == C3345avm.IeS.State_android_id) {
|
|
this.e = obtainStyledAttributes.getResourceId(index, this.e);
|
|
} else if (index == C3345avm.IeS.State_constraints) {
|
|
this.d = obtainStyledAttributes.getResourceId(index, this.d);
|
|
String resourceTypeName = context.getResources().getResourceTypeName(this.d);
|
|
context.getResources().getResourceName(this.d);
|
|
if ("layout".equals(resourceTypeName)) {
|
|
yqQ yqq = new yqQ();
|
|
this.c = yqq;
|
|
yqq.e((ConstraintLayout) LayoutInflater.from(context).inflate(this.d, (ViewGroup) null));
|
|
}
|
|
}
|
|
}
|
|
obtainStyledAttributes.recycle();
|
|
}
|
|
|
|
public final int b(float f, float f2) {
|
|
for (int i = 0; i < this.b.size(); i++) {
|
|
if (this.b.get(i).a(f, f2)) {
|
|
return i;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: o.alz$RVV */
|
|
/* loaded from: classes.dex */
|
|
public static class RVV {
|
|
private float a;
|
|
yqQ b;
|
|
int c;
|
|
private float d;
|
|
private float e;
|
|
private float i;
|
|
|
|
public RVV(Context context, XmlPullParser xmlPullParser) {
|
|
this.i = Float.NaN;
|
|
this.e = Float.NaN;
|
|
this.a = Float.NaN;
|
|
this.d = Float.NaN;
|
|
this.c = -1;
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(Xml.asAttributeSet(xmlPullParser), C3345avm.IeS.Variant);
|
|
int indexCount = obtainStyledAttributes.getIndexCount();
|
|
for (int i = 0; i < indexCount; i++) {
|
|
int index = obtainStyledAttributes.getIndex(i);
|
|
if (index == C3345avm.IeS.Variant_constraints) {
|
|
this.c = obtainStyledAttributes.getResourceId(index, this.c);
|
|
String resourceTypeName = context.getResources().getResourceTypeName(this.c);
|
|
context.getResources().getResourceName(this.c);
|
|
if ("layout".equals(resourceTypeName)) {
|
|
yqQ yqq = new yqQ();
|
|
this.b = yqq;
|
|
yqq.e((ConstraintLayout) LayoutInflater.from(context).inflate(this.c, (ViewGroup) null));
|
|
}
|
|
} else if (index == C3345avm.IeS.Variant_region_heightLessThan) {
|
|
this.d = obtainStyledAttributes.getDimension(index, this.d);
|
|
} else if (index == C3345avm.IeS.Variant_region_heightMoreThan) {
|
|
this.e = obtainStyledAttributes.getDimension(index, this.e);
|
|
} else if (index == C3345avm.IeS.Variant_region_widthLessThan) {
|
|
this.a = obtainStyledAttributes.getDimension(index, this.a);
|
|
} else if (index == C3345avm.IeS.Variant_region_widthMoreThan) {
|
|
this.i = obtainStyledAttributes.getDimension(index, this.i);
|
|
}
|
|
}
|
|
obtainStyledAttributes.recycle();
|
|
}
|
|
|
|
final boolean a(float f, float f2) {
|
|
if (!Float.isNaN(this.i) && f < this.i) {
|
|
return false;
|
|
}
|
|
if (!Float.isNaN(this.e) && f2 < this.e) {
|
|
return false;
|
|
}
|
|
if (Float.isNaN(this.a) || f <= this.a) {
|
|
return Float.isNaN(this.d) || f2 <= this.d;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|