package ῲ.䀟.K;

import android.view.View;
import android.view.animation.DecelerateInterpolator;
import android.widget.Scroller;
import androidx.recyclerview.widget.RecyclerView;

/* renamed from: ῲ.䀟.K.Ԛ  reason: contains not printable characters */
/* compiled from: SnapHelper */
public abstract class AbstractC2301 extends RecyclerView.AbstractC0259 {

    /* renamed from: ῲ  reason: contains not printable characters */
    public final RecyclerView.AbstractC0267 f7957 = new C2302();

    /* renamed from: K  reason: contains not printable characters */
    public RecyclerView f7958;

    /* renamed from: ῲ.䀟.K.Ԛ$K  reason: contains not printable characters */
    /* compiled from: SnapHelper */
    public class C2302 extends RecyclerView.AbstractC0267 {

        /* renamed from: K  reason: contains not printable characters */
        public boolean f7960 = false;

        public C2302() {
        }

        @Override // androidx.recyclerview.widget.RecyclerView.AbstractC0267
        public void onScrollStateChanged(RecyclerView recyclerView, int i) {
            super.onScrollStateChanged(recyclerView, i);
            if (i == 0 && this.f7960) {
                this.f7960 = false;
                AbstractC2301.this.m6010();
            }
        }

        @Override // androidx.recyclerview.widget.RecyclerView.AbstractC0267
        public void onScrolled(RecyclerView recyclerView, int i, int i2) {
            if (i != 0 || i2 != 0) {
                this.f7960 = true;
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public abstract View m6009(RecyclerView.AbstractC0254 v);

    /* renamed from: K  reason: contains not printable characters */
    public void m6011(RecyclerView recyclerView) throws IllegalStateException {
        RecyclerView recyclerView2 = this.f7958;
        if (recyclerView2 != recyclerView) {
            if (recyclerView2 != null) {
                recyclerView2.removeOnScrollListener(this.f7957);
                this.f7958.setOnFlingListener(null);
            }
            this.f7958 = recyclerView;
            RecyclerView recyclerView3 = this.f7958;
            if (recyclerView3 == null) {
                return;
            }
            if (recyclerView3.getOnFlingListener() == null) {
                this.f7958.addOnScrollListener(this.f7957);
                this.f7958.setOnFlingListener(this);
                new Scroller(this.f7958.getContext(), new DecelerateInterpolator());
                m6010();
                return;
            }
            throw new IllegalStateException("An instance of OnFlingListener already set.");
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public abstract int[] m6012(RecyclerView.AbstractC0254 v, View view);

    /* renamed from: K  reason: contains not printable characters */
    public void m6010() {
        RecyclerView.AbstractC0254 layoutManager;
        View r1;
        RecyclerView recyclerView = this.f7958;
        if (recyclerView != null && (layoutManager = recyclerView.getLayoutManager()) != null && (r1 = m6009(layoutManager)) != null) {
            int[] r0 = m6012(layoutManager, r1);
            if (r0[0] != 0 || r0[1] != 0) {
                this.f7958.smoothScrollBy(r0[0], r0[1]);
            }
        }
    }
}
