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.AbstractC0319;
import defpackage.AbstractC2746;
import defpackage.AbstractC3481;
import defpackage.AbstractC4264;
import defpackage.C1553;
import defpackage.C3555;
import defpackage.C4031;
import defpackage.C4045;
import defpackage.C4240;
import defpackage.C4787;
import defpackage.InterfaceC0221;
import defpackage.InterfaceC1037;
import j$.util.Objects;
import java.util.ArrayList;
import java.util.WeakHashMap;

/* JADX INFO: loaded from: classes3.dex */
public class NestedScrollView extends FrameLayout implements InterfaceC0221 {

    /* JADX INFO: renamed from: ʽᵡᵢᵾ, reason: contains not printable characters */
    public final int[] f301;

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public View f302;

    /* JADX INFO: renamed from: ˀᵗ, reason: contains not printable characters */
    public float f303;

    /* JADX INFO: renamed from: ˀᵭ, reason: contains not printable characters */
    public boolean f304;

    /* JADX INFO: renamed from: ˁʢᵛ, reason: contains not printable characters */
    public final C4045 f305;

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public boolean f306;

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public C4031 f307;

    /* JADX INFO: renamed from: ˈⁱᵡ, reason: contains not printable characters */
    public int f308;

    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    public VelocityTracker f309;

    /* JADX INFO: renamed from: ˊˌˊ, reason: contains not printable characters */
    public final C4240 f310;

    /* JADX INFO: renamed from: ˊᵡᵗʨ, reason: contains not printable characters */
    public final int f311;

    /* JADX INFO: renamed from: ˊᵾʽʼ, reason: contains not printable characters */
    public final int f312;

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final float f313;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public int f314;

    /* JADX INFO: renamed from: ˏᵩʨ, reason: contains not printable characters */
    public final C1553 f315;

    /* JADX INFO: renamed from: ˑʢ, reason: contains not printable characters */
    public final int[] f316;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public boolean f317;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final Rect f318;

    /* JADX INFO: renamed from: ᵛˑﹳ, reason: contains not printable characters */
    public final int f319;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public long f320;

    /* JADX INFO: renamed from: ᵞᵛᵘ, reason: contains not printable characters */
    public C3555 f321;

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public boolean f322;

    /* JADX INFO: renamed from: ᵨˈʼﹶ, reason: contains not printable characters */
    public int f323;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final OverScroller f324;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public final EdgeEffect f325;

    /* JADX INFO: renamed from: ᵵᵬᵽ, reason: contains not printable characters */
    public int f326;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public final EdgeEffect f327;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public boolean f328;

    /* JADX INFO: renamed from: ᵛˀˊ, reason: contains not printable characters */
    public static final float f299 = (float) (Math.log(0.78d) / Math.log(0.9d));

    /* JADX INFO: renamed from: ʿᵿʽᵞ, reason: contains not printable characters */
    public static final C4787 f298 = new C4787();

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

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

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

