package androidx.recyclerview.widget;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.view.View;
import android.view.ViewPropertyAnimator;
import androidx.core.view.y;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/* JADX INFO: compiled from: DefaultItemAnimator.java */
/* JADX INFO: loaded from: classes.dex */
public class c extends m {

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    private static TimeInterpolator f2871s;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private ArrayList<RecyclerView.d0> f2872h = new ArrayList<>();

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private ArrayList<RecyclerView.d0> f2873i = new ArrayList<>();

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    private ArrayList<j> f2874j = new ArrayList<>();

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    private ArrayList<i> f2875k = new ArrayList<>();

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    ArrayList<ArrayList<RecyclerView.d0>> f2876l = new ArrayList<>();

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    ArrayList<ArrayList<j>> f2877m = new ArrayList<>();

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    ArrayList<ArrayList<i>> f2878n = new ArrayList<>();

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    ArrayList<RecyclerView.d0> f2879o = new ArrayList<>();

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    ArrayList<RecyclerView.d0> f2880p = new ArrayList<>();

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    ArrayList<RecyclerView.d0> f2881q = new ArrayList<>();

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    ArrayList<RecyclerView.d0> f2882r = new ArrayList<>();

    /* JADX INFO: compiled from: DefaultItemAnimator.java */
    class a implements Runnable {

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        final /* synthetic */ ArrayList f2883e;

        a(ArrayList arrayList) {
            this.f2883e = arrayList;
        }

        @Override // java.lang.Runnable
        public void run() {
            for (j jVar : this.f2883e) {
                c.this.S(jVar.f2917a, jVar.f2918b, jVar.f2919c, jVar.f2920d, jVar.f2921e);
            }
            this.f2883e.clear();
            c.this.f2877m.remove(this.f2883e);
        }
    }

    /* JADX INFO: compiled from: DefaultItemAnimator.java */
    class b implements Runnable {

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        final /* synthetic */ ArrayList f2885e;

        b(ArrayList arrayList) {
            this.f2885e = arrayList;
        }

        @Override // java.lang.Runnable
        public void run() {
            Iterator it = this.f2885e.iterator();
            while (it.hasNext()) {
                c.this.R((i) it.next());
            }
            this.f2885e.clear();
            c.this.f2878n.remove(this.f2885e);
        }
    }

    /* JADX INFO: renamed from: androidx.recyclerview.widget.c$c, reason: collision with other inner class name */
    /* JADX INFO: compiled from: DefaultItemAnimator.java */
    class RunnableC0041c implements Runnable {

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        final /* synthetic */ ArrayList f2887e;

        RunnableC0041c(ArrayList arrayList) {
            this.f2887e = arrayList;
        }

        @Override // java.lang.Runnable
        public void run() {
            Iterator it = this.f2887e.iterator();
            while (it.hasNext()) {
                c.this.Q((RecyclerView.d0) it.next());
            }
            this.f2887e.clear();
            c.this.f2876l.remove(this.f2887e);
        }
    }

    /* JADX INFO: compiled from: DefaultItemAnimator.java */
    class d extends AnimatorListenerAdapter {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        final /* synthetic */ RecyclerView.d0 f2889a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        final /* synthetic */ ViewPropertyAnimator f2890b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        final /* synthetic */ View f2891c;

