package o; import android.animation.TimeInterpolator; import android.animation.ValueAnimator; import android.view.View; import androidx.core.view.ViewCompat; import androidx.core.view.ViewPropertyAnimatorCompat; import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import o.CMR; /* loaded from: classes2.dex */ public abstract class xZG { private static TimeInterpolator c; protected final IgN b; public List a = new ArrayList(); protected final List e = new ArrayList(); protected final List> d = new ArrayList(); protected abstract void a(T t); protected abstract void a(T t, RecyclerView.zJl zjl); protected abstract void b(T t, RecyclerView.zJl zjl); public abstract void c(T t, RecyclerView.zJl zjl); /* JADX INFO: Access modifiers changed from: protected */ public abstract void d(T t, RecyclerView.zJl zjl); public abstract void e(T t, RecyclerView.zJl zjl); protected abstract boolean f(T t, RecyclerView.zJl zjl); public xZG(IgN igN) { this.b = igN; } /* JADX INFO: Access modifiers changed from: protected */ public final boolean b() { return this.b.b(); } public final boolean g() { return (this.a.isEmpty() && this.e.isEmpty() && this.d.isEmpty()) ? false : true; } public final boolean d(RecyclerView.zJl zjl) { return this.e.remove(zjl); } public final void e() { List list = this.e; for (int size = list.size() - 1; size >= 0; size--) { ViewCompat.b(list.get(size).itemView).d(); } } /* JADX WARN: Multi-variable type inference failed */ public final void c(boolean z, long j) { ArrayList arrayList = new ArrayList(this.a); this.a.clear(); if (z) { this.d.add(arrayList); ViewCompat.b(((CMR) arrayList.get(0)).e().itemView, new Runnable(this, arrayList) { // from class: o.xZG.5 private xZG c; private List d; { this.c = this; this.d = arrayList; } /* JADX WARN: Multi-variable type inference failed */ @Override // java.lang.Runnable public final void run() { Iterator it = this.d.iterator(); while (it.hasNext()) { this.c.e((CMR) it.next()); } this.d.clear(); this.c.d.remove(this.d); } }, j); } else { Iterator it = arrayList.iterator(); while (it.hasNext()) { a((xZG) it.next()); } arrayList.clear(); } } public final void a(RecyclerView.zJl zjl) { List list = this.a; for (int size = list.size() - 1; size >= 0; size--) { if (f(list.get(size), zjl) && zjl != null) { list.remove(size); } } if (zjl == null) { list.clear(); } } public final void d() { a((RecyclerView.zJl) null); } public final void b(RecyclerView.zJl zjl) { for (int size = this.d.size() - 1; size >= 0; size--) { List list = this.d.get(size); for (int size2 = list.size() - 1; size2 >= 0; size2--) { if (f(list.get(size2), zjl) && zjl != null) { list.remove(size2); } } if (zjl == null) { list.clear(); } if (list.isEmpty()) { this.d.remove(list); } } } public final void a() { b(null); } final void e(T t) { a((xZG) t); } /* JADX INFO: Access modifiers changed from: protected */ public final void h(RecyclerView.zJl zjl) { if (c == null) { c = new ValueAnimator().getInterpolator(); } zjl.itemView.animate().setInterpolator(c); this.b.endAnimation(zjl); } protected final void c() { this.b.c(); } /* JADX INFO: Access modifiers changed from: protected */ public final void e(T t, RecyclerView.zJl zjl, ViewPropertyAnimatorCompat viewPropertyAnimatorCompat) { viewPropertyAnimatorCompat.b(new Sts(this, t, zjl, viewPropertyAnimatorCompat)); if (zjl == null) { throw new IllegalStateException("item is null"); } this.e.add(zjl); viewPropertyAnimatorCompat.c(); } /* JADX INFO: Access modifiers changed from: protected */ /* loaded from: classes2.dex */ public static class Sts implements InterfaceC15687hkl { private CMR a; private ViewPropertyAnimatorCompat c; private RecyclerView.zJl d; private xZG e; public Sts(xZG xzg, CMR cmr, RecyclerView.zJl zjl, ViewPropertyAnimatorCompat viewPropertyAnimatorCompat) { this.e = xzg; this.a = cmr; this.d = zjl; this.c = viewPropertyAnimatorCompat; } /* JADX WARN: Multi-variable type inference failed */ @Override // o.InterfaceC15687hkl public final void e(View view) { this.e.e(this.a, this.d); } /* JADX WARN: Multi-variable type inference failed */ @Override // o.InterfaceC15687hkl public final void d(View view) { xZG xzg = this.e; CMR cmr = this.a; RecyclerView.zJl zjl = this.d; this.c.b((InterfaceC15687hkl) null); this.e = null; this.a = null; this.d = null; this.c = null; xzg.b(cmr, zjl); xzg.c((xZG) cmr, zjl); cmr.e(zjl); xzg.e.remove(zjl); xzg.c(); } /* JADX WARN: Multi-variable type inference failed */ @Override // o.InterfaceC15687hkl public final void b(View view) { this.e.a(this.a, this.d); } } }