package androidx.core.widget;

import android.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.os.Build;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.FocusFinder;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.animation.AnimationUtils;
import android.widget.EdgeEffect;
import android.widget.FrameLayout;
import android.widget.OverScroller;
import defpackage.AbstractC2873;
import defpackage.AbstractC4299;
import defpackage.AbstractC5345;
import defpackage.C2657;
import defpackage.C2754;
import defpackage.C3064;
import defpackage.C3096;
import defpackage.C4168;
import defpackage.C4697;
import defpackage.InterfaceC1648;
import defpackage.InterfaceC2902;
import j$.util.Objects;
import java.util.WeakHashMap;

/* loaded from: classes3.dex */
public class NestedScrollView extends FrameLayout implements InterfaceC1648 {

    /* renamed from: ˎᵬˀ, reason: contains not printable characters */
    public static final float f298 = (float) (Math.log(0.78d) / Math.log(0.9d));

    /* renamed from: ᵫᵮʾ, reason: contains not printable characters */
    public static final C2657 f299 = new C2657();

    /* renamed from: ᵽʛ, reason: contains not printable characters */
    public static final int[] f300 = {R.attr.fillViewport};

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public C2754 f301;

    /* renamed from: ˀᵗᵩ, reason: contains not printable characters */
    public int f302;

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public final int f303;

    /* renamed from: ˆᵼᵷˊ, reason: contains not printable characters */
    public int f304;

    /* renamed from: ˊʽˎ, reason: contains not printable characters */
    public final C3064 f305;

    /* renamed from: ˊᵸˊ, reason: contains not printable characters */
    public final int[] f306;

    /* renamed from: ˌᵪ, reason: contains not printable characters */
    public final C4697 f307;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public boolean f308;

    /* renamed from: ˑᵝﹳᵜ, reason: contains not printable characters */
    public final int[] f309;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public boolean f310;

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public boolean f311;

    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public final int f312;

    /* renamed from: ᵛˈᵤ, reason: contains not printable characters */
    public C4168 f313;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public int f314;

    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public int f315;

    /* renamed from: ᵡᵶᵡ, reason: contains not printable characters */
    public float f316;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public final EdgeEffect f317;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public long f318;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final EdgeEffect f319;

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public boolean f320;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final float f321;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public View f322;

    /* renamed from: ᵳᵹᵺˋ, reason: contains not printable characters */
    public final C3096 f323;

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public boolean f324;

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public VelocityTracker f325;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final OverScroller f326;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final Rect f327;

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public final int f328;

    public NestedScrollView(Context context) {
        this(context, null);
    }

