package ῲ.䀟.K;

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.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
import ඓ.K.K.K.C1293;

/* renamed from: ῲ.䀟.K.ⁱ  reason: contains not printable characters */
/* compiled from: DefaultItemAnimator */
public class C2319 extends AbstractC2343 {

    /* renamed from: ݜ  reason: contains not printable characters */
    public static TimeInterpolator f8004;

    /* renamed from: Ԕ  reason: contains not printable characters */
    public ArrayList<ArrayList<C2321>> f8005 = new ArrayList<>();

    /* renamed from: ؿ  reason: contains not printable characters */
    public ArrayList<RecyclerView.AbstractC0269> f8006 = new ArrayList<>();

    /* renamed from: ᓣ  reason: contains not printable characters */
    public ArrayList<RecyclerView.AbstractC0269> f8007 = new ArrayList<>();

    /* renamed from: ᕣ  reason: contains not printable characters */
    public ArrayList<C2321> f8008 = new ArrayList<>();

    /* renamed from: ᨨ  reason: contains not printable characters */
    public ArrayList<RecyclerView.AbstractC0269> f8009 = new ArrayList<>();

    /* renamed from: 㑃  reason: contains not printable characters */
    public ArrayList<ArrayList<RecyclerView.AbstractC0269>> f8010 = new ArrayList<>();

    /* renamed from: 㗗  reason: contains not printable characters */
    public ArrayList<RecyclerView.AbstractC0269> f8011 = new ArrayList<>();

    /* renamed from: 㗽  reason: contains not printable characters */
    public ArrayList<RecyclerView.AbstractC0269> f8012 = new ArrayList<>();

    /* renamed from: 㳳  reason: contains not printable characters */
    public ArrayList<C2324> f8013 = new ArrayList<>();

    /* renamed from: 㿎  reason: contains not printable characters */
    public ArrayList<RecyclerView.AbstractC0269> f8014 = new ArrayList<>();

    /* renamed from: 䁗  reason: contains not printable characters */
    public ArrayList<ArrayList<C2324>> f8015 = new ArrayList<>();

    /* renamed from: ῲ.䀟.K.ⁱ$ʬ  reason: contains not printable characters */
    /* compiled from: DefaultItemAnimator */
    public class C2320 extends AnimatorListenerAdapter {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final /* synthetic */ View f8016;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final /* synthetic */ ViewPropertyAnimator f8017;

        /* renamed from: K  reason: contains not printable characters */
        public final /* synthetic */ C2321 f8018;

        public C2320(C2321 r2, ViewPropertyAnimator viewPropertyAnimator, View view) {
            this.f8018 = r2;
            this.f8017 = viewPropertyAnimator;
            this.f8016 = view;
        }

        public void onAnimationEnd(Animator animator) {
            this.f8017.setListener(null);
            this.f8016.setAlpha(1.0f);
            this.f8016.setTranslationX(0.0f);
            this.f8016.setTranslationY(0.0f);
            C2319.this.m6137(this.f8018.f8023, true);
            C2319.this.f8012.remove(this.f8018.f8023);
            C2319.this.m6076();
        }

        public void onAnimationStart(Animator animator) {
            C2319.this.m6135(this.f8018.f8023, true);
        }
    }

    /* renamed from: ῲ.䀟.K.ⁱ$ඓ  reason: contains not printable characters */
    /* compiled from: DefaultItemAnimator */
    public static class C2321 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public int f8020;

        /* renamed from: ඓ  reason: contains not printable characters */
        public int f8021;

        /* renamed from: ῲ  reason: contains not printable characters */
        public RecyclerView.AbstractC0269 f8022;

        /* renamed from: K  reason: contains not printable characters */
        public RecyclerView.AbstractC0269 f8023;

        /* renamed from: 㴹  reason: contains not printable characters */
        public int f8024;

        /* renamed from: 㸾  reason: contains not printable characters */
        public int f8025;

        public C2321(RecyclerView.AbstractC0269 r1, RecyclerView.AbstractC0269 r2, int i, int i2, int i3, int i4) {
            this.f8023 = r1;
            this.f8022 = r2;
            this.f8020 = i;
            this.f8025 = i2;
            this.f8021 = i3;
            this.f8024 = i4;
        }

