package androidx.leanback.widget;

import android.graphics.PointF;
import androidx.leanback.widget.GridLayoutManager;
import androidx.media3.session.MediaUtils;

/* JADX INFO: loaded from: classes.dex */
class ao extends GridLayoutManager.c {
    public final /* synthetic */ GridLayoutManager c;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public ao(GridLayoutManager gridLayoutManager) {
        super();
        this.c = gridLayoutManager;
    }

    @Override // androidx.recyclerview.widget.RecyclerView.ab
    public final PointF computeScrollVectorForPosition(int i) {
        if (getChildCount() == 0) {
            return null;
        }
        GridLayoutManager gridLayoutManager = this.c;
        int position = gridLayoutManager.getPosition(gridLayoutManager.getChildAt(0));
        int i2 = ((gridLayoutManager.p & MediaUtils.TRANSACTION_SIZE_LIMIT_IN_BYTES) == 0 ? i >= position : i <= position) ? 1 : -1;
        return gridLayoutManager.d == 0 ? new PointF(i2, 0.0f) : new PointF(0.0f, i2);
    }
}
