package ῲ.䀟.K;

import android.view.View;
import androidx.recyclerview.widget.RecyclerView;

/* renamed from: ῲ.䀟.K.㗽  reason: contains not printable characters */
/* compiled from: PagerSnapHelper */
public class C2331 extends AbstractC2301 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public AbstractC2303 f8057;

    /* renamed from: 㸾  reason: contains not printable characters */
    public AbstractC2303 f8058;

    /* renamed from: ʬ  reason: contains not printable characters */
    public final AbstractC2303 m6110(RecyclerView.AbstractC0254 r2) {
        AbstractC2303 r0 = this.f8057;
        if (r0 == null || r0.f7963 != r2) {
            this.f8057 = new C2330(r2);
        }
        return this.f8057;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public final AbstractC2303 m6111(RecyclerView.AbstractC0254 r2) {
        AbstractC2303 r0 = this.f8058;
        if (r0 == null || r0.f7963 != r2) {
            this.f8058 = new C2300(r2);
        }
        return this.f8058;
    }

    @Override // ῲ.䀟.K.AbstractC2301
    /* renamed from: K  reason: contains not printable characters */
    public int[] m6115(RecyclerView.AbstractC0254 r5, View view) {
        int[] iArr = new int[2];
        if (r5.canScrollHorizontally()) {
            iArr[0] = m6112(view, m6111(r5));
        } else {
            iArr[0] = 0;
        }
        if (r5.canScrollVertically()) {
            iArr[1] = m6112(view, m6110(r5));
        } else {
            iArr[1] = 0;
        }
        return iArr;
    }

    @Override // ῲ.䀟.K.AbstractC2301
    /* renamed from: K  reason: contains not printable characters */
    public View m6113(RecyclerView.AbstractC0254 r2) {
        if (r2.canScrollVertically()) {
            return m6114(r2, m6110(r2));
        }
        if (r2.canScrollHorizontally()) {
            return m6114(r2, m6111(r2));
        }
        return null;
    }

    /* renamed from: K  reason: contains not printable characters */
    public final int m6112(View view, AbstractC2303 r3) {
        return ((r3.m6019(view) / 2) + r3.m6027(view)) - ((r3.m6020() / 2) + r3.m6024());
    }

    /* renamed from: K  reason: contains not printable characters */
    public final View m6114(RecyclerView.AbstractC0254 r9, AbstractC2303 r10) {
        int childCount = r9.getChildCount();
        View view = null;
        if (childCount == 0) {
            return null;
        }
        int r3 = (r10.m6020() / 2) + r10.m6024();
        int i = Integer.MAX_VALUE;
        for (int i2 = 0; i2 < childCount; i2++) {
            View childAt = r9.getChildAt(i2);
            int abs = Math.abs(((r10.m6019(childAt) / 2) + r10.m6027(childAt)) - r3);
            if (abs < i) {
                view = childAt;
                i = abs;
            }
        }
        return view;
    }
}