    public NestedScrollView(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        this.f318 = new Rect();
        this.f328 = true;
        this.f317 = false;
        this.f302 = null;
        this.f322 = false;
        this.f304 = true;
        this.f326 = -1;
        this.f316 = new int[2];
        this.f301 = new int[2];
        this.f315 = new C1553(getContext(), new ʽˎˇˌ(9, this));
        int i2 = Build.VERSION.SDK_INT;
        this.f325 = i2 >= 31 ? AbstractC0319.m1570(context, attributeSet) : new EdgeEffect(context);
        this.f327 = i2 >= 31 ? AbstractC0319.m1570(context, attributeSet) : new EdgeEffect(context);
        this.f313 = context.getResources().getDisplayMetrics().density * 160.0f * 386.0878f * 0.84f;
        this.f324 = new OverScroller(getContext());
        setFocusable(true);
        setDescendantFocusability(262144);
        setWillNotDraw(false);
        ViewConfiguration viewConfiguration = ViewConfiguration.get(getContext());
        this.f312 = viewConfiguration.getScaledTouchSlop();
        this.f311 = viewConfiguration.getScaledMinimumFlingVelocity();
        this.f319 = viewConfiguration.getScaledMaximumFlingVelocity();
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, f300, i, 0);
        setFillViewport(typedArrayObtainStyledAttributes.getBoolean(0, false));
        typedArrayObtainStyledAttributes.recycle();
        this.f310 = new C4240((byte) 0, 4);
        this.f305 = new C4045(this);
        setNestedScrollingEnabled(true);
        AbstractC2746.m6649(this, f298);
    }

    private C4031 getScrollFeedbackProvider() {
        if (this.f307 == null) {
            this.f307 = new C4031(this);
        }
        return this.f307;
    }

    /* JADX INFO: 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.
    */
    public final void computeScroll() {
        int iRound;
        int i;
        OverScroller overScroller = this.f324;
        if (overScroller.isFinished()) {
            return;
        }
        overScroller.computeScrollOffset();
        int currY = overScroller.getCurrY();
        int i2 = currY - this.f323;
        int height = getHeight();
        EdgeEffect edgeEffect = this.f325;
        EdgeEffect edgeEffect2 = this.f327;
        if (i2 <= 0 || AbstractC3481.m7927(edgeEffect) == 0.0f) {
            if (i2 < 0 && AbstractC3481.m7927(edgeEffect2) != 0.0f) {
                float f = height;
                iRound = Math.round(AbstractC3481.m7921(edgeEffect2, (i2 * 4.0f) / f, 0.5f) * (f / 4.0f));
                if (iRound != i2) {
                    edgeEffect2.finish();
                }
            }
            int i3 = i2;
            this.f323 = currY;
            int[] iArr = this.f301;
            iArr[1] = 0;
            this.f305.m8845(0, i3, 1, iArr, null);
            i = i3 - iArr[1];
            int scrollRange = getScrollRange();
            if (Build.VERSION.SDK_INT >= 35) {
                AbstractC4264.m9229(this, Math.abs(overScroller.getCurrVelocity()));
            }
            if (i != 0) {
                int scrollY = getScrollY();
                m87(i, getScrollX(), scrollY, scrollRange);
                int scrollY2 = getScrollY() - scrollY;
                int i4 = i - scrollY2;
                iArr[1] = 0;
                this.f305.m8846(0, scrollY2, 0, i4, this.f316, 1, iArr);
                i = i4 - iArr[1];
            }
            if (i != 0) {
                int overScrollMode = getOverScrollMode();
                if (overScrollMode == 0 || (overScrollMode == 1 && scrollRange > 0)) {
                    if (i < 0) {
                        if (edgeEffect.isFinished()) {
                            edgeEffect.onAbsorb((int) overScroller.getCurrVelocity());
                        }
                    } else if (edgeEffect2.isFinished()) {
                        edgeEffect2.onAbsorb((int) overScroller.getCurrVelocity());
                    }
                }
                overScroller.abortAnimation();
                m85(1);
            }
            if (overScroller.isFinished()) {
                postInvalidateOnAnimation();
                return;
            } else {
                m85(1);
                return;
            }
        }
        iRound = Math.round(AbstractC3481.m7921(edgeEffect, ((-i2) * 4.0f) / height, 0.5f) * ((-height) / 4.0f));
        if (iRound != i2) {
            edgeEffect.finish();
        }
        i2 -= iRound;
        int i32 = i2;
        this.f323 = currY;
        int[] iArr2 = this.f301;
        iArr2[1] = 0;
        this.f305.m8845(0, i32, 1, iArr2, null);
        i = i32 - iArr2[1];
        int scrollRange2 = getScrollRange();
        if (Build.VERSION.SDK_INT >= 35) {
        }
        if (i != 0) {
        }
        if (i != 0) {
        }
        if (overScroller.isFinished()) {
        }
    }

    @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) || m93(keyEvent);
    }

    @Override // android.view.View
    public final boolean dispatchNestedFling(float f, float f2, boolean z) {
        ViewParent viewParentM8850;
        C4045 c4045 = this.f305;
        if (c4045.f15524 && (viewParentM8850 = c4045.m8850(0)) != null) {
            try {
                return viewParentM8850.onNestedFling(c4045.f15521, f, f2, z);
            } catch (AbstractMethodError unused) {
                Objects.toString(viewParentM8850);
            }
        }
        return false;
    }

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

    @Override // android.view.View
    public final boolean dispatchNestedPreScroll(int i, int i2, int[] iArr, int[] iArr2) {
        return this.f305.m8845(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.f305.m8846(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.f325;
        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.f327;
        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() {
        C4240 c4240 = this.f310;
        return c4240.f16171 | c4240.f16172;
    }

    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.f303 == 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.f303 = typedValue.getDimension(context.getResources().getDisplayMetrics());
        }
        return this.f303;
    }

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

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

    @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.f317 = false;
    }

    @Override // android.view.View
    public final boolean onGenericMotionEvent(MotionEvent motionEvent) {
        int i;
        int width;
        float axisValue;
        if (motionEvent.getAction() == 8 && !this.f322) {
            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) {
                m78(-((int) (getVerticalScrollFactorCompat() * axisValue)), i, motionEvent, width, 1, ᵫﾞˌ.ᵟᵹᵙ(motionEvent, 8194));
                if (i == 0) {
                    return true;
                }
                this.f315.m4381(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.
    */
    public final boolean onInterceptTouchEvent(MotionEvent motionEvent) {
        int iFindPointerIndex;
        int action = motionEvent.getAction();
        boolean z = true;
        if (action == 2 && this.f322) {
            return true;
        }
        int i = action & 255;
        if (i == 0) {
            int y = (int) motionEvent.getY();
            int x = (int) motionEvent.getX();
            int childCount = getChildCount();
            OverScroller overScroller = this.f324;
            if (childCount > 0) {
                int scrollY = getScrollY();
                View childAt = getChildAt(0);
                if (y < childAt.getTop() - scrollY || y >= childAt.getBottom() - scrollY || x < childAt.getLeft() || x >= childAt.getRight()) {
                    if (!m83(motionEvent) && overScroller.isFinished()) {
                        z = false;
                    }
                    this.f322 = z;
                    VelocityTracker velocityTracker = this.f309;
                    if (velocityTracker != null) {
                        velocityTracker.recycle();
                        this.f309 = null;
                    }
                } else {
                    this.f314 = y;
                    this.f326 = motionEvent.getPointerId(0);
                    VelocityTracker velocityTracker2 = this.f309;
                    if (velocityTracker2 == null) {
                        this.f309 = VelocityTracker.obtain();
                    } else {
                        velocityTracker2.clear();
                    }
                    this.f309.addMovement(motionEvent);
                    overScroller.computeScrollOffset();
                    if (!m83(motionEvent) && overScroller.isFinished()) {
                        z = false;
                    }
                    this.f322 = z;
                    this.f305.m8851(2, 0);
                }
            }
        } else if (i == 1) {
            this.f322 = false;
            this.f326 = -1;
            VelocityTracker velocityTracker3 = this.f309;
            if (velocityTracker3 != null) {
                velocityTracker3.recycle();
                this.f309 = null;
            }
            if (this.f324.springBack(getScrollX(), getScrollY(), 0, 0, 0, getScrollRange())) {
                postInvalidateOnAnimation();
            }
            m85(0);
        } else if (i == 2) {
            int i2 = this.f326;
            if (i2 != -1 && (iFindPointerIndex = motionEvent.findPointerIndex(i2)) != -1) {
                int y2 = (int) motionEvent.getY(iFindPointerIndex);
                if (Math.abs(y2 - this.f314) > this.f312 && (2 & getNestedScrollAxes()) == 0) {
                    this.f322 = true;
                    this.f314 = y2;
                    if (this.f309 == null) {
                        this.f309 = VelocityTracker.obtain();
                    }
                    this.f309.addMovement(motionEvent);
                    this.f308 = 0;
                    ViewParent parent = getParent();
                    if (parent != null) {
                        parent.requestDisallowInterceptTouchEvent(true);
                    }
                }
            }
        } else if (i != 3) {
            if (i == 6) {
                m88(motionEvent);
            }
        }
        return this.f322;
    }

    @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.f328 = false;
        View view = this.f302;
        if (view != null && m77(view, this)) {
            View view2 = this.f302;
            Rect rect = this.f318;
            view2.getDrawingRect(rect);
            offsetDescendantRectToMyCoords(view2, rect);
            int iM81 = m81(rect);
            if (iM81 != 0) {
                scrollBy(0, iM81);
            }
        }
        this.f302 = null;
        if (!this.f317) {
            if (this.f321 != null) {
                scrollTo(getScrollX(), this.f321.f13620);
                this.f321 = 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.f317 = true;
    }

    @Override // android.widget.FrameLayout, android.view.View
    public final void onMeasure(int i, int i2) {
        super.onMeasure(i, i2);
        if (this.f306 && 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.f305.m8848(f, f2);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void onNestedPreScroll(View view, int i, int i2, int[] iArr) {
        this.f305.m8845(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) {
        m82(null, i4, 0);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void onNestedScrollAccepted(View view, View view2, int i) {
        mo23(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 && m86(viewFindNextFocus, 0, getHeight())) {
            return viewFindNextFocus.requestFocus(i, rect);
        }
        return false;
    }

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

    @Override // android.view.View
    public final Parcelable onSaveInstanceState() {
        C3555 c3555 = new C3555(super.onSaveInstanceState());
        c3555.f13620 = getScrollY();
        return c3555;
    }

    @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 || !m86(viewFindFocus, 0, i4)) {
            return;
        }
        Rect rect = this.f318;
        viewFindFocus.getDrawingRect(rect);
        offsetDescendantRectToMyCoords(viewFindFocus, rect);
        int iM81 = m81(rect);
        if (iM81 != 0) {
            if (this.f304) {
                m80(0, iM81, false);
            } else {
                scrollBy(0, iM81);
            }
        }
    }

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

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void onStopNestedScroll(View view) {
        mo30(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.
    */
    public final boolean onTouchEvent(MotionEvent motionEvent) {
        ViewParent parent;
        float fM7921;
        int iRound;
        if (this.f309 == null) {
            this.f309 = VelocityTracker.obtain();
        }
        int actionMasked = motionEvent.getActionMasked();
        if (actionMasked == 0) {
            this.f308 = 0;
        }
        MotionEvent motionEventObtain = MotionEvent.obtain(motionEvent);
        float f = 0.0f;
        motionEventObtain.offsetLocation(0.0f, this.f308);
        C4045 c4045 = this.f305;
        if (actionMasked != 0) {
            EdgeEffect edgeEffect = this.f325;
            EdgeEffect edgeEffect2 = this.f327;
            if (actionMasked == 1) {
                VelocityTracker velocityTracker = this.f309;
                velocityTracker.computeCurrentVelocity(1000, this.f319);
                int yVelocity = (int) velocityTracker.getYVelocity(this.f326);
                if (Math.abs(yVelocity) >= this.f311) {
                    if (AbstractC3481.m7927(edgeEffect) != 0.0f) {
                        if (m84(edgeEffect, yVelocity)) {
                            edgeEffect.onAbsorb(yVelocity);
                        } else {
                            m90(-yVelocity);
                        }
                    } else if (AbstractC3481.m7927(edgeEffect2) != 0.0f) {
                        int i = -yVelocity;
                        if (m84(edgeEffect2, i)) {
                            edgeEffect2.onAbsorb(i);
                        } else {
                            m90(i);
                        }
                    } else {
                        int i2 = -yVelocity;
                        float f2 = i2;
                        if (!c4045.m8848(0.0f, f2)) {
                            dispatchNestedFling(0.0f, f2, true);
                            m90(i2);
                        }
                    }
                } else if (this.f324.springBack(getScrollX(), getScrollY(), 0, 0, 0, getScrollRange())) {
                    postInvalidateOnAnimation();
                }
                this.f326 = -1;
                this.f322 = false;
                VelocityTracker velocityTracker2 = this.f309;
                if (velocityTracker2 != null) {
                    velocityTracker2.recycle();
                    this.f309 = null;
                }
                m85(0);
                edgeEffect.onRelease();
                edgeEffect2.onRelease();
            } else if (actionMasked == 2) {
                int iFindPointerIndex = motionEvent.findPointerIndex(this.f326);
                if (iFindPointerIndex != -1) {
                    int y = (int) motionEvent.getY(iFindPointerIndex);
                    int i3 = this.f314 - y;
                    float x = motionEvent.getX(iFindPointerIndex) / getWidth();
                    float height = i3 / getHeight();
                    if (AbstractC3481.m7927(edgeEffect) != 0.0f) {
                        fM7921 = -AbstractC3481.m7921(edgeEffect, -height, x);
                        if (AbstractC3481.m7927(edgeEffect) == 0.0f) {
                            edgeEffect.onRelease();
                        }
                    } else {
                        if (AbstractC3481.m7927(edgeEffect2) != 0.0f) {
                            fM7921 = AbstractC3481.m7921(edgeEffect2, height, 1.0f - x);
                            if (AbstractC3481.m7927(edgeEffect2) == 0.0f) {
                                edgeEffect2.onRelease();
                            }
                        }
                        iRound = Math.round(f * getHeight());
                        if (iRound != 0) {
                            invalidate();
                        }
                        int i4 = i3 - iRound;
                        if (!this.f322) {
                            int iAbs = Math.abs(i4);
                            int i5 = this.f312;
                            if (iAbs > i5) {
                                ViewParent parent2 = getParent();
                                if (parent2 != null) {
                                    parent2.requestDisallowInterceptTouchEvent(true);
                                }
                                this.f322 = true;
                                i4 = i4 > 0 ? i4 - i5 : i4 + i5;
                            }
                        }
                        if (this.f322) {
                            int iM78 = m78(i4, 1, motionEvent, (int) motionEvent.getX(iFindPointerIndex), 0, false);
                            this.f314 = y - iM78;
                            this.f308 += iM78;
                        }
                    }
                    f = fM7921;
                    iRound = Math.round(f * getHeight());
                    if (iRound != 0) {
                    }
                    int i42 = i3 - iRound;
                    if (!this.f322) {
                    }
                    if (this.f322) {
                    }
                }
            } else if (actionMasked == 3) {
                if (this.f322 && getChildCount() > 0) {
                    if (this.f324.springBack(getScrollX(), getScrollY(), 0, 0, 0, getScrollRange())) {
                        postInvalidateOnAnimation();
                    }
                }
                this.f326 = -1;
                this.f322 = false;
                VelocityTracker velocityTracker3 = this.f309;
                if (velocityTracker3 != null) {
                    velocityTracker3.recycle();
                    this.f309 = null;
                }
                m85(0);
                edgeEffect.onRelease();
                edgeEffect2.onRelease();
            } else if (actionMasked == 5) {
                int actionIndex = motionEvent.getActionIndex();
                this.f314 = (int) motionEvent.getY(actionIndex);
                this.f326 = motionEvent.getPointerId(actionIndex);
            } else if (actionMasked == 6) {
                m88(motionEvent);
                this.f314 = (int) motionEvent.getY(motionEvent.findPointerIndex(this.f326));
            }
        } else {
            if (getChildCount() == 0) {
                return false;
            }
            if (this.f322 && (parent = getParent()) != null) {
                parent.requestDisallowInterceptTouchEvent(true);
            }
            OverScroller overScroller = this.f324;
            if (!overScroller.isFinished()) {
                overScroller.abortAnimation();
                m85(1);
            }
            int y2 = (int) motionEvent.getY();
            int pointerId = motionEvent.getPointerId(0);
            this.f314 = y2;
            this.f326 = pointerId;
            c4045.m8851(2, 0);
        }
        VelocityTracker velocityTracker4 = this.f309;
        if (velocityTracker4 != null) {
            velocityTracker4.addMovement(motionEventObtain);
        }
        motionEventObtain.recycle();
        return true;
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void requestChildFocus(View view, View view2) {
        if (this.f328) {
            this.f302 = view2;
        } else {
            Rect rect = this.f318;
            view2.getDrawingRect(rect);
            offsetDescendantRectToMyCoords(view2, rect);
            int iM81 = m81(rect);
            if (iM81 != 0) {
                scrollBy(0, iM81);
            }
        }
        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 iM81 = m81(rect);
        boolean z2 = iM81 != 0;
        if (z2) {
            if (z) {
                scrollBy(0, iM81);
                return z2;
            }
            m80(0, iM81, false);
        }
        return z2;
    }

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

    @Override // android.view.View, android.view.ViewParent
    public final void requestLayout() {
        this.f328 = 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.f306) {
            this.f306 = z;
            requestLayout();
        }
    }

    @Override // android.view.View
    public void setNestedScrollingEnabled(boolean z) {
        C4045 c4045 = this.f305;
        if (c4045.f15524) {
            ViewGroup viewGroup = c4045.f15521;
            WeakHashMap weakHashMap = AbstractC2746.f10556;
            viewGroup.stopNestedScroll();
        }
        c4045.f15524 = z;
    }

    public void setOnScrollChangeListener(InterfaceC1037 interfaceC1037) {
    }

    public void setSmoothScrollingEnabled(boolean z) {
        this.f304 = 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.f305.m8851(i, 0);
    }

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

    @Override // defpackage.InterfaceC0221
    /* JADX INFO: renamed from: ʽˈˋ */
    public final void mo20(ViewGroup viewGroup, int i, int i2, int i3, int i4, int i5, int[] iArr) {
        m82(iArr, i4, i5);
    }

    /* JADX WARN: Removed duplicated region for block: B:52:0x0118  */
    /* JADX WARN: Removed duplicated region for block: B:59:0x0129  */
    /* JADX INFO: renamed from: ˉᵲ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final int m78(int i, int i2, MotionEvent motionEvent, int i3, int i4, boolean z) {
        int i5;
        int i6;
        boolean z2;
        boolean z3;
        VelocityTracker velocityTracker;
        C4045 c4045 = this.f305;
        if (i4 == 1) {
            c4045.m8851(2, i4);
        }
        boolean zM8845 = this.f305.m8845(0, i, i4, this.f301, this.f316);
        int[] iArr = this.f316;
        int[] iArr2 = this.f301;
        if (zM8845) {
            i5 = i - iArr2[1];
            i6 = iArr[1];
        } else {
            i5 = i;
            i6 = 0;
        }
        int scrollY = getScrollY();
        int scrollRange = getScrollRange();
        int overScrollMode = getOverScrollMode();
        boolean z4 = (overScrollMode == 0 || (overScrollMode == 1 && getScrollRange() > 0)) && !z;
        boolean z5 = m87(i5, 0, scrollY, scrollRange) && !c4045.m8847(i4);
        int scrollY2 = getScrollY() - scrollY;
        if (motionEvent != null && scrollY2 != 0) {
            getScrollFeedbackProvider().f15493.onScrollProgress(motionEvent.getDeviceId(), motionEvent.getSource(), i2, scrollY2);
        }
        iArr2[1] = 0;
        this.f305.m8846(0, scrollY2, 0, i5 - scrollY2, this.f316, i4, iArr2);
        int i7 = i6 + iArr[1];
        int i8 = i5 - iArr2[1];
        int i9 = scrollY + i8;
        EdgeEffect edgeEffect = this.f327;
        EdgeEffect edgeEffect2 = this.f325;
        if (i9 >= 0) {
            if (i9 > scrollRange && z4) {
                AbstractC3481.m7921(edgeEffect, i8 / getHeight(), 1.0f - (i3 / getWidth()));
                if (motionEvent != null) {
                    z2 = false;
                    getScrollFeedbackProvider().f15493.onScrollLimit(motionEvent.getDeviceId(), motionEvent.getSource(), i2, false);
                } else {
                    z2 = false;
                }
                if (!edgeEffect2.isFinished()) {
                    edgeEffect2.onRelease();
                }
            }
            if (edgeEffect2.isFinished() || !edgeEffect.isFinished()) {
                postInvalidateOnAnimation();
                z3 = z2;
            } else {
                z3 = z5;
            }
            if (z3 && i4 == 0 && (velocityTracker = this.f309) != null) {
                velocityTracker.clear();
            }
            if (i4 == 1) {
                m85(i4);
                edgeEffect2.onRelease();
                edgeEffect.onRelease();
            }
            return i7;
        }
        if (z4) {
            AbstractC3481.m7921(edgeEffect2, (-i8) / getHeight(), i3 / getWidth());
            if (motionEvent != null) {
                getScrollFeedbackProvider().f15493.onScrollLimit(motionEvent.getDeviceId(), motionEvent.getSource(), i2, true);
            }
            if (!edgeEffect.isFinished()) {
                edgeEffect.onRelease();
            }
        }
        z2 = false;
        if (edgeEffect2.isFinished()) {
            postInvalidateOnAnimation();
            z3 = z2;
        }
        if (z3) {
            velocityTracker.clear();
        }
        if (i4 == 1) {
        }
        return i7;
    }

    /* JADX WARN: Removed duplicated region for block: B:32:0x0068  */
    /* JADX INFO: renamed from: ˊᵙᵾᵲ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean m79(int i, int i2, int i3) {
        boolean z;
        int height = getHeight();
        int scrollY = getScrollY();
        int i4 = height + scrollY;
        boolean z2 = i == 33;
        ArrayList<View> focusables = getFocusables(2);
        int size = focusables.size();
        View view = null;
        boolean z3 = false;
        for (int i5 = 0; i5 < size; i5++) {
            View view2 = focusables.get(i5);
            int top = view2.getTop();
            int bottom = view2.getBottom();
            if (i2 < bottom && top < i3) {
                boolean z4 = i2 < top && bottom < i3;
                if (view == null) {
                    view = view2;
                    z3 = z4;
                } else {
                    boolean z5 = (z2 && top < view.getTop()) || (!z2 && bottom > view.getBottom());
                    if (z3) {
                        if (z4 && z5) {
                            view = view2;
                        }
                    } else if (z4) {
                        view = view2;
                        z3 = true;
                    } else if (z5) {
                    }
                }
            }
        }
        View view3 = view == null ? this : view;
        if (i2 < scrollY || i3 > i4) {
            m78(z2 ? i2 - scrollY : i3 - i4, -1, null, 0, 1, true);
            z = true;
        } else {
            z = false;
        }
        if (view3 != findFocus()) {
            view3.requestFocus(i);
        }
        return z;
    }

    /* JADX INFO: 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.f320 > 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.f324.startScroll(getScrollX(), scrollY, 0, iMax, 250);
            if (z) {
                this.f305.m8851(2, 1);
            } else {
                m85(1);
            }
            this.f323 = getScrollY();
            postInvalidateOnAnimation();
        } else {
            OverScroller overScroller = this.f324;
            if (!overScroller.isFinished()) {
                overScroller.abortAnimation();
                m85(1);
            }
            scrollBy(i, i2);
        }
        this.f320 = AnimationUtils.currentAnimationTimeMillis();
    }

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public final int m81(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());
    }

    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public final void m82(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.f305.m8846(0, scrollY2, 0, i - scrollY2, null, i2, iArr);
    }

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final boolean m83(MotionEvent motionEvent) {
        boolean z;
        EdgeEffect edgeEffect = this.f325;
        if (AbstractC3481.m7927(edgeEffect) != 0.0f) {
            AbstractC3481.m7921(edgeEffect, 0.0f, motionEvent.getX() / getWidth());
            z = true;
        } else {
            z = false;
        }
        EdgeEffect edgeEffect2 = this.f327;
        if (AbstractC3481.m7927(edgeEffect2) == 0.0f) {
            return z;
        }
        AbstractC3481.m7921(edgeEffect2, 0.0f, 1.0f - (motionEvent.getX() / getWidth()));
        return true;
    }

    /* JADX INFO: renamed from: ˏːˆ, reason: contains not printable characters */
    public final boolean m84(EdgeEffect edgeEffect, int i) {
        if (i > 0) {
            return true;
        }
        float fM7927 = AbstractC3481.m7927(edgeEffect) * getHeight();
        float fAbs = Math.abs(-i) * 0.35f;
        float f = this.f313 * 0.015f;
        double dLog = Math.log(fAbs / f);
        double d = f299;
        return ((float) (Math.exp((d / (d - 1.0d)) * dLog) * ((double) f))) < fM7927;
    }

    @Override // defpackage.InterfaceC3432
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final void mo22(int i, int i2, int i3, int[] iArr) {
        this.f305.m8845(i, i2, i3, iArr, null);
    }

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final void m85(int i) {
        this.f305.m8849(i);
    }

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public final boolean m86(View view, int i, int i2) {
        Rect rect = this.f318;
        view.getDrawingRect(rect);
        offsetDescendantRectToMyCoords(view, rect);
        return rect.bottom + i >= getScrollY() && rect.top - i <= getScrollY() + i2;
    }

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public final boolean m87(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.f305.m8847(1)) {
                    this.f324.springBack(i5, i6, 0, 0, 0, getScrollRange());
                }
                super.scrollTo(i5, i6);
                return !z || z2;
            }
            i6 = 0;
        }
        z2 = true;
        if (z2) {
            this.f324.springBack(i5, i6, 0, 0, 0, getScrollRange());
        }
        super.scrollTo(i5, i6);
        if (z) {
        }
    }

    @Override // defpackage.InterfaceC3432
    /* JADX INFO: renamed from: ᵨᵣ */
    public final void mo23(View view, View view2, int i, int i2) {
        C4240 c4240 = this.f310;
        if (i2 == 1) {
            c4240.f16171 = i;
        } else {
            c4240.f16172 = i;
        }
        this.f305.m8851(2, i2);
    }

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public final void m88(MotionEvent motionEvent) {
        int actionIndex = motionEvent.getActionIndex();
        if (motionEvent.getPointerId(actionIndex) == this.f326) {
            int i = actionIndex == 0 ? 1 : 0;
            this.f314 = (int) motionEvent.getY(i);
            this.f326 = motionEvent.getPointerId(i);
            VelocityTracker velocityTracker = this.f309;
            if (velocityTracker != null) {
                velocityTracker.clear();
            }
        }
    }

    /* JADX INFO: renamed from: ᵱʡˏ, reason: contains not printable characters */
    public final void m89(int i) {
        boolean z = i == 130;
        int height = getHeight();
        Rect rect = this.f318;
        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;
        m79(i, i2, i3);
    }

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public final void m90(int i) {
        if (getChildCount() > 0) {
            this.f324.fling(getScrollX(), getScrollY(), 0, i, 0, 0, Integer.MIN_VALUE, Integer.MAX_VALUE, 0, 0);
            this.f305.m8851(2, 1);
            this.f323 = getScrollY();
            postInvalidateOnAnimation();
            if (Build.VERSION.SDK_INT >= 35) {
                AbstractC4264.m9229(this, Math.abs(this.f324.getCurrVelocity()));
            }
        }
    }

    @Override // defpackage.InterfaceC3432
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final void mo26(ViewGroup viewGroup, int i, int i2, int i3, int i4, int i5) {
        m82(null, i4, i5);
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final boolean m91(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 || !m86(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;
            }
            m78(maxScrollAmount, -1, null, 0, 1, true);
        } else {
            Rect rect = this.f318;
            viewFindNextFocus.getDrawingRect(rect);
            offsetDescendantRectToMyCoords(viewFindNextFocus, rect);
            m78(m81(rect), -1, null, 0, 1, true);
            viewFindNextFocus.requestFocus(i);
        }
        if (view != null && view.isFocused() && !m86(view, 0, getHeight())) {
            int descendantFocusability = getDescendantFocusability();
            setDescendantFocusability(131072);
            requestFocus();
            setDescendantFocusability(descendantFocusability);
        }
        return true;
    }

    /* JADX INFO: 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.f318;
        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 m79(i, rect.top, rect.bottom);
    }

    @Override // defpackage.InterfaceC3432
    /* JADX INFO: renamed from: ᵷᵺʾᵖ */
    public final boolean mo28(View view, View view2, int i, int i2) {
        return (i & 2) != 0;
    }

    /* JADX WARN: Removed duplicated region for block: B:48:0x0098  */
    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean m93(KeyEvent keyEvent) {
        this.f318.setEmpty();
        if (getChildCount() > 0) {
            View childAt = getChildAt(0);
            FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) childAt.getLayoutParams();
            if (childAt.getHeight() + layoutParams.topMargin + layoutParams.bottomMargin > (getHeight() - getPaddingTop()) - getPaddingBottom()) {
                if (keyEvent.getAction() == 0) {
                    int keyCode = keyEvent.getKeyCode();
                    if (keyCode == 19) {
                        return keyEvent.isAltPressed() ? m92(33) : m91(33);
                    }
                    if (keyCode == 20) {
                        return keyEvent.isAltPressed() ? m92(130) : m91(130);
                    }
                    if (keyCode == 62) {
                        m89(keyEvent.isShiftPressed() ? 33 : 130);
                        return false;
                    }
                    if (keyCode == 92) {
                        return m92(33);
                    }
                    if (keyCode == 93) {
                        return m92(130);
                    }
                    if (keyCode == 122) {
                        m89(33);
                        return false;
                    }
                    if (keyCode == 123) {
                        m89(130);
                        return false;
                    }
                }
            } else if (isFocused() && keyEvent.getKeyCode() != 4) {
                View viewFindFocus = findFocus();
                if (viewFindFocus == this) {
                    viewFindFocus = null;
                }
                View viewFindNextFocus = FocusFinder.getInstance().findNextFocus(this, viewFindFocus, 130);
                if (viewFindNextFocus != null && viewFindNextFocus != this && viewFindNextFocus.requestFocus(130)) {
                    return true;
                }
            }
        }
        return false;
    }

    @Override // defpackage.InterfaceC3432
    /* JADX INFO: renamed from: ᵻˈᵦʼ */
    public final void mo30(View view, int i) {
        C4240 c4240 = this.f310;
        if (i == 1) {
            c4240.f16171 = 0;
        } else {
            c4240.f16172 = 0;
        }
        m85(i);
    }
}
