package b.e.a.j;

import b.e.a.j.c;

/* JADX INFO: loaded from: classes.dex */
public class f extends d {
    public float r0 = -1.0f;
    public int s0 = -1;
    public int t0 = -1;
    public c u0 = this.K;
    public int v0 = 0;
    public boolean w0;

    public f() {
        this.S.clear();
        this.S.add(this.u0);
        int length = this.R.length;
        for (int i = 0; i < length; i++) {
            this.R[i] = this.u0;
        }
    }

    @Override // b.e.a.j.d
    public boolean D() {
        return this.w0;
    }

    @Override // b.e.a.j.d
    public boolean E() {
        return this.w0;
    }

    @Override // b.e.a.j.d
    public void U(b.e.a.d dVar, boolean z) {
        if (this.V == null) {
            return;
        }
        int iO = dVar.o(this.u0);
        if (this.v0 == 1) {
            this.a0 = iO;
            this.b0 = 0;
            N(this.V.l());
            S(0);
            return;
        }
        this.a0 = 0;
        this.b0 = iO;
        S(this.V.u());
        N(0);
    }

    public void V(int i) {
        c cVar = this.u0;
        cVar.f740b = i;
        cVar.f741c = true;
        this.w0 = true;
    }

    public void W(int i) {
        if (this.v0 == i) {
            return;
        }
        this.v0 = i;
        this.S.clear();
        this.u0 = this.v0 == 1 ? this.J : this.K;
        this.S.add(this.u0);
        int length = this.R.length;
        for (int i2 = 0; i2 < length; i2++) {
            this.R[i2] = this.u0;
        }
    }

    @Override // b.e.a.j.d
    public void d(b.e.a.d dVar, boolean z) {
        b.e.a.h hVarL;
        e eVar = (e) this.V;
        if (eVar == null) {
            return;
        }
        Object objI = eVar.i(c.a.LEFT);
        Object objI2 = eVar.i(c.a.RIGHT);
        d dVar2 = this.V;
        boolean z2 = dVar2 != null && dVar2.U[0] == 2;
        if (this.v0 == 0) {
            objI = eVar.i(c.a.TOP);
            objI2 = eVar.i(c.a.BOTTOM);
            d dVar3 = this.V;
            z2 = dVar3 != null && dVar3.U[1] == 2;
        }
        if (this.w0) {
            c cVar = this.u0;
            if (cVar.f741c) {
                b.e.a.h hVarL2 = dVar.l(cVar);
                dVar.e(hVarL2, this.u0.c());
                if (this.s0 != -1) {
                    if (z2) {
                        hVarL = dVar.l(objI2);
                        dVar.f(hVarL, hVarL2, 0, 5);
                    }
                } else if (this.t0 != -1 && z2) {
                    b.e.a.h hVarL3 = dVar.l(objI2);
                    dVar.f(hVarL2, dVar.l(objI), 0, 5);
                    hVarL = hVarL3;
                    dVar.f(hVarL, hVarL2, 0, 5);
                }
                this.w0 = false;
                return;
            }
        }
        if (this.s0 != -1) {
            b.e.a.h hVarL4 = dVar.l(this.u0);
            dVar.d(hVarL4, dVar.l(objI), this.s0, 8);
            if (z2) {
                dVar.f(dVar.l(objI2), hVarL4, 0, 5);
                return;
            }
            return;
        }
        if (this.t0 != -1) {
            b.e.a.h hVarL5 = dVar.l(this.u0);
            b.e.a.h hVarL6 = dVar.l(objI2);
            dVar.d(hVarL5, hVarL6, -this.t0, 8);
            if (z2) {
                dVar.f(hVarL5, dVar.l(objI), 0, 5);
                dVar.f(hVarL6, hVarL5, 0, 5);
                return;
            }
            return;
        }
        if (this.r0 != -1.0f) {
            b.e.a.h hVarL7 = dVar.l(this.u0);
            b.e.a.h hVarL8 = dVar.l(objI2);
            float f2 = this.r0;
            b.e.a.b bVarM = dVar.m();
            bVarM.f703d.j(hVarL7, -1.0f);
            bVarM.f703d.j(hVarL8, f2);
            dVar.c(bVarM);
        }
    }

    @Override // b.e.a.j.d
    public boolean e() {
        return true;
    }

    @Override // b.e.a.j.d
    public c i(c.a aVar) {
        int iOrdinal = aVar.ordinal();
        if (iOrdinal != 1) {
            if (iOrdinal != 2) {
                if (iOrdinal != 3) {
                    if (iOrdinal != 4) {
                        return null;
                    }
                }
            }
            if (this.v0 == 0) {
                return this.u0;
            }
            return null;
        }
        if (this.v0 == 1) {
            return this.u0;
        }
        return null;
    }
}
