package X6FRs_4.IMuAHx_6.EuDEkJe_12;

import android.view.View;
import android.view.ViewParent;
/* compiled from: NestedScrollingChildHelper.java */
/* loaded from: classes.dex */
public class KNBe_11 {
    public final View KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public ViewParent f374KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public boolean f375KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public int[] f376KQgRr5e_0;
    public ViewParent QxJ9d_1;

    public KNBe_11(View view) {
        this.KQgRr5e_0 = view;
    }

    public void KQgRr5e_0(boolean z) {
        if (this.f375KQgRr5e_0) {
            ZzDuCHW_20.m267PGPF6hQ_2(this.KQgRr5e_0);
        }
        this.f375KQgRr5e_0 = z;
    }

    public boolean QxJ9d_1() {
        return this.f375KQgRr5e_0;
    }

    public boolean QxJ9d_1(int i) {
        return KQgRr5e_0(i, 0);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public boolean m218KQgRr5e_0() {
        return m219KQgRr5e_0(0);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public boolean m219KQgRr5e_0(int i) {
        return KQgRr5e_0(i) != null;
    }

    public boolean KQgRr5e_0(int i, int i2) {
        if (m219KQgRr5e_0(i2)) {
            return true;
        }
        if (QxJ9d_1()) {
            View view = this.KQgRr5e_0;
            for (ViewParent parent = this.KQgRr5e_0.getParent(); parent != null; parent = parent.getParent()) {
                if (SI64pbG_23.m244KQgRr5e_0(parent, view, this.KQgRr5e_0, i, i2)) {
                    KQgRr5e_0(i2, parent);
                    SI64pbG_23.KQgRr5e_0(parent, view, this.KQgRr5e_0, i, i2);
                    return true;
                }
                if (parent instanceof View) {
                    view = (View) parent;
                }
            }
            return false;
        }
        return false;
    }

    public void KQgRr5e_0() {
        m217KQgRr5e_0(0);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public void m217KQgRr5e_0(int i) {
        ViewParent KQgRr5e_0 = KQgRr5e_0(i);
        if (KQgRr5e_0 != null) {
            SI64pbG_23.KQgRr5e_0(KQgRr5e_0, this.KQgRr5e_0, i);
            KQgRr5e_0(i, (ViewParent) null);
        }
    }

    public boolean KQgRr5e_0(int i, int i2, int i3, int i4, int[] iArr) {
        return m220KQgRr5e_0(i, i2, i3, i4, iArr, 0, (int[]) null);
    }

    public boolean KQgRr5e_0(int i, int i2, int i3, int i4, int[] iArr, int i5) {
        return m220KQgRr5e_0(i, i2, i3, i4, iArr, i5, (int[]) null);
    }

    public void KQgRr5e_0(int i, int i2, int i3, int i4, int[] iArr, int i5, int[] iArr2) {
        m220KQgRr5e_0(i, i2, i3, i4, iArr, i5, iArr2);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public final boolean m220KQgRr5e_0(int i, int i2, int i3, int i4, int[] iArr, int i5, int[] iArr2) {
        ViewParent KQgRr5e_0;
        int i6;
        int i7;
        int[] iArr3;
        if (!QxJ9d_1() || (KQgRr5e_0 = KQgRr5e_0(i5)) == null) {
            return false;
        }
        if (i == 0 && i2 == 0 && i3 == 0 && i4 == 0) {
            if (iArr != null) {
                iArr[0] = 0;
                iArr[1] = 0;
            }
            return false;
        }
        if (iArr != null) {
            this.KQgRr5e_0.getLocationInWindow(iArr);
            i6 = iArr[0];
            i7 = iArr[1];
        } else {
            i6 = 0;
            i7 = 0;
        }
        if (iArr2 == null) {
            int[] m221KQgRr5e_0 = m221KQgRr5e_0();
            m221KQgRr5e_0[0] = 0;
            m221KQgRr5e_0[1] = 0;
            iArr3 = m221KQgRr5e_0;
        } else {
            iArr3 = iArr2;
        }
        SI64pbG_23.KQgRr5e_0(KQgRr5e_0, this.KQgRr5e_0, i, i2, i3, i4, i5, iArr3);
        if (iArr != null) {
            this.KQgRr5e_0.getLocationInWindow(iArr);
            iArr[0] = iArr[0] - i6;
            iArr[1] = iArr[1] - i7;
        }
        return true;
    }

    public boolean KQgRr5e_0(int i, int i2, int[] iArr, int[] iArr2) {
        return KQgRr5e_0(i, i2, iArr, iArr2, 0);
    }

    public boolean KQgRr5e_0(int i, int i2, int[] iArr, int[] iArr2, int i3) {
        ViewParent KQgRr5e_0;
        int i4;
        int i5;
        if (!QxJ9d_1() || (KQgRr5e_0 = KQgRr5e_0(i3)) == null) {
            return false;
        }
        if (i == 0 && i2 == 0) {
            if (iArr2 != null) {
                iArr2[0] = 0;
                iArr2[1] = 0;
                return false;
            }
            return false;
        }
        if (iArr2 != null) {
            this.KQgRr5e_0.getLocationInWindow(iArr2);
            i4 = iArr2[0];
            i5 = iArr2[1];
        } else {
            i4 = 0;
            i5 = 0;
        }
        if (iArr == null) {
            iArr = m221KQgRr5e_0();
        }
        iArr[0] = 0;
        iArr[1] = 0;
        SI64pbG_23.KQgRr5e_0(KQgRr5e_0, this.KQgRr5e_0, i, i2, iArr, i3);
        if (iArr2 != null) {
            this.KQgRr5e_0.getLocationInWindow(iArr2);
            iArr2[0] = iArr2[0] - i4;
            iArr2[1] = iArr2[1] - i5;
        }
        return (iArr[0] == 0 && iArr[1] == 0) ? false : true;
    }

    public boolean KQgRr5e_0(float f, float f2, boolean z) {
        ViewParent KQgRr5e_0;
        if (!QxJ9d_1() || (KQgRr5e_0 = KQgRr5e_0(0)) == null) {
            return false;
        }
        return SI64pbG_23.KQgRr5e_0(KQgRr5e_0, this.KQgRr5e_0, f, f2, z);
    }

    public boolean KQgRr5e_0(float f, float f2) {
        ViewParent KQgRr5e_0;
        if (!QxJ9d_1() || (KQgRr5e_0 = KQgRr5e_0(0)) == null) {
            return false;
        }
        return SI64pbG_23.KQgRr5e_0(KQgRr5e_0, this.KQgRr5e_0, f, f2);
    }

    public final ViewParent KQgRr5e_0(int i) {
        if (i != 0) {
            if (i != 1) {
                return null;
            }
            return this.QxJ9d_1;
        }
        return this.f374KQgRr5e_0;
    }

    public final void KQgRr5e_0(int i, ViewParent viewParent) {
        if (i == 0) {
            this.f374KQgRr5e_0 = viewParent;
        } else if (i != 1) {
        } else {
            this.QxJ9d_1 = viewParent;
        }
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public final int[] m221KQgRr5e_0() {
        if (this.f376KQgRr5e_0 == null) {
            this.f376KQgRr5e_0 = new int[2];
        }
        return this.f376KQgRr5e_0;
    }
}
