package e9;

import android.content.Context;
import android.graphics.PointF;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.t0;
import com.google.android.material.carousel.CarouselLayoutManager;

/* JADX INFO: loaded from: classes2.dex */
public final class d extends t0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ CarouselLayoutManager f25583a;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public d(CarouselLayoutManager carouselLayoutManager, Context context) {
        super(context);
        this.f25583a = carouselLayoutManager;
    }

    @Override // androidx.recyclerview.widget.t0
    public final int calculateDxToMakeVisible(View view, int i10) {
        CarouselLayoutManager carouselLayoutManager = this.f25583a;
        if (carouselLayoutManager.keylineStateList == null || !carouselLayoutManager.C()) {
            return 0;
        }
        int position = carouselLayoutManager.getPosition(view);
        return (int) (carouselLayoutManager.f22396a - carouselLayoutManager.z(position, carouselLayoutManager.x(position)));
    }

    @Override // androidx.recyclerview.widget.t0
    public final int calculateDyToMakeVisible(View view, int i10) {
        CarouselLayoutManager carouselLayoutManager = this.f25583a;
        if (carouselLayoutManager.keylineStateList == null || carouselLayoutManager.C()) {
            return 0;
        }
        int position = carouselLayoutManager.getPosition(view);
        return (int) (carouselLayoutManager.f22396a - carouselLayoutManager.z(position, carouselLayoutManager.x(position)));
    }

    @Override // androidx.recyclerview.widget.e2
    @Nullable
    public PointF computeScrollVectorForPosition(int i10) {
        return this.f25583a.computeScrollVectorForPosition(i10);
    }
}
