package androidx.recyclerview.widget;

import android.view.View;
import android.view.ViewPropertyAnimator;
import java.util.ArrayList;
import java.util.Iterator;

/* JADX INFO: renamed from: androidx.recyclerview.widget.c, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class RunnableC1153c implements Runnable {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ ArrayList f13031b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ C1159i f13032c;

    public /* synthetic */ RunnableC1153c(C1159i c1159i, ArrayList arrayList, int i6) {
        this.f13030a = i6;
        this.f13032c = c1159i;
        this.f13031b = arrayList;
    }

    @Override // java.lang.Runnable
    public final void run() {
        switch (this.f13030a) {
            case 0:
                ArrayList arrayList = this.f13031b;
                Iterator it = arrayList.iterator();
                while (true) {
                    boolean zHasNext = it.hasNext();
                    C1159i c1159i = this.f13032c;
                    if (!zHasNext) {
                        arrayList.clear();
                        c1159i.f13098m.remove(arrayList);
                    } else {
                        C1158h c1158h = (C1158h) it.next();
                        Z z6 = c1158h.f13082a;
                        c1159i.getClass();
                        View view = z6.itemView;
                        int i6 = c1158h.f13085d - c1158h.f13083b;
                        int i7 = c1158h.f13086e - c1158h.f13084c;
                        if (i6 != 0) {
                            view.animate().translationX(0.0f);
                        }
                        if (i7 != 0) {
                            view.animate().translationY(0.0f);
                        }
                        ViewPropertyAnimator viewPropertyAnimatorAnimate = view.animate();
                        c1159i.f13101p.add(z6);
                        viewPropertyAnimatorAnimate.setDuration(c1159i.f12826e).setListener(new C1155e(c1159i, z6, i6, view, i7, viewPropertyAnimatorAnimate)).start();
                    }
                    break;
                }
                break;
            case 1:
                ArrayList arrayList2 = this.f13031b;
                Iterator it2 = arrayList2.iterator();
                while (true) {
                    boolean zHasNext2 = it2.hasNext();
                    C1159i c1159i2 = this.f13032c;
                    if (!zHasNext2) {
                        arrayList2.clear();
                        c1159i2.f13099n.remove(arrayList2);
                        break;
                    } else {
                        C1157g c1157g = (C1157g) it2.next();
                        c1159i2.getClass();
                        Z z7 = c1157g.f13070a;
                        View view2 = z7 == null ? null : z7.itemView;
                        Z z8 = c1157g.f13071b;
                        View view3 = z8 != null ? z8.itemView : null;
                        ArrayList arrayList3 = c1159i2.f13103r;
                        long j4 = c1159i2.f12827f;
                        if (view2 != null) {
                            ViewPropertyAnimator duration = view2.animate().setDuration(j4);
                            arrayList3.add(c1157g.f13070a);
                            duration.translationX(c1157g.f13074e - c1157g.f13072c);
                            duration.translationY(c1157g.f13075f - c1157g.f13073d);
                            duration.alpha(0.0f).setListener(new C1156f(c1159i2, c1157g, duration, view2, 0)).start();
                        }
                        if (view3 != null) {
                            ViewPropertyAnimator viewPropertyAnimatorAnimate2 = view3.animate();
                            arrayList3.add(c1157g.f13071b);
                            viewPropertyAnimatorAnimate2.translationX(0.0f).translationY(0.0f).setDuration(j4).alpha(1.0f).setListener(new C1156f(c1159i2, c1157g, viewPropertyAnimatorAnimate2, view3, 1)).start();
                        }
                    }
                }
                break;
            default:
                ArrayList arrayList4 = this.f13031b;
                Iterator it3 = arrayList4.iterator();
                while (true) {
                    boolean zHasNext3 = it3.hasNext();
                    C1159i c1159i3 = this.f13032c;
                    if (!zHasNext3) {
                        arrayList4.clear();
                        c1159i3.l.remove(arrayList4);
                    } else {
                        Z z9 = (Z) it3.next();
                        c1159i3.getClass();
                        View view4 = z9.itemView;
                        ViewPropertyAnimator viewPropertyAnimatorAnimate3 = view4.animate();
                        c1159i3.f13100o.add(z9);
                        viewPropertyAnimatorAnimate3.alpha(1.0f).setDuration(c1159i3.f12824c).setListener(new C1154d(c1159i3, z9, view4, viewPropertyAnimatorAnimate3)).start();
                    }
                    break;
                }
                break;
        }
    }
}
