package o; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Iterator; /* loaded from: classes.dex */ public final class fGR { private static int c; public int a; int e; public ArrayList d = new ArrayList<>(); private boolean b = false; private ArrayList f = null; private int g = -1; public fGR(int i) { int i2 = c; c = i2 + 1; this.e = i2; this.a = i; } public final String toString() { StringBuilder sb = new StringBuilder(); int i = this.a; sb.append(i == 0 ? "Horizontal" : i == 1 ? "Vertical" : i == 2 ? "Both" : "Unknown"); sb.append(" ["); sb.append(this.e); sb.append("] <"); String obj = sb.toString(); Iterator it = this.d.iterator(); while (it.hasNext()) { C17026tNn next = it.next(); StringBuilder sb2 = new StringBuilder(); sb2.append(obj); sb2.append(" "); sb2.append(next.r); obj = sb2.toString(); } StringBuilder sb3 = new StringBuilder(); sb3.append(obj); sb3.append(" >"); return sb3.toString(); } public final void b(int i, fGR fgr) { Iterator it = this.d.iterator(); while (it.hasNext()) { C17026tNn next = it.next(); if (!fgr.d.contains(next)) { fgr.d.add(next); } if (i == 0) { next.f = fgr.e; } else { next.af = fgr.e; } } this.g = fgr.e; } public final int a(Npn npn, ArrayList arrayList, int i) { int i2; int i3; WqU wqU = (WqU) arrayList.get(0).S; npn.a(); wqU.d(npn, false); for (int i4 = 0; i4 < arrayList.size(); i4++) { arrayList.get(i4).d(npn, false); } if (i == 0 && wqU.ar > 0) { C16308nMo.d(wqU, npn, arrayList, 0); } if (i == 1 && wqU.av > 0) { C16308nMo.d(wqU, npn, arrayList, 1); } try { npn.e(); } catch (Exception unused) { } this.f = new ArrayList<>(); for (int i5 = 0; i5 < arrayList.size(); i5++) { this.f.add(new RVV(this, arrayList.get(i5), i)); } if (i == 0) { EsB esB = wqU.D.h; i2 = esB != null ? (int) (esB.c + 0.5f) : 0; EsB esB2 = wqU.X.h; i3 = esB2 != null ? (int) (esB2.c + 0.5f) : 0; npn.a(); } else { EsB esB3 = wqU.V.h; i2 = esB3 != null ? (int) (esB3.c + 0.5f) : 0; EsB esB4 = wqU.n.h; i3 = esB4 != null ? (int) (esB4.c + 0.5f) : 0; npn.a(); } return i3 - i2; } public final void a(ArrayList arrayList) { int size = this.d.size(); if (this.g != -1 && size > 0) { for (int i = 0; i < arrayList.size(); i++) { fGR fgr = arrayList.get(i); if (this.g == fgr.e) { b(this.a, fgr); } } } if (size == 0) { arrayList.remove(this); } } /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes.dex */ public class RVV { private int a; private int b; private int c; final fGR d; private int e; private WeakReference f; private int h; private int j; public RVV(fGR fgr, C17026tNn c17026tNn, int i) { this.d = fgr; this.f = new WeakReference<>(c17026tNn); EsB esB = c17026tNn.D.h; this.b = esB != null ? (int) (esB.c + 0.5f) : 0; EsB esB2 = c17026tNn.V.h; this.h = esB2 != null ? (int) (esB2.c + 0.5f) : 0; EsB esB3 = c17026tNn.X.h; this.j = esB3 != null ? (int) (esB3.c + 0.5f) : 0; EsB esB4 = c17026tNn.n.h; this.e = esB4 != null ? (int) (esB4.c + 0.5f) : 0; EsB esB5 = c17026tNn.f9277o.h; this.a = esB5 != null ? (int) (esB5.c + 0.5f) : 0; this.c = i; } } }