    public NestedScrollView(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, ar.tvplayer.tv.R.attr._11_res_0x7f04049d);
    }

    public NestedScrollView(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        this.f327 = new Rect();
        this.f310 = true;
        this.f308 = false;
        this.f322 = null;
        this.f320 = false;
        this.f324 = true;
        this.f315 = -1;
        this.f309 = new int[2];
        this.f306 = new int[2];
        this.f305 = new C3064(getContext(), new ᵿʤˑᵦ(10, this));
        int i2 = Build.VERSION.SDK_INT;
        this.f319 = i2 >= 31 ? AbstractC4299.m9276(context, attributeSet) : new EdgeEffect(context);
        this.f317 = i2 >= 31 ? AbstractC4299.m9276(context, attributeSet) : new EdgeEffect(context);
        this.f321 = context.getResources().getDisplayMetrics().density * 160.0f * 386.0878f * 0.84f;
        this.f326 = new OverScroller(getContext());
        setFocusable(true);
        setDescendantFocusability(262144);
        setWillNotDraw(false);
        ViewConfiguration viewConfiguration = ViewConfiguration.get(getContext());
        this.f303 = viewConfiguration.getScaledTouchSlop();
        this.f328 = viewConfiguration.getScaledMinimumFlingVelocity();
        this.f312 = viewConfiguration.getScaledMaximumFlingVelocity();
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, f300, i, 0);
        setFillViewport(typedArrayObtainStyledAttributes.getBoolean(0, false));
        typedArrayObtainStyledAttributes.recycle();
        this.f307 = new C4697((byte) 0, 4);
        this.f323 = new C3096(this);
        setNestedScrollingEnabled(true);
        AbstractC2873.m7026(this, f299);
    }

    private C2754 getScrollFeedbackProvider() {
        if (this.f301 == null) {
            this.f301 = new C2754(this);
        }
        return this.f301;
    }

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public static boolean m77(View view, NestedScrollView nestedScrollView) {
        if (view == nestedScrollView) {
            return true;
        }
        Object parent = view.getParent();
        return (parent instanceof ViewGroup) && m77((View) parent, nestedScrollView);
    }

    @Override // android.view.ViewGroup
    public final void addView(View view) {
        if (getChildCount() <= 0) {
            super.addView(view);
        } else {
            ᵹˉᵞ.ᵳٴᵶ("ScrollView can host only one direct child");
        }
    }

    @Override // android.view.ViewGroup
    public final void addView(View view, int i) {
        if (getChildCount() <= 0) {
            super.addView(view, i);
        } else {
            ᵹˉᵞ.ᵳٴᵶ("ScrollView can host only one direct child");
        }
    }

    @Override // android.view.ViewGroup
    public final void addView(View view, int i, ViewGroup.LayoutParams layoutParams) {
        if (getChildCount() <= 0) {
            super.addView(view, i, layoutParams);
        } else {
            ᵹˉᵞ.ᵳٴᵶ("ScrollView can host only one direct child");
        }
    }

    @Override // android.view.ViewGroup, android.view.ViewManager
    public final void addView(View view, ViewGroup.LayoutParams layoutParams) {
        if (getChildCount() <= 0) {
            super.addView(view, layoutParams);
        } else {
            ᵹˉᵞ.ᵳٴᵶ("ScrollView can host only one direct child");
        }
    }

    @Override // android.view.View
    public final int computeHorizontalScrollExtent() {
        return super.computeHorizontalScrollExtent();
    }

    @Override // android.view.View
    public final int computeHorizontalScrollOffset() {
        return super.computeHorizontalScrollOffset();
    }

    @Override // android.view.View
    public final int computeHorizontalScrollRange() {
        return super.computeHorizontalScrollRange();
    }

    /* JADX WARN: Removed duplicated region for block: B:22:0x0083  */
    /* JADX WARN: Removed duplicated region for block: B:24:0x0090  */
    /* JADX WARN: Removed duplicated region for block: B:26:0x00b6  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x00eb  */
    /* JADX WARN: Removed duplicated region for block: B:42:0x00ef  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void computeScroll() {
        /*
            Method dump skipped, instructions count: 243
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.core.widget.NestedScrollView.computeScroll():void");
    }

    @Override // android.view.View
    public final int computeVerticalScrollExtent() {
        return super.computeVerticalScrollExtent();
    }

    @Override // android.view.View
    public final int computeVerticalScrollOffset() {
        return Math.max(0, super.computeVerticalScrollOffset());
    }

    @Override // android.view.View
    public final int computeVerticalScrollRange() {
        int childCount = getChildCount();
        int height = (getHeight() - getPaddingBottom()) - getPaddingTop();
        if (childCount == 0) {
            return height;
        }
        View childAt = getChildAt(0);
        int bottom = childAt.getBottom() + ((FrameLayout.LayoutParams) childAt.getLayoutParams()).bottomMargin;
        int scrollY = getScrollY();
        int iMax = Math.max(0, bottom - height);
        return scrollY < 0 ? bottom - scrollY : scrollY > iMax ? (scrollY - iMax) + bottom : bottom;
    }

    @Override // android.view.ViewGroup, android.view.View
    public final boolean dispatchKeyEvent(KeyEvent keyEvent) {
        return super.dispatchKeyEvent(keyEvent) || m81(keyEvent);
    }

    @Override // android.view.View
    public final boolean dispatchNestedFling(float f, float f2, boolean z) {
        ViewParent viewParentM7432;
        C3096 c3096 = this.f323;
        if (c3096.f11806 && (viewParentM7432 = c3096.m7432(0)) != null) {
            try {
                return viewParentM7432.onNestedFling(c3096.f11803, f, f2, z);
            } catch (AbstractMethodError unused) {
                Objects.toString(viewParentM7432);
            }
        }
        return false;
    }

    @Override // android.view.View
    public final boolean dispatchNestedPreFling(float f, float f2) {
        return this.f323.m7430(f, f2);
    }

    @Override // android.view.View
    public final boolean dispatchNestedPreScroll(int i, int i2, int[] iArr, int[] iArr2) {
        return this.f323.m7431(i, i2, 0, iArr, iArr2);
    }

    @Override // android.view.View
    public final boolean dispatchNestedScroll(int i, int i2, int i3, int i4, int[] iArr) {
        return this.f323.m7429(i, i2, i3, i4, iArr, 0, null);
    }

    @Override // android.view.View
    public final void draw(Canvas canvas) {
        int paddingLeft;
        super.draw(canvas);
        int scrollY = getScrollY();
        EdgeEffect edgeEffect = this.f319;
        int paddingLeft2 = 0;
        if (!edgeEffect.isFinished()) {
            int iSave = canvas.save();
            int width = getWidth();
            int height = getHeight();
            int iMin = Math.min(0, scrollY);
            if (getClipToPadding()) {
                width -= getPaddingRight() + getPaddingLeft();
                paddingLeft = getPaddingLeft();
                height -= getPaddingBottom() + getPaddingTop();
                iMin += getPaddingTop();
            } else {
                paddingLeft = 0;
            }
            canvas.translate(paddingLeft, iMin);
            edgeEffect.setSize(width, height);
            if (edgeEffect.draw(canvas)) {
                postInvalidateOnAnimation();
            }
            canvas.restoreToCount(iSave);
        }
        EdgeEffect edgeEffect2 = this.f317;
        if (edgeEffect2.isFinished()) {
            return;
        }
        int iSave2 = canvas.save();
        int width2 = getWidth();
        int height2 = getHeight();
        int iMax = Math.max(getScrollRange(), scrollY) + height2;
        if (getClipToPadding()) {
            width2 -= getPaddingRight() + getPaddingLeft();
            paddingLeft2 = getPaddingLeft();
        }
        if (getClipToPadding()) {
            height2 -= getPaddingBottom() + getPaddingTop();
            iMax -= getPaddingBottom();
        }
        canvas.translate(paddingLeft2 - width2, iMax);
        canvas.rotate(180.0f, width2, 0.0f);
        edgeEffect2.setSize(width2, height2);
        if (edgeEffect2.draw(canvas)) {
            postInvalidateOnAnimation();
        }
        canvas.restoreToCount(iSave2);
    }

    @Override // android.view.View
    public float getBottomFadingEdgeStrength() {
        if (getChildCount() == 0) {
            return 0.0f;
        }
        View childAt = getChildAt(0);
        FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) childAt.getLayoutParams();
        int verticalFadingEdgeLength = getVerticalFadingEdgeLength();
        int bottom = ((childAt.getBottom() + layoutParams.bottomMargin) - getScrollY()) - (getHeight() - getPaddingBottom());
        if (bottom < verticalFadingEdgeLength) {
            return bottom / verticalFadingEdgeLength;
        }
        return 1.0f;
    }

    public int getMaxScrollAmount() {
        return (int) (getHeight() * 0.5f);
    }

    @Override // android.view.ViewGroup
    public int getNestedScrollAxes() {
        C4697 c4697 = this.f307;
        return c4697.f17369 | c4697.f17367;
    }

    public int getScrollRange() {
        if (getChildCount() <= 0) {
            return 0;
        }
        View childAt = getChildAt(0);
        FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) childAt.getLayoutParams();
        return Math.max(0, ((childAt.getHeight() + layoutParams.topMargin) + layoutParams.bottomMargin) - ((getHeight() - getPaddingTop()) - getPaddingBottom()));
    }

    @Override // android.view.View
    public float getTopFadingEdgeStrength() {
        if (getChildCount() == 0) {
            return 0.0f;
        }
        int verticalFadingEdgeLength = getVerticalFadingEdgeLength();
        int scrollY = getScrollY();
        if (scrollY < verticalFadingEdgeLength) {
            return scrollY / verticalFadingEdgeLength;
        }
        return 1.0f;
    }

    public float getVerticalScrollFactorCompat() {
        if (this.f316 == 0.0f) {
            TypedValue typedValue = new TypedValue();
            Context context = getContext();
            if (!context.getTheme().resolveAttribute(R.attr.listPreferredItemHeight, typedValue, true)) {
                ᵹˉᵞ.ᵳٴᵶ("Expected theme to define listPreferredItemHeight.");
                return 0.0f;
            }
            this.f316 = typedValue.getDimension(context.getResources().getDisplayMetrics());
        }
        return this.f316;
    }

    @Override // android.view.View
    public final boolean hasNestedScrollingParent() {
        return this.f323.m7426(0);
    }

    @Override // android.view.View
    public final boolean isNestedScrollingEnabled() {
        return this.f323.f11806;
    }

    @Override // android.view.ViewGroup
    public final void measureChild(View view, int i, int i2) {
        ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
        view.measure(ViewGroup.getChildMeasureSpec(i, getPaddingRight() + getPaddingLeft(), layoutParams.width), View.MeasureSpec.makeMeasureSpec(0, 0));
    }

    @Override // android.view.ViewGroup
    public final void measureChildWithMargins(View view, int i, int i2, int i3, int i4) {
        ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
        view.measure(ViewGroup.getChildMeasureSpec(i, getPaddingRight() + getPaddingLeft() + marginLayoutParams.leftMargin + marginLayoutParams.rightMargin + i2, marginLayoutParams.width), View.MeasureSpec.makeMeasureSpec(marginLayoutParams.topMargin + marginLayoutParams.bottomMargin, 0));
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void onAttachedToWindow() {
        super.onAttachedToWindow();
        this.f308 = false;
    }

    @Override // android.view.View
    public final boolean onGenericMotionEvent(MotionEvent motionEvent) {
        int i;
        int width;
        float axisValue;
        if (motionEvent.getAction() == 8 && !this.f320) {
            if (ˀʾˀᵛ.ᵸʓᵠ(motionEvent, 2)) {
                axisValue = motionEvent.getAxisValue(9);
                i = 9;
                width = (int) motionEvent.getX();
            } else if (ˀʾˀᵛ.ᵸʓᵠ(motionEvent, 4194304)) {
                float axisValue2 = motionEvent.getAxisValue(26);
                width = getWidth() / 2;
                i = 26;
                axisValue = axisValue2;
            } else {
                i = 0;
                width = 0;
                axisValue = 0.0f;
            }
            if (axisValue != 0.0f) {
                m82(-((int) (getVerticalScrollFactorCompat() * axisValue)), i, motionEvent, width, 1, ˀʾˀᵛ.ᵸʓᵠ(motionEvent, 8194));
                if (i == 0) {
                    return true;
                }
                this.f305.m7389(motionEvent, i);
                return true;
            }
        }
        return false;
    }

    /* JADX WARN: Removed duplicated region for block: B:34:0x006b  */
    /* JADX WARN: Removed duplicated region for block: B:62:0x00ff  */
    @Override // android.view.ViewGroup
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean onInterceptTouchEvent(android.view.MotionEvent r13) {
        /*
            Method dump skipped, instructions count: 283
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.core.widget.NestedScrollView.onInterceptTouchEvent(android.view.MotionEvent):boolean");
    }

    @Override // android.widget.FrameLayout, android.view.ViewGroup, android.view.View
    public final void onLayout(boolean z, int i, int i2, int i3, int i4) {
        int measuredHeight;
        super.onLayout(z, i, i2, i3, i4);
        int i5 = 0;
        this.f310 = false;
        View view = this.f322;
        if (view != null && m77(view, this)) {
            View view2 = this.f322;
            Rect rect = this.f327;
            view2.getDrawingRect(rect);
            offsetDescendantRectToMyCoords(view2, rect);
            int iM93 = m93(rect);
            if (iM93 != 0) {
                scrollBy(0, iM93);
            }
        }
        this.f322 = null;
        if (!this.f308) {
            if (this.f313 != null) {
                scrollTo(getScrollX(), this.f313.f15580);
                this.f313 = null;
            }
            if (getChildCount() > 0) {
                View childAt = getChildAt(0);
                FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) childAt.getLayoutParams();
                measuredHeight = childAt.getMeasuredHeight() + layoutParams.topMargin + layoutParams.bottomMargin;
            } else {
                measuredHeight = 0;
            }
            int paddingTop = ((i4 - i2) - getPaddingTop()) - getPaddingBottom();
            int scrollY = getScrollY();
            if (paddingTop < measuredHeight && scrollY >= 0) {
                i5 = paddingTop + scrollY > measuredHeight ? measuredHeight - paddingTop : scrollY;
            }
            if (i5 != scrollY) {
                scrollTo(getScrollX(), i5);
            }
        }
        scrollTo(getScrollX(), getScrollY());
        this.f308 = true;
    }

    @Override // android.widget.FrameLayout, android.view.View
    public final void onMeasure(int i, int i2) {
        super.onMeasure(i, i2);
        if (this.f311 && View.MeasureSpec.getMode(i2) != 0 && getChildCount() > 0) {
            View childAt = getChildAt(0);
            FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) childAt.getLayoutParams();
            int measuredHeight = childAt.getMeasuredHeight();
            int measuredHeight2 = (((getMeasuredHeight() - getPaddingTop()) - getPaddingBottom()) - layoutParams.topMargin) - layoutParams.bottomMargin;
            if (measuredHeight < measuredHeight2) {
                childAt.measure(ViewGroup.getChildMeasureSpec(i, getPaddingRight() + getPaddingLeft() + layoutParams.leftMargin + layoutParams.rightMargin, layoutParams.width), View.MeasureSpec.makeMeasureSpec(measuredHeight2, 1073741824));
            }
        }
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final boolean onNestedFling(View view, float f, float f2, boolean z) {
        if (z) {
            return false;
        }
        dispatchNestedFling(0.0f, f2, true);
        m90((int) f2);
        return true;
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final boolean onNestedPreFling(View view, float f, float f2) {
        return this.f323.m7430(f, f2);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void onNestedPreScroll(View view, int i, int i2, int[] iArr) {
        this.f323.m7431(i, i2, 0, iArr, null);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void onNestedScroll(View view, int i, int i2, int i3, int i4) {
        m87(null, i4, 0);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void onNestedScrollAccepted(View view, View view2, int i) {
        mo20(view, view2, i, 0);
    }

    @Override // android.view.View
    public final void onOverScrolled(int i, int i2, boolean z, boolean z2) {
        super.scrollTo(i, i2);
    }

    @Override // android.view.ViewGroup
    public final boolean onRequestFocusInDescendants(int i, Rect rect) {
        if (i == 2) {
            i = 130;
        } else if (i == 1) {
            i = 33;
        }
        View viewFindNextFocus = rect == null ? FocusFinder.getInstance().findNextFocus(this, null, i) : FocusFinder.getInstance().findNextFocusFromRect(this, rect, i);
        if (viewFindNextFocus != null && m88(viewFindNextFocus, 0, getHeight())) {
            return viewFindNextFocus.requestFocus(i, rect);
        }
        return false;
    }

    @Override // android.view.View
    public final void onRestoreInstanceState(Parcelable parcelable) {
        if (!(parcelable instanceof C4168)) {
            super.onRestoreInstanceState(parcelable);
            return;
        }
        C4168 c4168 = (C4168) parcelable;
        super.onRestoreInstanceState(c4168.getSuperState());
        this.f313 = c4168;
        requestLayout();
    }

    @Override // android.view.View
    public final Parcelable onSaveInstanceState() {
        C4168 c4168 = new C4168(super.onSaveInstanceState());
        c4168.f15580 = getScrollY();
        return c4168;
    }

    @Override // android.view.View
    public final void onScrollChanged(int i, int i2, int i3, int i4) {
        super.onScrollChanged(i, i2, i3, i4);
    }

    @Override // android.view.View
    public final void onSizeChanged(int i, int i2, int i3, int i4) {
        super.onSizeChanged(i, i2, i3, i4);
        View viewFindFocus = findFocus();
        if (viewFindFocus == null || this == viewFindFocus || !m88(viewFindFocus, 0, i4)) {
            return;
        }
        Rect rect = this.f327;
        viewFindFocus.getDrawingRect(rect);
        offsetDescendantRectToMyCoords(viewFindFocus, rect);
        int iM93 = m93(rect);
        if (iM93 != 0) {
            if (this.f324) {
                m80(0, iM93, false);
            } else {
                scrollBy(0, iM93);
            }
        }
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final boolean onStartNestedScroll(View view, View view2, int i) {
        return mo30(view, view2, i, 0);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void onStopNestedScroll(View view) {
        mo23(view, 0);
    }

    /* JADX WARN: Removed duplicated region for block: B:49:0x0106  */
    /* JADX WARN: Removed duplicated region for block: B:52:0x010e  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x012a  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean onTouchEvent(android.view.MotionEvent r21) {
        /*
            Method dump skipped, instructions count: 520
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.core.widget.NestedScrollView.onTouchEvent(android.view.MotionEvent):boolean");
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void requestChildFocus(View view, View view2) {
        if (this.f310) {
            this.f322 = view2;
        } else {
            Rect rect = this.f327;
            view2.getDrawingRect(rect);
            offsetDescendantRectToMyCoords(view2, rect);
            int iM93 = m93(rect);
            if (iM93 != 0) {
                scrollBy(0, iM93);
            }
        }
        super.requestChildFocus(view, view2);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final boolean requestChildRectangleOnScreen(View view, Rect rect, boolean z) {
        rect.offset(view.getLeft() - view.getScrollX(), view.getTop() - view.getScrollY());
        int iM93 = m93(rect);
        boolean z2 = iM93 != 0;
        if (z2) {
            if (z) {
                scrollBy(0, iM93);
                return z2;
            }
            m80(0, iM93, false);
        }
        return z2;
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void requestDisallowInterceptTouchEvent(boolean z) {
        VelocityTracker velocityTracker;
        if (z && (velocityTracker = this.f325) != null) {
            velocityTracker.recycle();
            this.f325 = null;
        }
        super.requestDisallowInterceptTouchEvent(z);
    }

    @Override // android.view.View, android.view.ViewParent
    public final void requestLayout() {
        this.f310 = true;
        super.requestLayout();
    }

    @Override // android.view.View
    public final void scrollTo(int i, int i2) {
        if (getChildCount() > 0) {
            View childAt = getChildAt(0);
            FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) childAt.getLayoutParams();
            int width = (getWidth() - getPaddingLeft()) - getPaddingRight();
            int width2 = childAt.getWidth() + layoutParams.leftMargin + layoutParams.rightMargin;
            int height = (getHeight() - getPaddingTop()) - getPaddingBottom();
            int height2 = childAt.getHeight() + layoutParams.topMargin + layoutParams.bottomMargin;
            if (width >= width2 || i < 0) {
                i = 0;
            } else if (width + i > width2) {
                i = width2 - width;
            }
            if (height >= height2 || i2 < 0) {
                i2 = 0;
            } else if (height + i2 > height2) {
                i2 = height2 - height;
            }
            if (i == getScrollX() && i2 == getScrollY()) {
                return;
            }
            super.scrollTo(i, i2);
        }
    }

    public void setFillViewport(boolean z) {
        if (z != this.f311) {
            this.f311 = z;
            requestLayout();
        }
    }

    @Override // android.view.View
    public void setNestedScrollingEnabled(boolean z) {
        C3096 c3096 = this.f323;
        if (c3096.f11806) {
            ViewGroup viewGroup = c3096.f11803;
            WeakHashMap weakHashMap = AbstractC2873.f11133;
            viewGroup.stopNestedScroll();
        }
        c3096.f11806 = z;
    }

    public void setOnScrollChangeListener(InterfaceC2902 interfaceC2902) {
    }

    public void setSmoothScrollingEnabled(boolean z) {
        this.f324 = z;
    }

    @Override // android.widget.FrameLayout, android.view.ViewGroup
    public final boolean shouldDelayChildPressedState() {
        return true;
    }

    @Override // android.view.View
    public final boolean startNestedScroll(int i) {
        return this.f323.m7428(i, 0);
    }

    @Override // android.view.View
    public final void stopNestedScroll() {
        m84(0);
    }

    @Override // defpackage.InterfaceC4653
    /* renamed from: ˇʼʤˎ */
    public final void mo20(View view, View view2, int i, int i2) {
        C4697 c4697 = this.f307;
        if (i2 == 1) {
            c4697.f17369 = i;
        } else {
            c4697.f17367 = i;
        }
        this.f323.m7428(2, i2);
    }

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public final boolean m78(int i, int i2, int i3, int i4) {
        int i5;
        boolean z;
        int i6;
        boolean z2;
        getOverScrollMode();
        super.computeHorizontalScrollRange();
        super.computeHorizontalScrollExtent();
        computeVerticalScrollRange();
        super.computeVerticalScrollExtent();
        int i7 = i3 + i;
        if (i2 <= 0 && i2 >= 0) {
            i5 = i2;
            z = false;
        } else {
            i5 = 0;
            z = true;
        }
        if (i7 > i4) {
            i6 = i4;
        } else {
            if (i7 >= 0) {
                i6 = i7;
                z2 = false;
                if (z2 && !this.f323.m7426(1)) {
                    this.f326.springBack(i5, i6, 0, 0, 0, getScrollRange());
                }
                super.scrollTo(i5, i6);
                return !z || z2;
            }
            i6 = 0;
        }
        z2 = true;
        if (z2) {
            this.f326.springBack(i5, i6, 0, 0, 0, getScrollRange());
        }
        super.scrollTo(i5, i6);
        if (z) {
        }
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final boolean m79(int i) {
        View viewFindFocus = findFocus();
        if (viewFindFocus == this) {
            viewFindFocus = null;
        }
        View view = viewFindFocus;
        View viewFindNextFocus = FocusFinder.getInstance().findNextFocus(this, view, i);
        int maxScrollAmount = getMaxScrollAmount();
        if (viewFindNextFocus == null || !m88(viewFindNextFocus, maxScrollAmount, getHeight())) {
            if (i == 33 && getScrollY() < maxScrollAmount) {
                maxScrollAmount = getScrollY();
            } else if (i == 130 && getChildCount() > 0) {
                View childAt = getChildAt(0);
                maxScrollAmount = Math.min((childAt.getBottom() + ((FrameLayout.LayoutParams) childAt.getLayoutParams()).bottomMargin) - ((getHeight() + getScrollY()) - getPaddingBottom()), maxScrollAmount);
            }
            if (maxScrollAmount == 0) {
                return false;
            }
            if (i != 130) {
                maxScrollAmount = -maxScrollAmount;
            }
            m82(maxScrollAmount, -1, null, 0, 1, true);
        } else {
            Rect rect = this.f327;
            viewFindNextFocus.getDrawingRect(rect);
            offsetDescendantRectToMyCoords(viewFindNextFocus, rect);
            m82(m93(rect), -1, null, 0, 1, true);
            viewFindNextFocus.requestFocus(i);
        }
        if (view != null && view.isFocused() && !m88(view, 0, getHeight())) {
            int descendantFocusability = getDescendantFocusability();
            setDescendantFocusability(131072);
            requestFocus();
            setDescendantFocusability(descendantFocusability);
        }
        return true;
    }

    @Override // defpackage.InterfaceC4653
    /* renamed from: ˏˋٴ */
    public final void mo23(View view, int i) {
        C4697 c4697 = this.f307;
        if (i == 1) {
            c4697.f17369 = 0;
        } else {
            c4697.f17367 = 0;
        }
        m84(i);
    }

    @Override // defpackage.InterfaceC4653
    /* renamed from: ˏᵙ */
    public final void mo24(int i, int i2, int i3, int[] iArr) {
        this.f323.m7431(i, i2, i3, iArr, null);
    }

    /* renamed from: ˑᵱ, reason: contains not printable characters */
    public final void m80(int i, int i2, boolean z) {
        if (getChildCount() == 0) {
            return;
        }
        if (AnimationUtils.currentAnimationTimeMillis() - this.f318 > 250) {
            View childAt = getChildAt(0);
            FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) childAt.getLayoutParams();
            int height = childAt.getHeight() + layoutParams.topMargin + layoutParams.bottomMargin;
            int height2 = (getHeight() - getPaddingTop()) - getPaddingBottom();
            int scrollY = getScrollY();
            int iMax = Math.max(0, Math.min(i2 + scrollY, Math.max(0, height - height2))) - scrollY;
            this.f326.startScroll(getScrollX(), scrollY, 0, iMax, 250);
            if (z) {
                this.f323.m7428(2, 1);
            } else {
                m84(1);
            }
            this.f304 = getScrollY();
            postInvalidateOnAnimation();
        } else {
            OverScroller overScroller = this.f326;
            if (!overScroller.isFinished()) {
                overScroller.abortAnimation();
                m84(1);
            }
            scrollBy(i, i2);
        }
        this.f318 = AnimationUtils.currentAnimationTimeMillis();
    }

    /* JADX WARN: Removed duplicated region for block: B:48:0x0098  */
    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean m81(android.view.KeyEvent r6) {
        /*
            r5 = this;
            android.graphics.Rect r0 = r5.f327
            r0.setEmpty()
            int r0 = r5.getChildCount()
            r1 = 130(0x82, float:1.82E-43)
            r2 = 0
            if (r0 <= 0) goto L98
            android.view.View r0 = r5.getChildAt(r2)
            android.view.ViewGroup$LayoutParams r3 = r0.getLayoutParams()
            android.widget.FrameLayout$LayoutParams r3 = (android.widget.FrameLayout.LayoutParams) r3
            int r0 = r0.getHeight()
            int r4 = r3.topMargin
            int r0 = r0 + r4
            int r3 = r3.bottomMargin
            int r0 = r0 + r3
            int r3 = r5.getHeight()
            int r4 = r5.getPaddingTop()
            int r3 = r3 - r4
            int r4 = r5.getPaddingBottom()
            int r3 = r3 - r4
            if (r0 <= r3) goto L98
            int r0 = r6.getAction()
            if (r0 != 0) goto Lc0
            int r0 = r6.getKeyCode()
            r3 = 19
            r4 = 33
            if (r0 == r3) goto L88
            r3 = 20
            if (r0 == r3) goto L78
            r3 = 62
            if (r0 == r3) goto L6d
            r6 = 92
            if (r0 == r6) goto L68
            r6 = 93
            if (r0 == r6) goto L63
            r6 = 122(0x7a, float:1.71E-43)
            if (r0 == r6) goto L5f
            r6 = 123(0x7b, float:1.72E-43)
            if (r0 == r6) goto L5b
            goto Lc0
        L5b:
            r5.m83(r1)
            return r2
        L5f:
            r5.m83(r4)
            return r2
        L63:
            boolean r5 = r5.m92(r1)
            return r5
        L68:
            boolean r5 = r5.m92(r4)
            return r5
        L6d:
            boolean r6 = r6.isShiftPressed()
            if (r6 == 0) goto L74
            r1 = r4
        L74:
            r5.m83(r1)
            return r2
        L78:
            boolean r6 = r6.isAltPressed()
            if (r6 == 0) goto L83
            boolean r5 = r5.m92(r1)
            return r5
        L83:
            boolean r5 = r5.m79(r1)
            return r5
        L88:
            boolean r6 = r6.isAltPressed()
            if (r6 == 0) goto L93
            boolean r5 = r5.m92(r4)
            return r5
        L93:
            boolean r5 = r5.m79(r4)
            return r5
        L98:
            boolean r0 = r5.isFocused()
            if (r0 == 0) goto Lc0
            int r6 = r6.getKeyCode()
            r0 = 4
            if (r6 == r0) goto Lc0
            android.view.View r6 = r5.findFocus()
            if (r6 != r5) goto Lac
            r6 = 0
        Lac:
            android.view.FocusFinder r0 = android.view.FocusFinder.getInstance()
            android.view.View r6 = r0.findNextFocus(r5, r6, r1)
            if (r6 == 0) goto Lc0
            if (r6 == r5) goto Lc0
            boolean r5 = r6.requestFocus(r1)
            if (r5 == 0) goto Lc0
            r5 = 1
            return r5
        Lc0:
            return r2
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.core.widget.NestedScrollView.m81(android.view.KeyEvent):boolean");
    }

    /* JADX WARN: Removed duplicated region for block: B:52:0x0118  */
    /* JADX WARN: Removed duplicated region for block: B:59:0x0129  */
    /* renamed from: ᵞʡ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final int m82(int r21, int r22, android.view.MotionEvent r23, int r24, int r25, boolean r26) {
        /*
            Method dump skipped, instructions count: 307
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.core.widget.NestedScrollView.m82(int, int, android.view.MotionEvent, int, int, boolean):int");
    }

    /* renamed from: ᵡʠ, reason: contains not printable characters */
    public final void m83(int i) {
        boolean z = i == 130;
        int height = getHeight();
        Rect rect = this.f327;
        if (z) {
            rect.top = getScrollY() + height;
            int childCount = getChildCount();
            if (childCount > 0) {
                View childAt = getChildAt(childCount - 1);
                int paddingBottom = getPaddingBottom() + childAt.getBottom() + ((FrameLayout.LayoutParams) childAt.getLayoutParams()).bottomMargin;
                if (rect.top + height > paddingBottom) {
                    rect.top = paddingBottom - height;
                }
            }
        } else {
            int scrollY = getScrollY() - height;
            rect.top = scrollY;
            if (scrollY < 0) {
                rect.top = 0;
            }
        }
        int i2 = rect.top;
        int i3 = height + i2;
        rect.bottom = i3;
        m91(i, i2, i3);
    }

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final void m84(int i) {
        this.f323.m7427(i);
    }

    @Override // defpackage.InterfaceC4653
    /* renamed from: ᵥᵯˎ */
    public final void mo26(ViewGroup viewGroup, int i, int i2, int i3, int i4, int i5) {
        m87(null, i4, i5);
    }

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final boolean m85(MotionEvent motionEvent) {
        boolean z;
        EdgeEffect edgeEffect = this.f319;
        if (ᵭʝʜ.ᵡʠ(edgeEffect) != 0.0f) {
            ᵭʝʜ.ᵿʗᵝʽ(edgeEffect, 0.0f, motionEvent.getX() / getWidth());
            z = true;
        } else {
            z = false;
        }
        EdgeEffect edgeEffect2 = this.f317;
        if (ᵭʝʜ.ᵡʠ(edgeEffect2) == 0.0f) {
            return z;
        }
        ᵭʝʜ.ᵿʗᵝʽ(edgeEffect2, 0.0f, 1.0f - (motionEvent.getX() / getWidth()));
        return true;
    }

    /* renamed from: ᵨᵳʝ, reason: contains not printable characters */
    public final boolean m86(EdgeEffect edgeEffect, int i) {
        if (i > 0) {
            return true;
        }
        float f = ᵭʝʜ.ᵡʠ(edgeEffect) * getHeight();
        float fAbs = Math.abs(-i) * 0.35f;
        float f2 = this.f321 * 0.015f;
        double dLog = Math.log(fAbs / f2);
        double d = f298;
        return ((float) (Math.exp((d / (d - 1.0d)) * dLog) * ((double) f2))) < f;
    }

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public final void m87(int[] iArr, int i, int i2) {
        int scrollY = getScrollY();
        scrollBy(0, i);
        int scrollY2 = getScrollY() - scrollY;
        if (iArr != null) {
            iArr[1] = iArr[1] + scrollY2;
        }
        this.f323.m7429(0, scrollY2, 0, i - scrollY2, null, i2, iArr);
    }

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public final boolean m88(View view, int i, int i2) {
        Rect rect = this.f327;
        view.getDrawingRect(rect);
        offsetDescendantRectToMyCoords(view, rect);
        return rect.bottom + i >= getScrollY() && rect.top - i <= getScrollY() + i2;
    }

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public final void m89(MotionEvent motionEvent) {
        int actionIndex = motionEvent.getActionIndex();
        if (motionEvent.getPointerId(actionIndex) == this.f315) {
            int i = actionIndex == 0 ? 1 : 0;
            this.f314 = (int) motionEvent.getY(i);
            this.f315 = motionEvent.getPointerId(i);
            VelocityTracker velocityTracker = this.f325;
            if (velocityTracker != null) {
                velocityTracker.clear();
            }
        }
    }

    @Override // defpackage.InterfaceC1648
    /* renamed from: ᵴᵳ */
    public final void mo27(ViewGroup viewGroup, int i, int i2, int i3, int i4, int i5, int[] iArr) {
        m87(iArr, i4, i5);
    }

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final void m90(int i) {
        if (getChildCount() > 0) {
            this.f326.fling(getScrollX(), getScrollY(), 0, i, 0, 0, Integer.MIN_VALUE, Integer.MAX_VALUE, 0, 0);
            this.f323.m7428(2, 1);
            this.f304 = getScrollY();
            postInvalidateOnAnimation();
            if (Build.VERSION.SDK_INT >= 35) {
                AbstractC5345.m10974(this, Math.abs(this.f326.getCurrVelocity()));
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:32:0x0068  */
    /* renamed from: ᵸʓᵠ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean m91(int r19, int r20, int r21) {
        /*
            r18 = this;
            r0 = r19
            r1 = r20
            r2 = r21
            int r3 = r18.getHeight()
            int r4 = r18.getScrollY()
            int r3 = r3 + r4
            r5 = 33
            if (r0 != r5) goto L15
            r5 = 1
            goto L16
        L15:
            r5 = 0
        L16:
            r8 = 2
            r9 = r18
            java.util.ArrayList r8 = r9.getFocusables(r8)
            int r10 = r8.size()
            r11 = 0
            r12 = 0
            r13 = 0
        L24:
            if (r12 >= r10) goto L6c
            java.lang.Object r14 = r8.get(r12)
            android.view.View r14 = (android.view.View) r14
            int r15 = r14.getTop()
            int r6 = r14.getBottom()
            if (r1 >= r6) goto L69
            if (r15 >= r2) goto L69
            if (r1 >= r15) goto L3f
            if (r6 >= r2) goto L3f
            r17 = 1
            goto L41
        L3f:
            r17 = 0
        L41:
            if (r11 != 0) goto L47
            r11 = r14
            r13 = r17
            goto L69
        L47:
            if (r5 == 0) goto L4f
            int r7 = r11.getTop()
            if (r15 < r7) goto L57
        L4f:
            if (r5 != 0) goto L59
            int r7 = r11.getBottom()
            if (r6 <= r7) goto L59
        L57:
            r6 = 1
            goto L5a
        L59:
            r6 = 0
        L5a:
            if (r13 == 0) goto L61
            if (r17 == 0) goto L69
            if (r6 == 0) goto L69
            goto L68
        L61:
            if (r17 == 0) goto L66
            r11 = r14
            r13 = 1
            goto L69
        L66:
            if (r6 == 0) goto L69
        L68:
            r11 = r14
        L69:
            int r12 = r12 + 1
            goto L24
        L6c:
            if (r11 != 0) goto L70
            r6 = r9
            goto L71
        L70:
            r6 = r11
        L71:
            if (r1 < r4) goto L78
            if (r2 > r3) goto L78
            r16 = 0
            goto L8a
        L78:
            if (r5 == 0) goto L7d
            int r1 = r1 - r4
        L7b:
            r10 = r1
            goto L80
        L7d:
            int r1 = r2 - r3
            goto L7b
        L80:
            r11 = -1
            r12 = 0
            r13 = 0
            r14 = 1
            r15 = 1
            r9.m82(r10, r11, r12, r13, r14, r15)
            r16 = 1
        L8a:
            android.view.View r1 = r18.findFocus()
            if (r6 == r1) goto L93
            r6.requestFocus(r0)
        L93:
            return r16
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.core.widget.NestedScrollView.m91(int, int, int):boolean");
    }

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final boolean m92(int i) {
        int childCount;
        boolean z = i == 130;
        int height = getHeight();
        Rect rect = this.f327;
        rect.top = 0;
        rect.bottom = height;
        if (z && (childCount = getChildCount()) > 0) {
            View childAt = getChildAt(childCount - 1);
            int paddingBottom = getPaddingBottom() + childAt.getBottom() + ((FrameLayout.LayoutParams) childAt.getLayoutParams()).bottomMargin;
            rect.bottom = paddingBottom;
            rect.top = paddingBottom - height;
        }
        return m91(i, rect.top, rect.bottom);
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final int m93(Rect rect) {
        if (getChildCount() == 0) {
            return 0;
        }
        int height = getHeight();
        int scrollY = getScrollY();
        int i = scrollY + height;
        int verticalFadingEdgeLength = getVerticalFadingEdgeLength();
        if (rect.top > 0) {
            scrollY += verticalFadingEdgeLength;
        }
        View childAt = getChildAt(0);
        FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) childAt.getLayoutParams();
        int i2 = rect.bottom < (childAt.getHeight() + layoutParams.topMargin) + layoutParams.bottomMargin ? i - verticalFadingEdgeLength : i;
        int i3 = rect.bottom;
        if (i3 > i2 && rect.top > scrollY) {
            return Math.min(rect.height() > height ? rect.top - scrollY : rect.bottom - i2, (childAt.getBottom() + layoutParams.bottomMargin) - i);
        }
        if (rect.top >= scrollY || i3 >= i2) {
            return 0;
        }
        return Math.max(rect.height() > height ? 0 - (i2 - rect.bottom) : 0 - (scrollY - rect.top), -getScrollY());
    }

    @Override // defpackage.InterfaceC4653
    /* renamed from: ᵻᵢﹳᵰ */
    public final boolean mo30(View view, View view2, int i, int i2) {
        return (i & 2) != 0;
    }
}
