package androidx.recyclerview.widget;

import android.view.View;
import androidx.annotation.Nullable;
import androidx.media3.exoplayer.ExoPlayer;
import java.util.WeakHashMap;

/* JADX INFO: loaded from: classes.dex */
public abstract class h0 {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final y0.g f3720b = new y0.g(1);

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final y0.g f3721c = new y0.g(2);

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

    public static void a(j2 j2Var) {
        View view = j2Var.itemView;
        int i10 = e3.c.item_touch_helper_previous_elevation;
        Object tag = view.getTag(i10);
        if (tag instanceof Float) {
            float fFloatValue = ((Float) tag).floatValue();
            WeakHashMap weakHashMap = androidx.core.view.s1.f1815a;
            androidx.core.view.i1.m(view, fFloatValue);
        }
        view.setTag(i10, null);
        view.setTranslationX(0.0f);
        view.setTranslationY(0.0f);
    }

    public static int b(int i10, int i11) {
        int i12;
        int i13 = i10 & 3158064;
        if (i13 == 0) {
            return i10;
        }
        int i14 = i10 & (~i13);
        if (i11 == 0) {
            i12 = i13 >> 2;
        } else {
            int i15 = i13 >> 1;
            i14 |= (-3158065) & i15;
            i12 = (i15 & 3158064) >> 2;
        }
        return i14 | i12;
    }

    public static int c(int i10, int i11) {
        int i12;
        int i13 = i10 & 789516;
        if (i13 == 0) {
            return i10;
        }
        int i14 = i10 & (~i13);
        if (i11 == 0) {
            i12 = i13 << 2;
        } else {
            int i15 = i13 << 1;
            i14 |= (-789517) & i15;
            i12 = (i15 & 789516) << 2;
        }
        return i14 | i12;
    }

    public static void e(RecyclerView recyclerView, j2 j2Var, float f10, float f11, boolean z10) {
        View view = j2Var.itemView;
        if (z10 && view.getTag(e3.c.item_touch_helper_previous_elevation) == null) {
            WeakHashMap weakHashMap = androidx.core.view.s1.f1815a;
            Float fValueOf = Float.valueOf(androidx.core.view.i1.g(view));
            int childCount = recyclerView.getChildCount();
            float f12 = 0.0f;
            for (int i10 = 0; i10 < childCount; i10++) {
                View childAt = recyclerView.getChildAt(i10);
                if (childAt != view) {
                    WeakHashMap weakHashMap2 = androidx.core.view.s1.f1815a;
                    float fG = androidx.core.view.i1.g(childAt);
                    if (fG > f12) {
                        f12 = fG;
                    }
                }
            }
            androidx.core.view.i1.m(view, f12 + 1.0f);
            view.setTag(e3.c.item_touch_helper_previous_elevation, fValueOf);
        }
        view.setTranslationX(f10);
        view.setTranslationY(f11);
    }

    public final int d(RecyclerView recyclerView, int i10, int i11, long j10) {
        if (this.f3722a == -1) {
            this.f3722a = recyclerView.getResources().getDimensionPixelSize(e3.b.item_touch_helper_max_drag_scroll_per_frame);
        }
        int interpolation = (int) (f3720b.getInterpolation(j10 <= ExoPlayer.DEFAULT_DETACH_SURFACE_TIMEOUT_MS ? j10 / 2000.0f : 1.0f) * ((int) (f3721c.getInterpolation(Math.min(1.0f, (Math.abs(i11) * 1.0f) / i10)) * ((int) Math.signum(i11)) * this.f3722a)));
        return interpolation == 0 ? i11 > 0 ? 1 : -1 : interpolation;
    }

    public void onSelectedChanged(@Nullable j2 j2Var, int i10) {
    }
}
