package androidx.recyclerview.widget;

import android.view.animation.Interpolator;
import androidx.annotation.Nullable;
import androidx.annotation.Px;

/* JADX INFO: loaded from: classes.dex */
public final class c2 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public int f3681a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f3682b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f3683c;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public Interpolator f3685e;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f3684d = -1;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public boolean f3686f = false;

    public c2(@Px int i10, @Px int i11, int i12, @Nullable Interpolator interpolator) {
        this.f3681a = i10;
        this.f3682b = i11;
        this.f3683c = i12;
        this.f3685e = interpolator;
    }

    public final void a(RecyclerView recyclerView) {
        int i10 = this.f3684d;
        if (i10 >= 0) {
            this.f3684d = -1;
            recyclerView.jumpToPositionForSmoothScroller(i10);
            this.f3686f = false;
        } else if (this.f3686f) {
            Interpolator interpolator = this.f3685e;
            if (interpolator != null && this.f3683c < 1) {
                throw new IllegalStateException("If you provide an interpolator, you must set a positive duration");
            }
            int i11 = this.f3683c;
            if (i11 < 1) {
                throw new IllegalStateException("Scroll duration must be a positive number");
            }
            recyclerView.mViewFlinger.smoothScrollBy(this.f3681a, this.f3682b, i11, interpolator);
            this.f3686f = false;
        }
    }

    @Nullable
    public Interpolator getInterpolator() {
        return this.f3685e;
    }

    public void setInterpolator(@Nullable Interpolator interpolator) {
        this.f3686f = true;
        this.f3685e = interpolator;
    }

    public void update(@Px int i10, @Px int i11, int i12, @Nullable Interpolator interpolator) {
        this.f3681a = i10;
        this.f3682b = i11;
        this.f3683c = i12;
        this.f3685e = interpolator;
        this.f3686f = true;
    }
}
