package ῲ.ᨨ.ᨨ;

import android.os.Build;
import android.util.Log;
import android.view.View;
import android.view.ViewParent;
import K.K.K.ʬ.C2369;

/* renamed from: ῲ.ᨨ.ᨨ.㿎  reason: contains not printable characters */
/* compiled from: NestedScrollingChildHelper */
public class C1775 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final View f6114;

    /* renamed from: ඓ  reason: contains not printable characters */
    public int[] f6115;

    /* renamed from: ῲ  reason: contains not printable characters */
    public ViewParent f6116;

    /* renamed from: K  reason: contains not printable characters */
    public ViewParent f6117;

    /* renamed from: 㸾  reason: contains not printable characters */
    public boolean f6118;

    public C1775(View view) {
        this.f6114 = view;
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public void m4624(int i) {
        ViewParent r0 = m4627(i);
        if (r0 != null) {
            View view = this.f6114;
            if (r0 instanceof AbstractC1742) {
                ((AbstractC1742) r0).onStopNestedScroll(view, i);
            } else if (i == 0) {
                int i2 = Build.VERSION.SDK_INT;
                try {
                    r0.onStopNestedScroll(view);
                } catch (AbstractMethodError e) {
                    Log.e("ViewParentCompat", "ViewParent " + r0 + " does not implement interface method onStopNestedScroll", e);
                }
            }
            if (i == 0) {
                this.f6117 = null;
            } else if (i == 1) {
                this.f6116 = null;
            }
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public final boolean m4626(int i, int i2, int i3, int i4, int[] iArr, int i5, int[] iArr2) {
        ViewParent r8;
        int i6;
        int i7;
        int[] iArr3;
        if (!this.f6118 || (r8 = m4627(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.f6114.getLocationInWindow(iArr);
            i7 = iArr[0];
            i6 = iArr[1];
        } else {
            i7 = 0;
            i6 = 0;
        }
        if (iArr2 == null) {
            if (this.f6115 == null) {
                this.f6115 = new int[2];
            }
            int[] iArr4 = this.f6115;
            iArr4[0] = 0;
            iArr4[1] = 0;
            iArr3 = iArr4;
        } else {
            iArr3 = iArr2;
        }
        View view = this.f6114;
        if (r8 instanceof AbstractC1767) {
            ((AbstractC1767) r8).onNestedScroll(view, i, i2, i3, i4, i5, iArr3);
        } else {
            iArr3[0] = iArr3[0] + i3;
            iArr3[1] = iArr3[1] + i4;
            if (r8 instanceof AbstractC1742) {
                ((AbstractC1742) r8).onNestedScroll(view, i, i2, i3, i4, i5);
            } else if (i5 == 0) {
                int i8 = Build.VERSION.SDK_INT;
                try {
                    r8.onNestedScroll(view, i, i2, i3, i4);
                } catch (AbstractMethodError e) {
                    Log.e("ViewParentCompat", "ViewParent " + r8 + " does not implement interface method onNestedScroll", e);
                }
            }
        }
        if (iArr != null) {
            this.f6114.getLocationInWindow(iArr);
            iArr[0] = iArr[0] - i7;
            iArr[1] = iArr[1] - i6;
        }
        return true;
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m4631(float f, float f2, boolean z) {
        ViewParent r0;
        if (!this.f6118 || (r0 = m4627(0)) == null) {
            return false;
        }
        return C2369.m6341(r0, this.f6114, f, f2, z);
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m4630(float f, float f2) {
        ViewParent r0;
        if (!this.f6118 || (r0 = m4627(0)) == null) {
            return false;
        }
        View view = this.f6114;
        int i = Build.VERSION.SDK_INT;
        try {
            return r0.onNestedPreFling(view, f, f2);
        } catch (AbstractMethodError e) {
            Log.e("ViewParentCompat", "ViewParent " + r0 + " does not implement interface method onNestedPreFling", e);
            return false;
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m4635(int i, int i2, int[] iArr, int[] iArr2, int i3) {
        ViewParent r2;
        int i4;
        int i5;
        int[] iArr3;
        if (!this.f6118 || (r2 = m4627(i3)) == null) {
            return false;
        }
        if (i == 0 && i2 == 0) {
            if (iArr2 != null) {
                iArr2[0] = 0;
                iArr2[1] = 0;
            }
            return false;
        }
        if (iArr2 != null) {
            this.f6114.getLocationInWindow(iArr2);
            i5 = iArr2[0];
            i4 = iArr2[1];
        } else {
            i5 = 0;
            i4 = 0;
        }
        if (iArr == null) {
            if (this.f6115 == null) {
                this.f6115 = new int[2];
            }
            iArr3 = this.f6115;
        } else {
            iArr3 = iArr;
        }
        iArr3[0] = 0;
        iArr3[1] = 0;
        View view = this.f6114;
        if (r2 instanceof AbstractC1742) {
            ((AbstractC1742) r2).onNestedPreScroll(view, i, i2, iArr3, i3);
        } else if (i3 == 0) {
            int i6 = Build.VERSION.SDK_INT;
            try {
                r2.onNestedPreScroll(view, i, i2, iArr3);
            } catch (AbstractMethodError e) {
                Log.e("ViewParentCompat", "ViewParent " + r2 + " does not implement interface method onNestedPreScroll", e);
            }
        }
        if (iArr2 != null) {
            this.f6114.getLocationInWindow(iArr2);
            iArr2[0] = iArr2[0] - i5;
            iArr2[1] = iArr2[1] - i4;
        }
        if (iArr3[0] == 0 && iArr3[1] == 0) {
            return false;
        }
        return true;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public boolean m4625(int i) {
        return m4627(i) != null;
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m4629() {
        return m4625(0);
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m4632(int i, int i2) {
        boolean z;
        if (m4627(i2) != null) {
            return true;
        }
        if (this.f6118) {
            View view = this.f6114;
            for (ViewParent parent = this.f6114.getParent(); parent != null; parent = parent.getParent()) {
                View view2 = this.f6114;
                boolean z2 = parent instanceof AbstractC1742;
                if (z2) {
                    z = ((AbstractC1742) parent).onStartNestedScroll(view, view2, i, i2);
                } else {
                    if (i2 == 0) {
                        int i3 = Build.VERSION.SDK_INT;
                        try {
                            z = parent.onStartNestedScroll(view, view2, i);
                        } catch (AbstractMethodError e) {
                            Log.e("ViewParentCompat", "ViewParent " + parent + " does not implement interface method onStartNestedScroll", e);
                        }
                    }
                    z = false;
                }
                if (z) {
                    if (i2 == 0) {
                        this.f6117 = parent;
                    } else if (i2 == 1) {
                        this.f6116 = parent;
                    }
                    View view3 = this.f6114;
                    if (z2) {
                        ((AbstractC1742) parent).onNestedScrollAccepted(view, view3, i, i2);
                    } else if (i2 == 0) {
                        int i4 = Build.VERSION.SDK_INT;
                        try {
                            parent.onNestedScrollAccepted(view, view3, i);
                        } catch (AbstractMethodError e2) {
                            Log.e("ViewParentCompat", "ViewParent " + parent + " does not implement interface method onNestedScrollAccepted", e2);
                        }
                    }
                    return true;
                }
                if (parent instanceof View) {
                    view = (View) parent;
                }
            }
        }
        return false;
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m4633(int i, int i2, int i3, int i4, int[] iArr) {
        return m4626(i, i2, i3, i4, iArr, 0, null);
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m4628(int i, int i2, int i3, int i4, int[] iArr, int i5, int[] iArr2) {
        m4626(i, i2, i3, i4, iArr, i5, iArr2);
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m4634(int i, int i2, int[] iArr, int[] iArr2) {
        return m4635(i, i2, iArr, iArr2, 0);
    }

    /* renamed from: K  reason: contains not printable characters */
    public final ViewParent m4627(int i) {
        if (i == 0) {
            return this.f6117;
        }
        if (i != 1) {
            return null;
        }
        return this.f6116;
    }
}
