package o;

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

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.gq, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class RunnableC1328gq implements Runnable {
    public final /* synthetic */ int l;
    public final /* synthetic */ ArrayList m;
    public final /* synthetic */ C1899mq n;

    public /* synthetic */ RunnableC1328gq(C1899mq c1899mq, ArrayList arrayList, int i) {
        this.l = i;
        this.n = c1899mq;
        this.m = arrayList;
    }

    @Override // java.lang.Runnable
    public final void run() {
        switch (this.l) {
            case 0:
                ArrayList arrayList = this.m;
                int size = arrayList.size();
                int i = 0;
                while (true) {
                    C1899mq c1899mq = this.n;
                    if (i >= size) {
                        arrayList.clear();
                        c1899mq.m.remove(arrayList);
                        break;
                    } else {
                        Object obj = arrayList.get(i);
                        i++;
                        C1804lq c1804lq = (C1804lq) obj;
                        AbstractC2488t10 abstractC2488t10 = c1804lq.a;
                        int i2 = c1804lq.b;
                        int i3 = c1804lq.c;
                        int i4 = c1804lq.d;
                        int i5 = c1804lq.e;
                        c1899mq.getClass();
                        View view = abstractC2488t10.a;
                        int i6 = i4 - i2;
                        int i7 = i5 - i3;
                        if (i6 != 0) {
                            view.animate().translationX(0.0f);
                        }
                        if (i7 != 0) {
                            view.animate().translationY(0.0f);
                        }
                        ViewPropertyAnimator viewPropertyAnimatorAnimate = view.animate();
                        c1899mq.p.add(abstractC2488t10);
                        viewPropertyAnimatorAnimate.setDuration(c1899mq.e).setListener(new C1519iq(c1899mq, abstractC2488t10, i6, view, i7, viewPropertyAnimatorAnimate)).start();
                    }
                }
            case 1:
                ArrayList arrayList2 = this.m;
                int size2 = arrayList2.size();
                int i8 = 0;
                while (true) {
                    C1899mq c1899mq2 = this.n;
                    if (i8 >= size2) {
                        arrayList2.clear();
                        c1899mq2.n.remove(arrayList2);
                        break;
                    } else {
                        Object obj2 = arrayList2.get(i8);
                        i8++;
                        C1709kq c1709kq = (C1709kq) obj2;
                        ArrayList arrayList3 = c1899mq2.r;
                        long j = c1899mq2.f;
                        AbstractC2488t10 abstractC2488t102 = c1709kq.a;
                        View view2 = abstractC2488t102 == null ? null : abstractC2488t102.a;
                        AbstractC2488t10 abstractC2488t103 = c1709kq.b;
                        View view3 = abstractC2488t103 != null ? abstractC2488t103.a : null;
                        if (view2 != null) {
                            ViewPropertyAnimator duration = view2.animate().setDuration(j);
                            arrayList3.add(c1709kq.a);
                            duration.translationX(c1709kq.e - c1709kq.c);
                            duration.translationY(c1709kq.f - c1709kq.d);
                            duration.alpha(0.0f).setListener(new C1614jq(c1899mq2, c1709kq, duration, view2, 0)).start();
                        }
                        if (view3 != null) {
                            ViewPropertyAnimator viewPropertyAnimatorAnimate2 = view3.animate();
                            arrayList3.add(c1709kq.b);
                            viewPropertyAnimatorAnimate2.translationX(0.0f).translationY(0.0f).setDuration(j).alpha(1.0f).setListener(new C1614jq(c1899mq2, c1709kq, viewPropertyAnimatorAnimate2, view3, 1)).start();
                        }
                    }
                }
            default:
                ArrayList arrayList4 = this.m;
                int size3 = arrayList4.size();
                int i9 = 0;
                while (true) {
                    C1899mq c1899mq3 = this.n;
                    if (i9 >= size3) {
                        arrayList4.clear();
                        c1899mq3.l.remove(arrayList4);
                        break;
                    } else {
                        Object obj3 = arrayList4.get(i9);
                        i9++;
                        AbstractC2488t10 abstractC2488t104 = (AbstractC2488t10) obj3;
                        c1899mq3.getClass();
                        View view4 = abstractC2488t104.a;
                        ViewPropertyAnimator viewPropertyAnimatorAnimate3 = view4.animate();
                        c1899mq3.f640o.add(abstractC2488t104);
                        viewPropertyAnimatorAnimate3.alpha(1.0f).setDuration(c1899mq3.c).setListener(new C1424hq(c1899mq3, abstractC2488t104, view4, viewPropertyAnimatorAnimate3)).start();
                    }
                }
        }
    }
}
