package N1;

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

/* JADX INFO: renamed from: N1.i, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class RunnableC0208i implements Runnable {

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

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

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final /* synthetic */ C0214o f4554s;

    public /* synthetic */ RunnableC0208i(C0214o c0214o, ArrayList arrayList, int i) {
        this.f4552q = i;
        this.f4554s = c0214o;
        this.f4553r = arrayList;
    }

    @Override // java.lang.Runnable
    public final void run() {
        switch (this.f4552q) {
            case n4.u0.f15495q /* 0 */:
                ArrayList arrayList = this.f4553r;
                int size = arrayList.size();
                int i = 0;
                while (true) {
                    C0214o c0214o = this.f4554s;
                    if (i >= size) {
                        arrayList.clear();
                        c0214o.f4607m.remove(arrayList);
                    } else {
                        Object obj = arrayList.get(i);
                        i++;
                        C0213n c0213n = (C0213n) obj;
                        t0 t0Var = c0213n.f4589a;
                        c0214o.getClass();
                        View view = t0Var.f4654a;
                        int i5 = c0213n.f4592d - c0213n.f4590b;
                        int i8 = c0213n.f4593e - c0213n.f4591c;
                        if (i5 != 0) {
                            view.animate().translationX(0.0f);
                        }
                        if (i8 != 0) {
                            view.animate().translationY(0.0f);
                        }
                        ViewPropertyAnimator viewPropertyAnimatorAnimate = view.animate();
                        c0214o.f4610p.add(t0Var);
                        viewPropertyAnimatorAnimate.setDuration(c0214o.f4498e).setListener(new C0210k(c0214o, t0Var, i5, view, i8, viewPropertyAnimatorAnimate)).start();
                    }
                    break;
                }
                break;
            case 1:
                ArrayList arrayList2 = this.f4553r;
                int size2 = arrayList2.size();
                int i9 = 0;
                while (true) {
                    C0214o c0214o2 = this.f4554s;
                    if (i9 >= size2) {
                        arrayList2.clear();
                        c0214o2.f4608n.remove(arrayList2);
                        break;
                    } else {
                        Object obj2 = arrayList2.get(i9);
                        i9++;
                        C0212m c0212m = (C0212m) obj2;
                        c0214o2.getClass();
                        t0 t0Var2 = c0212m.f4582a;
                        View view2 = t0Var2 == null ? null : t0Var2.f4654a;
                        t0 t0Var3 = c0212m.f4583b;
                        View view3 = t0Var3 != null ? t0Var3.f4654a : null;
                        ArrayList arrayList3 = c0214o2.f4612r;
                        long j8 = c0214o2.f4499f;
                        if (view2 != null) {
                            ViewPropertyAnimator duration = view2.animate().setDuration(j8);
                            arrayList3.add(c0212m.f4582a);
                            duration.translationX(c0212m.f4586e - c0212m.f4584c);
                            duration.translationY(c0212m.f4587f - c0212m.f4585d);
                            duration.alpha(0.0f).setListener(new C0211l(c0214o2, c0212m, duration, view2, 0)).start();
                        }
                        if (view3 != null) {
                            ViewPropertyAnimator viewPropertyAnimatorAnimate2 = view3.animate();
                            arrayList3.add(c0212m.f4583b);
                            viewPropertyAnimatorAnimate2.translationX(0.0f).translationY(0.0f).setDuration(j8).alpha(1.0f).setListener(new C0211l(c0214o2, c0212m, viewPropertyAnimatorAnimate2, view3, 1)).start();
                        }
                    }
                }
                break;
            default:
                ArrayList arrayList4 = this.f4553r;
                int size3 = arrayList4.size();
                int i10 = 0;
                while (true) {
                    C0214o c0214o3 = this.f4554s;
                    if (i10 >= size3) {
                        arrayList4.clear();
                        c0214o3.f4606l.remove(arrayList4);
                    } else {
                        Object obj3 = arrayList4.get(i10);
                        i10++;
                        t0 t0Var4 = (t0) obj3;
                        c0214o3.getClass();
                        View view4 = t0Var4.f4654a;
                        ViewPropertyAnimator viewPropertyAnimatorAnimate3 = view4.animate();
                        c0214o3.f4609o.add(t0Var4);
                        viewPropertyAnimatorAnimate3.alpha(1.0f).setDuration(c0214o3.f4496c).setListener(new C0209j(c0214o3, t0Var4, view4, viewPropertyAnimatorAnimate3)).start();
                    }
                    break;
                }
                break;
        }
    }
}
