package IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.XnFJ5_9;

import X6FRs_4.IMuAHx_6.EuDEkJe_12.Eps4cJe_18;
import X6FRs_4.IMuAHx_6.EuDEkJe_12.Nm6q_10;
import X6FRs_4.IMuAHx_6.EuDEkJe_12.YghfZG_14;
import android.content.res.Resources;
import android.graphics.PointF;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Interpolator;
import android.webkit.WebView;
import android.widget.AbsListView;
import android.widget.ListView;
import android.widget.ScrollView;
import androidx.core.widget.NestedScrollView;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;
/* compiled from: SmartUtil.java */
/* loaded from: classes.dex */
public class QxJ9d_1 implements Interpolator {
    public static float KQgRr5e_0 = Resources.getSystem().getDisplayMetrics().density;
    public static final float PGPF6hQ_2;

    /* renamed from: PGPF6hQ_2  reason: collision with other field name */
    public static int f278PGPF6hQ_2 = 1;
    public static final float QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public static int f279QxJ9d_1;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public int f280KQgRr5e_0;

    static {
        float KQgRr5e_02 = 1.0f / KQgRr5e_0(1.0f);
        QxJ9d_1 = KQgRr5e_02;
        PGPF6hQ_2 = 1.0f - (KQgRr5e_02 * KQgRr5e_0(1.0f));
    }

    public QxJ9d_1(int i) {
        this.f280KQgRr5e_0 = i;
    }