        d(RecyclerView.d0 d0Var, ViewPropertyAnimator viewPropertyAnimator, View view) {
            this.f2889a = d0Var;
            this.f2890b = viewPropertyAnimator;
            this.f2891c = view;
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationEnd(Animator animator) {
            this.f2890b.setListener(null);
            this.f2891c.setAlpha(1.0f);
            c.this.G(this.f2889a);
            c.this.f2881q.remove(this.f2889a);
            c.this.V();
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationStart(Animator animator) {
            c.this.H(this.f2889a);
        }
    }

    /* JADX INFO: compiled from: DefaultItemAnimator.java */
    class e extends AnimatorListenerAdapter {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        final /* synthetic */ RecyclerView.d0 f2893a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        final /* synthetic */ View f2894b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        final /* synthetic */ ViewPropertyAnimator f2895c;

        e(RecyclerView.d0 d0Var, View view, ViewPropertyAnimator viewPropertyAnimator) {
            this.f2893a = d0Var;
            this.f2894b = view;
            this.f2895c = viewPropertyAnimator;
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationCancel(Animator animator) {
            this.f2894b.setAlpha(1.0f);
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationEnd(Animator animator) {
            this.f2895c.setListener(null);
            c.this.A(this.f2893a);
            c.this.f2879o.remove(this.f2893a);
            c.this.V();
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationStart(Animator animator) {
            c.this.B(this.f2893a);
        }
    }

    /* JADX INFO: compiled from: DefaultItemAnimator.java */
    class f extends AnimatorListenerAdapter {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        final /* synthetic */ RecyclerView.d0 f2897a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        final /* synthetic */ int f2898b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        final /* synthetic */ View f2899c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        final /* synthetic */ int f2900d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        final /* synthetic */ ViewPropertyAnimator f2901e;

        f(RecyclerView.d0 d0Var, int i3, View view, int i4, ViewPropertyAnimator viewPropertyAnimator) {
            this.f2897a = d0Var;
            this.f2898b = i3;
            this.f2899c = view;
            this.f2900d = i4;
            this.f2901e = viewPropertyAnimator;
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationCancel(Animator animator) {
            if (this.f2898b != 0) {
                this.f2899c.setTranslationX(0.0f);
            }
            if (this.f2900d != 0) {
                this.f2899c.setTranslationY(0.0f);
            }
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationEnd(Animator animator) {
            this.f2901e.setListener(null);
            c.this.E(this.f2897a);
            c.this.f2880p.remove(this.f2897a);
            c.this.V();
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationStart(Animator animator) {
            c.this.F(this.f2897a);
        }
    }

    /* JADX INFO: compiled from: DefaultItemAnimator.java */
    class g extends AnimatorListenerAdapter {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        final /* synthetic */ i f2903a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        final /* synthetic */ ViewPropertyAnimator f2904b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        final /* synthetic */ View f2905c;

        g(i iVar, ViewPropertyAnimator viewPropertyAnimator, View view) {
            this.f2903a = iVar;
            this.f2904b = viewPropertyAnimator;
            this.f2905c = view;
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationEnd(Animator animator) {
            this.f2904b.setListener(null);
            this.f2905c.setAlpha(1.0f);
            this.f2905c.setTranslationX(0.0f);
            this.f2905c.setTranslationY(0.0f);
            c.this.C(this.f2903a.f2911a, true);
            c.this.f2882r.remove(this.f2903a.f2911a);
            c.this.V();
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationStart(Animator animator) {
            c.this.D(this.f2903a.f2911a, true);
        }
    }

    /* JADX INFO: compiled from: DefaultItemAnimator.java */
    class h extends AnimatorListenerAdapter {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        final /* synthetic */ i f2907a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        final /* synthetic */ ViewPropertyAnimator f2908b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        final /* synthetic */ View f2909c;

        h(i iVar, ViewPropertyAnimator viewPropertyAnimator, View view) {
            this.f2907a = iVar;
            this.f2908b = viewPropertyAnimator;
            this.f2909c = view;
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationEnd(Animator animator) {
            this.f2908b.setListener(null);
            this.f2909c.setAlpha(1.0f);
            this.f2909c.setTranslationX(0.0f);
            this.f2909c.setTranslationY(0.0f);
            c.this.C(this.f2907a.f2912b, false);
            c.this.f2882r.remove(this.f2907a.f2912b);
            c.this.V();
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationStart(Animator animator) {
            c.this.D(this.f2907a.f2912b, false);
        }
    }

    /* JADX INFO: compiled from: DefaultItemAnimator.java */
    private static class j {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public RecyclerView.d0 f2917a;

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

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

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

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

        j(RecyclerView.d0 d0Var, int i3, int i4, int i5, int i6) {
            this.f2917a = d0Var;
            this.f2918b = i3;
            this.f2919c = i4;
            this.f2920d = i5;
            this.f2921e = i6;
        }
    }

    private void T(RecyclerView.d0 d0Var) {
        View view = d0Var.f2724a;
        ViewPropertyAnimator viewPropertyAnimatorAnimate = view.animate();
        this.f2881q.add(d0Var);
        viewPropertyAnimatorAnimate.setDuration(o()).alpha(0.0f).setListener(new d(d0Var, viewPropertyAnimatorAnimate, view)).start();
    }

    private void W(List<i> list, RecyclerView.d0 d0Var) {
        for (int size = list.size() - 1; size >= 0; size--) {
            i iVar = list.get(size);
            if (Y(iVar, d0Var) && iVar.f2911a == null && iVar.f2912b == null) {
                list.remove(iVar);
            }
        }
    }

    private void X(i iVar) {
        RecyclerView.d0 d0Var = iVar.f2911a;
        if (d0Var != null) {
            Y(iVar, d0Var);
        }
        RecyclerView.d0 d0Var2 = iVar.f2912b;
        if (d0Var2 != null) {
            Y(iVar, d0Var2);
        }
    }

    private boolean Y(i iVar, RecyclerView.d0 d0Var) {
        boolean z2 = false;
        if (iVar.f2912b == d0Var) {
            iVar.f2912b = null;
        } else {
            if (iVar.f2911a != d0Var) {
                return false;
            }
            iVar.f2911a = null;
            z2 = true;
        }
        d0Var.f2724a.setAlpha(1.0f);
        d0Var.f2724a.setTranslationX(0.0f);
        d0Var.f2724a.setTranslationY(0.0f);
        C(d0Var, z2);
        return true;
    }

    private void Z(RecyclerView.d0 d0Var) {
        if (f2871s == null) {
            f2871s = new ValueAnimator().getInterpolator();
        }
        d0Var.f2724a.animate().setInterpolator(f2871s);
        j(d0Var);
    }

    void Q(RecyclerView.d0 d0Var) {
        View view = d0Var.f2724a;
        ViewPropertyAnimator viewPropertyAnimatorAnimate = view.animate();
        this.f2879o.add(d0Var);
        viewPropertyAnimatorAnimate.alpha(1.0f).setDuration(l()).setListener(new e(d0Var, view, viewPropertyAnimatorAnimate)).start();
    }

    void R(i iVar) {
        RecyclerView.d0 d0Var = iVar.f2911a;
        View view = d0Var == null ? null : d0Var.f2724a;
        RecyclerView.d0 d0Var2 = iVar.f2912b;
        View view2 = d0Var2 != null ? d0Var2.f2724a : null;
        if (view != null) {
            ViewPropertyAnimator duration = view.animate().setDuration(m());
            this.f2882r.add(iVar.f2911a);
            duration.translationX(iVar.f2915e - iVar.f2913c);
            duration.translationY(iVar.f2916f - iVar.f2914d);
            duration.alpha(0.0f).setListener(new g(iVar, duration, view)).start();
        }
        if (view2 != null) {
            ViewPropertyAnimator viewPropertyAnimatorAnimate = view2.animate();
            this.f2882r.add(iVar.f2912b);
            viewPropertyAnimatorAnimate.translationX(0.0f).translationY(0.0f).setDuration(m()).alpha(1.0f).setListener(new h(iVar, viewPropertyAnimatorAnimate, view2)).start();
        }
    }

    void S(RecyclerView.d0 d0Var, int i3, int i4, int i5, int i6) {
        View view = d0Var.f2724a;
        int i7 = i5 - i3;
        int i8 = i6 - i4;
        if (i7 != 0) {
            view.animate().translationX(0.0f);
        }
        if (i8 != 0) {
            view.animate().translationY(0.0f);
        }
        ViewPropertyAnimator viewPropertyAnimatorAnimate = view.animate();
        this.f2880p.add(d0Var);
        viewPropertyAnimatorAnimate.setDuration(n()).setListener(new f(d0Var, i7, view, i8, viewPropertyAnimatorAnimate)).start();
    }

    void U(List<RecyclerView.d0> list) {
        for (int size = list.size() - 1; size >= 0; size--) {
            list.get(size).f2724a.animate().cancel();
        }
    }

    void V() {
        if (p()) {
            return;
        }
        i();
    }

    @Override // androidx.recyclerview.widget.RecyclerView.l
    public boolean g(RecyclerView.d0 d0Var, List<Object> list) {
        return !list.isEmpty() || super.g(d0Var, list);
    }

    @Override // androidx.recyclerview.widget.RecyclerView.l
    public void j(RecyclerView.d0 d0Var) {
        View view = d0Var.f2724a;
        view.animate().cancel();
        int size = this.f2874j.size();
        while (true) {
            size--;
            if (size < 0) {
                break;
            }
            if (this.f2874j.get(size).f2917a == d0Var) {
                view.setTranslationY(0.0f);
                view.setTranslationX(0.0f);
                E(d0Var);
                this.f2874j.remove(size);
            }
        }
        W(this.f2875k, d0Var);
        if (this.f2872h.remove(d0Var)) {
            view.setAlpha(1.0f);
            G(d0Var);
        }
        if (this.f2873i.remove(d0Var)) {
            view.setAlpha(1.0f);
            A(d0Var);
        }
        for (int size2 = this.f2878n.size() - 1; size2 >= 0; size2--) {
            ArrayList<i> arrayList = this.f2878n.get(size2);
            W(arrayList, d0Var);
            if (arrayList.isEmpty()) {
                this.f2878n.remove(size2);
            }
        }
        for (int size3 = this.f2877m.size() - 1; size3 >= 0; size3--) {
            ArrayList<j> arrayList2 = this.f2877m.get(size3);
            int size4 = arrayList2.size() - 1;
            while (true) {
                if (size4 < 0) {
                    break;
                }
                if (arrayList2.get(size4).f2917a == d0Var) {
                    view.setTranslationY(0.0f);
                    view.setTranslationX(0.0f);
                    E(d0Var);
                    arrayList2.remove(size4);
                    if (arrayList2.isEmpty()) {
                        this.f2877m.remove(size3);
                    }
                } else {
                    size4--;
                }
            }
        }
        for (int size5 = this.f2876l.size() - 1; size5 >= 0; size5--) {
            ArrayList<RecyclerView.d0> arrayList3 = this.f2876l.get(size5);
            if (arrayList3.remove(d0Var)) {
                view.setAlpha(1.0f);
                A(d0Var);
                if (arrayList3.isEmpty()) {
                    this.f2876l.remove(size5);
                }
            }
        }
        this.f2881q.remove(d0Var);
        this.f2879o.remove(d0Var);
        this.f2882r.remove(d0Var);
        this.f2880p.remove(d0Var);
        V();
    }

    @Override // androidx.recyclerview.widget.RecyclerView.l
    public void k() {
        int size = this.f2874j.size();
        while (true) {
            size--;
            if (size < 0) {
                break;
            }
            j jVar = this.f2874j.get(size);
            View view = jVar.f2917a.f2724a;
            view.setTranslationY(0.0f);
            view.setTranslationX(0.0f);
            E(jVar.f2917a);
            this.f2874j.remove(size);
        }
        for (int size2 = this.f2872h.size() - 1; size2 >= 0; size2--) {
            G(this.f2872h.get(size2));
            this.f2872h.remove(size2);
        }
        int size3 = this.f2873i.size();
        while (true) {
            size3--;
            if (size3 < 0) {
                break;
            }
            RecyclerView.d0 d0Var = this.f2873i.get(size3);
            d0Var.f2724a.setAlpha(1.0f);
            A(d0Var);
            this.f2873i.remove(size3);
        }
        for (int size4 = this.f2875k.size() - 1; size4 >= 0; size4--) {
            X(this.f2875k.get(size4));
        }
        this.f2875k.clear();
        if (p()) {
            for (int size5 = this.f2877m.size() - 1; size5 >= 0; size5--) {
                ArrayList<j> arrayList = this.f2877m.get(size5);
                for (int size6 = arrayList.size() - 1; size6 >= 0; size6--) {
                    j jVar2 = arrayList.get(size6);
                    View view2 = jVar2.f2917a.f2724a;
                    view2.setTranslationY(0.0f);
                    view2.setTranslationX(0.0f);
                    E(jVar2.f2917a);
                    arrayList.remove(size6);
                    if (arrayList.isEmpty()) {
                        this.f2877m.remove(arrayList);
                    }
                }
            }
            for (int size7 = this.f2876l.size() - 1; size7 >= 0; size7--) {
                ArrayList<RecyclerView.d0> arrayList2 = this.f2876l.get(size7);
                for (int size8 = arrayList2.size() - 1; size8 >= 0; size8--) {
                    RecyclerView.d0 d0Var2 = arrayList2.get(size8);
                    d0Var2.f2724a.setAlpha(1.0f);
                    A(d0Var2);
                    arrayList2.remove(size8);
                    if (arrayList2.isEmpty()) {
                        this.f2876l.remove(arrayList2);
                    }
                }
            }
            for (int size9 = this.f2878n.size() - 1; size9 >= 0; size9--) {
                ArrayList<i> arrayList3 = this.f2878n.get(size9);
                for (int size10 = arrayList3.size() - 1; size10 >= 0; size10--) {
                    X(arrayList3.get(size10));
                    if (arrayList3.isEmpty()) {
                        this.f2878n.remove(arrayList3);
                    }
                }
            }
            U(this.f2881q);
            U(this.f2880p);
            U(this.f2879o);
            U(this.f2882r);
            i();
        }
    }

    @Override // androidx.recyclerview.widget.RecyclerView.l
    public boolean p() {
        return (this.f2873i.isEmpty() && this.f2875k.isEmpty() && this.f2874j.isEmpty() && this.f2872h.isEmpty() && this.f2880p.isEmpty() && this.f2881q.isEmpty() && this.f2879o.isEmpty() && this.f2882r.isEmpty() && this.f2877m.isEmpty() && this.f2876l.isEmpty() && this.f2878n.isEmpty()) ? false : true;
    }

    @Override // androidx.recyclerview.widget.RecyclerView.l
    public void u() {
        boolean z2 = !this.f2872h.isEmpty();
        boolean z3 = !this.f2874j.isEmpty();
        boolean z4 = !this.f2875k.isEmpty();
        boolean z5 = !this.f2873i.isEmpty();
        if (z2 || z3 || z5 || z4) {
            Iterator<RecyclerView.d0> it = this.f2872h.iterator();
            while (it.hasNext()) {
                T(it.next());
            }
            this.f2872h.clear();
            if (z3) {
                ArrayList<j> arrayList = new ArrayList<>();
                arrayList.addAll(this.f2874j);
                this.f2877m.add(arrayList);
                this.f2874j.clear();
                a aVar = new a(arrayList);
                if (z2) {
                    y.k0(arrayList.get(0).f2917a.f2724a, aVar, o());
                } else {
                    aVar.run();
                }
            }
            if (z4) {
                ArrayList<i> arrayList2 = new ArrayList<>();
                arrayList2.addAll(this.f2875k);
                this.f2878n.add(arrayList2);
                this.f2875k.clear();
                b bVar = new b(arrayList2);
                if (z2) {
                    y.k0(arrayList2.get(0).f2911a.f2724a, bVar, o());
                } else {
                    bVar.run();
                }
            }
            if (z5) {
                ArrayList<RecyclerView.d0> arrayList3 = new ArrayList<>();
                arrayList3.addAll(this.f2873i);
                this.f2876l.add(arrayList3);
                this.f2873i.clear();
                RunnableC0041c runnableC0041c = new RunnableC0041c(arrayList3);
                if (z2 || z3 || z4) {
                    y.k0(arrayList3.get(0).f2724a, runnableC0041c, (z2 ? o() : 0L) + Math.max(z3 ? n() : 0L, z4 ? m() : 0L));
                } else {
                    runnableC0041c.run();
                }
            }
        }
    }

    @Override // androidx.recyclerview.widget.m
    public boolean w(RecyclerView.d0 d0Var) {
        Z(d0Var);
        d0Var.f2724a.setAlpha(0.0f);
        this.f2873i.add(d0Var);
        return true;
    }

    @Override // androidx.recyclerview.widget.m
    public boolean x(RecyclerView.d0 d0Var, RecyclerView.d0 d0Var2, int i3, int i4, int i5, int i6) {
        if (d0Var == d0Var2) {
            return y(d0Var, i3, i4, i5, i6);
        }
        float translationX = d0Var.f2724a.getTranslationX();
        float translationY = d0Var.f2724a.getTranslationY();
        float alpha = d0Var.f2724a.getAlpha();
        Z(d0Var);
        int i7 = (int) ((i5 - i3) - translationX);
        int i8 = (int) ((i6 - i4) - translationY);
        d0Var.f2724a.setTranslationX(translationX);
        d0Var.f2724a.setTranslationY(translationY);
        d0Var.f2724a.setAlpha(alpha);
        if (d0Var2 != null) {
            Z(d0Var2);
            d0Var2.f2724a.setTranslationX(-i7);
            d0Var2.f2724a.setTranslationY(-i8);
            d0Var2.f2724a.setAlpha(0.0f);
        }
        this.f2875k.add(new i(d0Var, d0Var2, i3, i4, i5, i6));
        return true;
    }

    @Override // androidx.recyclerview.widget.m
    public boolean y(RecyclerView.d0 d0Var, int i3, int i4, int i5, int i6) {
        View view = d0Var.f2724a;
        int translationX = i3 + ((int) view.getTranslationX());
        int translationY = i4 + ((int) d0Var.f2724a.getTranslationY());
        Z(d0Var);
        int i7 = i5 - translationX;
        int i8 = i6 - translationY;
        if (i7 == 0 && i8 == 0) {
            E(d0Var);
            return false;
        }
        if (i7 != 0) {
            view.setTranslationX(-i7);
        }
        if (i8 != 0) {
            view.setTranslationY(-i8);
        }
        this.f2874j.add(new j(d0Var, translationX, translationY, i5, i6));
        return true;
    }

    @Override // androidx.recyclerview.widget.m
    public boolean z(RecyclerView.d0 d0Var) {
        Z(d0Var);
        this.f2872h.add(d0Var);
        return true;
    }

    /* JADX INFO: compiled from: DefaultItemAnimator.java */
    private static class i {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public RecyclerView.d0 f2911a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public RecyclerView.d0 f2912b;

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

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

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

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

        private i(RecyclerView.d0 d0Var, RecyclerView.d0 d0Var2) {
            this.f2911a = d0Var;
            this.f2912b = d0Var2;
        }

        public String toString() {
            return "ChangeInfo{oldHolder=" + this.f2911a + ", newHolder=" + this.f2912b + ", fromX=" + this.f2913c + ", fromY=" + this.f2914d + ", toX=" + this.f2915e + ", toY=" + this.f2916f + '}';
        }

        i(RecyclerView.d0 d0Var, RecyclerView.d0 d0Var2, int i3, int i4, int i5, int i6) {
            this(d0Var, d0Var2);
            this.f2913c = i3;
            this.f2914d = i4;
            this.f2915e = i5;
            this.f2916f = i6;
        }
    }
}