        public String toString() {
            StringBuilder r0 = C1293.m3416("ChangeInfo{oldHolder=");
            r0.append(this.f8023);
            r0.append(", newHolder=");
            r0.append(this.f8022);
            r0.append(", fromX=");
            r0.append(this.f8020);
            r0.append(", fromY=");
            r0.append(this.f8025);
            r0.append(", toX=");
            r0.append(this.f8021);
            r0.append(", toY=");
            r0.append(this.f8024);
            r0.append('}');
            return r0.toString();
        }
    }

    /* renamed from: ῲ.䀟.K.ⁱ$ῲ  reason: contains not printable characters */
    /* compiled from: DefaultItemAnimator */
    public class C2322 extends AnimatorListenerAdapter {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final /* synthetic */ View f8026;

        /* renamed from: ඓ  reason: contains not printable characters */
        public final /* synthetic */ ViewPropertyAnimator f8027;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final /* synthetic */ int f8028;

        /* renamed from: K  reason: contains not printable characters */
        public final /* synthetic */ RecyclerView.AbstractC0269 f8029;

        /* renamed from: 㸾  reason: contains not printable characters */
        public final /* synthetic */ int f8031;

        public C2322(RecyclerView.AbstractC0269 r2, int i, View view, int i2, ViewPropertyAnimator viewPropertyAnimator) {
            this.f8029 = r2;
            this.f8028 = i;
            this.f8026 = view;
            this.f8031 = i2;
            this.f8027 = viewPropertyAnimator;
        }

        public void onAnimationCancel(Animator animator) {
            if (this.f8028 != 0) {
                this.f8026.setTranslationX(0.0f);
            }
            if (this.f8031 != 0) {
                this.f8026.setTranslationY(0.0f);
            }
        }

        public void onAnimationEnd(Animator animator) {
            this.f8027.setListener(null);
            C2319.this.m833(this.f8029);
            C2319.this.f8006.remove(this.f8029);
            C2319.this.m6076();
        }

        public void onAnimationStart(Animator animator) {
            C2319.this.m6134(this.f8029);
        }
    }

    /* renamed from: ῲ.䀟.K.ⁱ$K  reason: contains not printable characters */
    /* compiled from: DefaultItemAnimator */
    public class C2323 extends AnimatorListenerAdapter {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final /* synthetic */ ViewPropertyAnimator f8032;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final /* synthetic */ View f8033;

        /* renamed from: K  reason: contains not printable characters */
        public final /* synthetic */ RecyclerView.AbstractC0269 f8034;

        public C2323(RecyclerView.AbstractC0269 r2, View view, ViewPropertyAnimator viewPropertyAnimator) {
            this.f8034 = r2;
            this.f8033 = view;
            this.f8032 = viewPropertyAnimator;
        }

        public void onAnimationCancel(Animator animator) {
            this.f8033.setAlpha(1.0f);
        }

        public void onAnimationEnd(Animator animator) {
            this.f8032.setListener(null);
            C2319.this.m833(this.f8034);
            C2319.this.f8011.remove(this.f8034);
            C2319.this.m6076();
        }

        public void onAnimationStart(Animator animator) {
            C2319.this.m6142(this.f8034);
        }
    }

    /* renamed from: ῲ.䀟.K.ⁱ$㴹  reason: contains not printable characters */
    /* compiled from: DefaultItemAnimator */
    public static class C2324 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public int f8036;

        /* renamed from: ඓ  reason: contains not printable characters */
        public int f8037;

        /* renamed from: ῲ  reason: contains not printable characters */
        public int f8038;

        /* renamed from: K  reason: contains not printable characters */
        public RecyclerView.AbstractC0269 f8039;

        /* renamed from: 㸾  reason: contains not printable characters */
        public int f8040;

        public C2324(RecyclerView.AbstractC0269 r1, int i, int i2, int i3, int i4) {
            this.f8039 = r1;
            this.f8038 = i;
            this.f8036 = i2;
            this.f8040 = i3;
            this.f8037 = i4;
        }
    }

    /* renamed from: ῲ.䀟.K.ⁱ$㸾  reason: contains not printable characters */
    /* compiled from: DefaultItemAnimator */
    public class C2325 extends AnimatorListenerAdapter {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final /* synthetic */ View f8041;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final /* synthetic */ ViewPropertyAnimator f8042;

        /* renamed from: K  reason: contains not printable characters */
        public final /* synthetic */ C2321 f8043;

        public C2325(C2321 r2, ViewPropertyAnimator viewPropertyAnimator, View view) {
            this.f8043 = r2;
            this.f8042 = viewPropertyAnimator;
            this.f8041 = view;
        }

        public void onAnimationEnd(Animator animator) {
            this.f8042.setListener(null);
            this.f8041.setAlpha(1.0f);
            this.f8041.setTranslationX(0.0f);
            this.f8041.setTranslationY(0.0f);
            C2319.this.m6137(this.f8043.f8022, false);
            C2319.this.f8012.remove(this.f8043.f8022);
            C2319.this.m6076();
        }

        public void onAnimationStart(Animator animator) {
            C2319.this.m6135(this.f8043.f8022, false);
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public void m6068(RecyclerView.AbstractC0269 r8, int i, int i2, int i3, int i4) {
        View view = r8.itemView;
        int i5 = i3 - i;
        int i6 = i4 - i2;
        if (i5 != 0) {
            view.animate().translationX(0.0f);
        }
        if (i6 != 0) {
            view.animate().translationY(0.0f);
        }
        ViewPropertyAnimator animate = view.animate();
        this.f8006.add(r8);
        animate.setDuration(this.f1513).setListener(new C2322(r8, i5, view, i6, animate)).start();
    }

    /* renamed from: ⁱ  reason: contains not printable characters */
    public void m6069(RecyclerView.AbstractC0269 r6) {
        View view = r6.itemView;
        ViewPropertyAnimator animate = view.animate();
        this.f8011.add(r6);
        animate.alpha(1.0f).setDuration(this.f1512).setListener(new C2323(r6, view, animate)).start();
    }

    @Override // ῲ.䀟.K.AbstractC2343
    /* renamed from: K  reason: contains not printable characters */
    public boolean m6073(RecyclerView.AbstractC0269 r9, int i, int i2, int i3, int i4) {
        View view = r9.itemView;
        int translationX = i + ((int) view.getTranslationX());
        int translationY = i2 + ((int) r9.itemView.getTranslationY());
        m6078(r9);
        int i5 = i3 - translationX;
        int i6 = i4 - translationY;
        if (i5 == 0 && i6 == 0) {
            m833(r9);
            return false;
        }
        if (i5 != 0) {
            view.setTranslationX((float) (-i5));
        }
        if (i6 != 0) {
            view.setTranslationY((float) (-i6));
        }
        this.f8013.add(new C2324(r9, translationX, translationY, i3, i4));
        return true;
    }

    /* renamed from: 㴹  reason: contains not printable characters */
    public void m6076() {
        if (!m6077()) {
            m832();
        }
    }

    @Override // androidx.recyclerview.widget.RecyclerView.AbstractC0250
    /* renamed from: 㸾  reason: contains not printable characters */
    public boolean m6077() {
        return !this.f8009.isEmpty() || !this.f8008.isEmpty() || !this.f8013.isEmpty() || !this.f8014.isEmpty() || !this.f8006.isEmpty() || !this.f8007.isEmpty() || !this.f8011.isEmpty() || !this.f8012.isEmpty() || !this.f8015.isEmpty() || !this.f8010.isEmpty() || !this.f8005.isEmpty();
    }

    /* renamed from: 㿎  reason: contains not printable characters */
    public final void m6078(RecyclerView.AbstractC0269 r3) {
        if (f8004 == null) {
            f8004 = new ValueAnimator().getInterpolator();
        }
        r3.itemView.animate().setInterpolator(f8004);
        m6067(r3);
    }

    @Override // androidx.recyclerview.widget.RecyclerView.AbstractC0250
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m6067(RecyclerView.AbstractC0269 r8) {
        View view = r8.itemView;
        view.animate().cancel();
        int size = this.f8013.size();
        while (true) {
            size--;
            if (size < 0) {
                break;
            } else if (this.f8013.get(size).f8039 == r8) {
                view.setTranslationY(0.0f);
                view.setTranslationX(0.0f);
                m833(r8);
                this.f8013.remove(size);
            }
        }
        m6071(this.f8008, r8);
        if (this.f8014.remove(r8)) {
            view.setAlpha(1.0f);
            m833(r8);
        }
        if (this.f8009.remove(r8)) {
            view.setAlpha(1.0f);
            m833(r8);
        }
        for (int size2 = this.f8005.size() - 1; size2 >= 0; size2--) {
            ArrayList<C2321> arrayList = this.f8005.get(size2);
            m6071(arrayList, r8);
            if (arrayList.isEmpty()) {
                this.f8005.remove(size2);
            }
        }
        for (int size3 = this.f8015.size() - 1; size3 >= 0; size3--) {
            ArrayList<C2324> arrayList2 = this.f8015.get(size3);
            int size4 = arrayList2.size() - 1;
            while (true) {
                if (size4 < 0) {
                    break;
                } else if (arrayList2.get(size4).f8039 == r8) {
                    view.setTranslationY(0.0f);
                    view.setTranslationX(0.0f);
                    m833(r8);
                    arrayList2.remove(size4);
                    if (arrayList2.isEmpty()) {
                        this.f8015.remove(size3);
                    }
                } else {
                    size4--;
                }
            }
        }
        for (int size5 = this.f8010.size() - 1; size5 >= 0; size5--) {
            ArrayList<RecyclerView.AbstractC0269> arrayList3 = this.f8010.get(size5);
            if (arrayList3.remove(r8)) {
                view.setAlpha(1.0f);
                m833(r8);
                if (arrayList3.isEmpty()) {
                    this.f8010.remove(size5);
                }
            }
        }
        this.f8007.remove(r8);
        this.f8011.remove(r8);
        this.f8012.remove(r8);
        this.f8006.remove(r8);
        m6076();
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m6072(C2321 r7) {
        View view;
        RecyclerView.AbstractC0269 r0 = r7.f8023;
        View view2 = null;
        if (r0 == null) {
            view = null;
        } else {
            view = r0.itemView;
        }
        RecyclerView.AbstractC0269 r2 = r7.f8022;
        if (r2 != null) {
            view2 = r2.itemView;
        }
        if (view != null) {
            ViewPropertyAnimator duration = view.animate().setDuration(this.f1516);
            this.f8012.add(r7.f8023);
            duration.translationX((float) (r7.f8021 - r7.f8020));
            duration.translationY((float) (r7.f8024 - r7.f8025));
            duration.alpha(0.0f).setListener(new C2320(r7, duration, view)).start();
        }
        if (view2 != null) {
            ViewPropertyAnimator animate = view2.animate();
            this.f8012.add(r7.f8022);
            animate.translationX(0.0f).translationY(0.0f).setDuration(this.f1516).alpha(1.0f).setListener(new C2325(r7, animate, view2)).start();
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m6071(List<C2321> list, RecyclerView.AbstractC0269 r5) {
        for (int size = list.size() - 1; size >= 0; size--) {
            C2321 r1 = list.get(size);
            if (m6075(r1, r5) && r1.f8023 == null && r1.f8022 == null) {
                list.remove(r1);
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public final boolean m6075(C2321 r3, RecyclerView.AbstractC0269 r4) {
        if (r3.f8022 == r4) {
            r3.f8022 = null;
        } else if (r3.f8023 != r4) {
            return false;
        } else {
            r3.f8023 = null;
        }
        r4.itemView.setAlpha(1.0f);
        r4.itemView.setTranslationX(0.0f);
        r4.itemView.setTranslationY(0.0f);
        RecyclerView.AbstractC0250.AbstractC0252 r32 = this.f1515;
        if (r32 == null) {
            return true;
        }
        ((RecyclerView.C0268) r32).m879(r4);
        return true;
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m6070(List<RecyclerView.AbstractC0269> list) {
        for (int size = list.size() - 1; size >= 0; size--) {
            list.get(size).itemView.animate().cancel();
        }
    }

    @Override // androidx.recyclerview.widget.RecyclerView.AbstractC0250
    /* renamed from: K  reason: contains not printable characters */
    public boolean m6074(RecyclerView.AbstractC0269 r2, List<Object> list) {
        return !list.isEmpty() || super.m836(r2, list);
    }

    @Override // androidx.recyclerview.widget.RecyclerView.AbstractC0250
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m6066() {
        int size = this.f8013.size();
        while (true) {
            size--;
            if (size < 0) {
                break;
            }
            C2324 r2 = this.f8013.get(size);
            View view = r2.f8039.itemView;
            view.setTranslationY(0.0f);
            view.setTranslationX(0.0f);
            m833(r2.f8039);
            this.f8013.remove(size);
        }
        int size2 = this.f8014.size();
        while (true) {
            size2--;
            if (size2 < 0) {
                break;
            }
            m833(this.f8014.get(size2));
            this.f8014.remove(size2);
        }
        int size3 = this.f8009.size();
        while (true) {
            size3--;
            if (size3 < 0) {
                break;
            }
            RecyclerView.AbstractC0269 r3 = this.f8009.get(size3);
            r3.itemView.setAlpha(1.0f);
            RecyclerView.AbstractC0250.AbstractC0252 r22 = this.f1515;
            if (r22 != null) {
                ((RecyclerView.C0268) r22).m879(r3);
            }
            this.f8009.remove(size3);
        }
        int size4 = this.f8008.size();
        while (true) {
            size4--;
            if (size4 < 0) {
                break;
            }
            C2321 r32 = this.f8008.get(size4);
            RecyclerView.AbstractC0269 r4 = r32.f8023;
            if (r4 != null) {
                m6075(r32, r4);
            }
            RecyclerView.AbstractC0269 r42 = r32.f8022;
            if (r42 != null) {
                m6075(r32, r42);
            }
        }
        this.f8008.clear();
        if (m6077()) {
            int size5 = this.f8015.size();
            while (true) {
                size5--;
                if (size5 < 0) {
                    break;
                }
                ArrayList<C2324> arrayList = this.f8015.get(size5);
                int size6 = arrayList.size();
                while (true) {
                    size6--;
                    if (size6 >= 0) {
                        C2324 r5 = arrayList.get(size6);
                        View view2 = r5.f8039.itemView;
                        view2.setTranslationY(0.0f);
                        view2.setTranslationX(0.0f);
                        m833(r5.f8039);
                        arrayList.remove(size6);
                        if (arrayList.isEmpty()) {
                            this.f8015.remove(arrayList);
                        }
                    }
                }
            }
            int size7 = this.f8010.size();
            while (true) {
                size7--;
                if (size7 < 0) {
                    break;
                }
                ArrayList<RecyclerView.AbstractC0269> arrayList2 = this.f8010.get(size7);
                int size8 = arrayList2.size();
                while (true) {
                    size8--;
                    if (size8 >= 0) {
                        RecyclerView.AbstractC0269 r43 = arrayList2.get(size8);
                        r43.itemView.setAlpha(1.0f);
                        RecyclerView.AbstractC0250.AbstractC0252 r52 = this.f1515;
                        if (r52 != null) {
                            ((RecyclerView.C0268) r52).m879(r43);
                        }
                        arrayList2.remove(size8);
                        if (arrayList2.isEmpty()) {
                            this.f8010.remove(arrayList2);
                        }
                    }
                }
            }
            int size9 = this.f8005.size();
            while (true) {
                size9--;
                if (size9 >= 0) {
                    ArrayList<C2321> arrayList3 = this.f8005.get(size9);
                    int size10 = arrayList3.size();
                    while (true) {
                        size10--;
                        if (size10 >= 0) {
                            C2321 r33 = arrayList3.get(size10);
                            RecyclerView.AbstractC0269 r44 = r33.f8023;
                            if (r44 != null) {
                                m6075(r33, r44);
                            }
                            RecyclerView.AbstractC0269 r45 = r33.f8022;
                            if (r45 != null) {
                                m6075(r33, r45);
                            }
                            if (arrayList3.isEmpty()) {
                                this.f8005.remove(arrayList3);
                            }
                        }
                    }
                } else {
                    m6070(this.f8007);
                    m6070(this.f8006);
                    m6070(this.f8011);
                    m6070(this.f8012);
                    m832();
                    return;
                }
            }
        }
    }
}