    public static int KQgRr5e_0(View view) {
        int makeMeasureSpec;
        ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
        if (layoutParams == null) {
            layoutParams = new ViewGroup.LayoutParams(-1, -2);
        }
        int childMeasureSpec = ViewGroup.getChildMeasureSpec(0, 0, layoutParams.width);
        int i = layoutParams.height;
        if (i > 0) {
            makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(i, 1073741824);
        } else {
            makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, 0);
        }
        view.measure(childMeasureSpec, makeMeasureSpec);
        return view.getMeasuredHeight();
    }

    public static boolean QxJ9d_1(View view) {
        return (view instanceof AbsListView) || (view instanceof ScrollView) || (view instanceof Eps4cJe_18) || (view instanceof WebView) || (view instanceof Nm6q_10);
    }

    @Override // android.animation.TimeInterpolator
    public float getInterpolation(float f) {
        if (this.f280KQgRr5e_0 == f278PGPF6hQ_2) {
            float f2 = 1.0f - f;
            return 1.0f - (f2 * f2);
        }
        float KQgRr5e_02 = QxJ9d_1 * KQgRr5e_0(f);
        return KQgRr5e_02 > 0.0f ? KQgRr5e_02 + PGPF6hQ_2 : KQgRr5e_02;
    }

    public static void KQgRr5e_0(AbsListView absListView, int i) {
        View childAt;
        if (Build.VERSION.SDK_INT >= 19) {
            absListView.scrollListBy(i);
        } else if (absListView instanceof ListView) {
            int firstVisiblePosition = absListView.getFirstVisiblePosition();
            if (firstVisiblePosition == -1 || (childAt = absListView.getChildAt(0)) == null) {
                return;
            }
            ((ListView) absListView).setSelectionFromTop(firstVisiblePosition, childAt.getTop() - i);
        } else {
            absListView.smoothScrollBy(i, 0);
        }
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public static boolean m125KQgRr5e_0(View view) {
        return QxJ9d_1(view) || (view instanceof ViewPager) || (view instanceof YghfZG_14);
    }

    public static void KQgRr5e_0(View view, int i) {
        if (view instanceof ScrollView) {
            ((ScrollView) view).fling(i);
        } else if (view instanceof AbsListView) {
            if (Build.VERSION.SDK_INT >= 21) {
                ((AbsListView) view).fling(i);
            }
        } else if (view instanceof WebView) {
            ((WebView) view).flingScroll(0, i);
        } else if (view instanceof NestedScrollView) {
            ((NestedScrollView) view).QxJ9d_1(i);
        } else if (view instanceof RecyclerView) {
            ((RecyclerView) view).fling(0, i);
        }
    }

    public static boolean KQgRr5e_0(View view, PointF pointF) {
        if (m126KQgRr5e_0(view, -1) && view.getVisibility() == 0) {
            return false;
        }
        if (!(view instanceof ViewGroup) || pointF == null) {
            return true;
        }
        ViewGroup viewGroup = (ViewGroup) view;
        PointF pointF2 = new PointF();
        for (int childCount = viewGroup.getChildCount(); childCount > 0; childCount--) {
            View childAt = viewGroup.getChildAt(childCount - 1);
            if (KQgRr5e_0(viewGroup, childAt, pointF.x, pointF.y, pointF2)) {
                if ("fixed".equals(childAt.getTag()) || "fixed-bottom".equals(childAt.getTag())) {
                    return false;
                }
                pointF.offset(pointF2.x, pointF2.y);
                boolean KQgRr5e_02 = KQgRr5e_0(childAt, pointF);
                pointF.offset(-pointF2.x, -pointF2.y);
                return KQgRr5e_02;
            }
        }
        return true;
    }

    public static boolean KQgRr5e_0(View view, PointF pointF, boolean z) {
        if (m126KQgRr5e_0(view, 1) && view.getVisibility() == 0) {
            return false;
        }
        if ((view instanceof ViewGroup) && pointF != null && !QxJ9d_1(view)) {
            ViewGroup viewGroup = (ViewGroup) view;
            PointF pointF2 = new PointF();
            for (int childCount = viewGroup.getChildCount(); childCount > 0; childCount--) {
                View childAt = viewGroup.getChildAt(childCount - 1);
                if (KQgRr5e_0(viewGroup, childAt, pointF.x, pointF.y, pointF2)) {
                    if ("fixed".equals(childAt.getTag()) || "fixed-top".equals(childAt.getTag())) {
                        return false;
                    }
                    pointF.offset(pointF2.x, pointF2.y);
                    boolean KQgRr5e_02 = KQgRr5e_0(childAt, pointF, z);
                    pointF.offset(-pointF2.x, -pointF2.y);
                    return KQgRr5e_02;
                }
            }
        }
        return z || m126KQgRr5e_0(view, -1);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public static boolean m126KQgRr5e_0(View view, int i) {
        int i2;
        if (Build.VERSION.SDK_INT < 14) {
            if (!(view instanceof AbsListView)) {
                return i > 0 ? view.getScrollY() < 0 : view.getScrollY() > 0;
            }
            ViewGroup viewGroup = (ViewGroup) view;
            AbsListView absListView = (AbsListView) view;
            int childCount = viewGroup.getChildCount();
            return i > 0 ? childCount > 0 && (absListView.getLastVisiblePosition() < (i2 = childCount - 1) || viewGroup.getChildAt(i2).getBottom() > view.getPaddingBottom()) : childCount > 0 && (absListView.getFirstVisiblePosition() > 0 || viewGroup.getChildAt(0).getTop() < view.getPaddingTop());
        }
        return view.canScrollVertically(i);
    }

    public static boolean KQgRr5e_0(View view, View view2, float f, float f2, PointF pointF) {
        if (view2.getVisibility() != 0) {
            return false;
        }
        float[] fArr = {f, f2};
        fArr[0] = fArr[0] + (view.getScrollX() - view2.getLeft());
        fArr[1] = fArr[1] + (view.getScrollY() - view2.getTop());
        boolean z = fArr[0] >= 0.0f && fArr[1] >= 0.0f && fArr[0] < ((float) view2.getWidth()) && fArr[1] < ((float) view2.getHeight());
        if (z && pointF != null) {
            pointF.set(fArr[0] - f, fArr[1] - f2);
        }
        return z;
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public static int m124KQgRr5e_0(float f) {
        return (int) ((f * KQgRr5e_0) + 0.5f);
    }

    public static float KQgRr5e_0(int i) {
        return i / KQgRr5e_0;
    }

    public static float KQgRr5e_0(float f) {
        float f2 = f * 8.0f;
        if (f2 < 1.0f) {
            return f2 - (1.0f - ((float) Math.exp(-f2)));
        }
        return ((1.0f - ((float) Math.exp(1.0f - f2))) * 0.63212055f) + 0.36787945f;
    }
}
