package p037.p107.p108;

import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
import p138.p139.p143.p144.C2803;

/* JADX INFO: renamed from: މ.ޏ.ށ.ސ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C2336 extends AbstractC2370 {

    /* JADX INFO: renamed from: ސ, reason: contains not printable characters */
    public static TimeInterpolator f7394;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public ArrayList<RecyclerView.AbstractC0224> f7395 = new ArrayList<>();

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public ArrayList<RecyclerView.AbstractC0224> f7396 = new ArrayList<>();

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public ArrayList<C2338> f7397 = new ArrayList<>();

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public ArrayList<C2337> f7398 = new ArrayList<>();

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public ArrayList<ArrayList<RecyclerView.AbstractC0224>> f7399 = new ArrayList<>();

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public ArrayList<ArrayList<C2338>> f7400 = new ArrayList<>();

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public ArrayList<ArrayList<C2337>> f7401 = new ArrayList<>();

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public ArrayList<RecyclerView.AbstractC0224> f7402 = new ArrayList<>();

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public ArrayList<RecyclerView.AbstractC0224> f7403 = new ArrayList<>();

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public ArrayList<RecyclerView.AbstractC0224> f7404 = new ArrayList<>();

    /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
    public ArrayList<RecyclerView.AbstractC0224> f7405 = new ArrayList<>();

    /* JADX INFO: renamed from: މ.ޏ.ށ.ސ$֏, reason: contains not printable characters */
    public static class C2337 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public RecyclerView.AbstractC0224 f7406;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public RecyclerView.AbstractC0224 f7407;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public int f7408;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public int f7409;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public int f7410;

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public int f7411;

        public C2337(RecyclerView.AbstractC0224 abstractC0224, RecyclerView.AbstractC0224 abstractC02242, int i, int i2, int i3, int i4) {
            this.f7406 = abstractC0224;
            this.f7407 = abstractC02242;
            this.f7408 = i;
            this.f7409 = i2;
            this.f7410 = i3;
            this.f7411 = i4;
        }

        public String toString() {
            StringBuilder sbM4889 = C2803.m4889("ChangeInfo{oldHolder=");
            sbM4889.append(this.f7406);
            sbM4889.append(", newHolder=");
            sbM4889.append(this.f7407);
            sbM4889.append(", fromX=");
            sbM4889.append(this.f7408);
            sbM4889.append(", fromY=");
            sbM4889.append(this.f7409);
            sbM4889.append(", toX=");
            sbM4889.append(this.f7410);
            sbM4889.append(", toY=");
            sbM4889.append(this.f7411);
            sbM4889.append('}');
            return sbM4889.toString();
        }
    }

    /* JADX INFO: renamed from: މ.ޏ.ށ.ސ$ؠ, reason: contains not printable characters */
    public static class C2338 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public RecyclerView.AbstractC0224 f7412;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public int f7413;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public int f7414;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public int f7415;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public int f7416;

        public C2338(RecyclerView.AbstractC0224 abstractC0224, int i, int i2, int i3, int i4) {
            this.f7412 = abstractC0224;
            this.f7413 = i;
            this.f7414 = i2;
            this.f7415 = i3;
            this.f7416 = i4;
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m4383(List<RecyclerView.AbstractC0224> list) {
        for (int size = list.size() - 1; size >= 0; size--) {
            list.get(size).f1326.animate().cancel();
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m4384(List<C2337> list, RecyclerView.AbstractC0224 abstractC0224) {
        for (int size = list.size() - 1; size >= 0; size--) {
            C2337 c2337 = list.get(size);
            if (m4386(c2337, abstractC0224) && c2337.f7406 == null && c2337.f7407 == null) {
                list.remove(c2337);
            }
        }
    }

    @Override // p037.p107.p108.AbstractC2370
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public boolean mo4385(RecyclerView.AbstractC0224 abstractC0224, int i, int i2, int i3, int i4) {
        View view = abstractC0224.f1326;
        int translationX = i + ((int) view.getTranslationX());
        int translationY = i2 + ((int) abstractC0224.f1326.getTranslationY());
        m4388(abstractC0224);
        int i5 = i3 - translationX;
        int i6 = i4 - translationY;
        if (i5 == 0 && i6 == 0) {
            m616(abstractC0224);
            return false;
        }
        if (i5 != 0) {
            view.setTranslationX(-i5);
        }
        if (i6 != 0) {
            view.setTranslationY(-i6);
        }
        this.f7397.add(new C2338(abstractC0224, translationX, translationY, i3, i4));
        return true;
    }

    @Override // androidx.recyclerview.widget.RecyclerView.AbstractC0196
    /* JADX INFO: renamed from: ֏ */
    public boolean mo618(RecyclerView.AbstractC0224 abstractC0224, List<Object> list) {
        return !list.isEmpty() || super.mo618(abstractC0224, list);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final boolean m4386(C2337 c2337, RecyclerView.AbstractC0224 abstractC0224) {
        if (c2337.f7407 == abstractC0224) {
            c2337.f7407 = null;
        } else {
            if (c2337.f7406 != abstractC0224) {
                return false;
            }
            c2337.f7406 = null;
        }
        abstractC0224.f1326.setAlpha(1.0f);
        abstractC0224.f1326.setTranslationX(0.0f);
        abstractC0224.f1326.setTranslationY(0.0f);
        m616(abstractC0224);
        return true;
    }

    @Override // androidx.recyclerview.widget.RecyclerView.AbstractC0196
    /* JADX INFO: renamed from: ؠ */
    public void mo619() {
        int size = this.f7397.size();
        while (true) {
            size--;
            if (size < 0) {
                break;
            }
            C2338 c2338 = this.f7397.get(size);
            View view = c2338.f7412.f1326;
            view.setTranslationY(0.0f);
            view.setTranslationX(0.0f);
            m616(c2338.f7412);
            this.f7397.remove(size);
        }
        int size2 = this.f7395.size();
        while (true) {
            size2--;
            if (size2 < 0) {
                break;
            }
            m616(this.f7395.get(size2));
            this.f7395.remove(size2);
        }
        int size3 = this.f7396.size();
        while (true) {
            size3--;
            if (size3 < 0) {
                break;
            }
            RecyclerView.AbstractC0224 abstractC0224 = this.f7396.get(size3);
            abstractC0224.f1326.setAlpha(1.0f);
            m616(abstractC0224);
            this.f7396.remove(size3);
        }
        int size4 = this.f7398.size();
        while (true) {
            size4--;
            if (size4 < 0) {
                break;
            }
            C2337 c2337 = this.f7398.get(size4);
            RecyclerView.AbstractC0224 abstractC02242 = c2337.f7406;
            if (abstractC02242 != null) {
                m4386(c2337, abstractC02242);
            }
            RecyclerView.AbstractC0224 abstractC02243 = c2337.f7407;
            if (abstractC02243 != null) {
                m4386(c2337, abstractC02243);
            }
        }
        this.f7398.clear();
        if (!mo622()) {
            return;
        }
        int size5 = this.f7400.size();
        while (true) {
            size5--;
            if (size5 < 0) {
                break;
            }
            ArrayList<C2338> arrayList = this.f7400.get(size5);
            int size6 = arrayList.size();
            while (true) {
                size6--;
                if (size6 >= 0) {
                    C2338 c23382 = arrayList.get(size6);
                    View view2 = c23382.f7412.f1326;
                    view2.setTranslationY(0.0f);
                    view2.setTranslationX(0.0f);
                    m616(c23382.f7412);
                    arrayList.remove(size6);
                    if (arrayList.isEmpty()) {
                        this.f7400.remove(arrayList);
                    }
                }
            }
        }
        int size7 = this.f7399.size();
        while (true) {
            size7--;
            if (size7 < 0) {
                break;
            }
            ArrayList<RecyclerView.AbstractC0224> arrayList2 = this.f7399.get(size7);
            int size8 = arrayList2.size();
            while (true) {
                size8--;
                if (size8 >= 0) {
                    RecyclerView.AbstractC0224 abstractC02244 = arrayList2.get(size8);
                    abstractC02244.f1326.setAlpha(1.0f);
                    m616(abstractC02244);
                    arrayList2.remove(size8);
                    if (arrayList2.isEmpty()) {
                        this.f7399.remove(arrayList2);
                    }
                }
            }
        }
        int size9 = this.f7401.size();
        while (true) {
            size9--;
            if (size9 < 0) {
                m4383(this.f7404);
                m4383(this.f7403);
                m4383(this.f7402);
                m4383(this.f7405);
                m615();
                return;
            }
            ArrayList<C2337> arrayList3 = this.f7401.get(size9);
            int size10 = arrayList3.size();
            while (true) {
                size10--;
                if (size10 >= 0) {
                    C2337 c23372 = arrayList3.get(size10);
                    RecyclerView.AbstractC0224 abstractC02245 = c23372.f7406;
                    if (abstractC02245 != null) {
                        m4386(c23372, abstractC02245);
                    }
                    RecyclerView.AbstractC0224 abstractC02246 = c23372.f7407;
                    if (abstractC02246 != null) {
                        m4386(c23372, abstractC02246);
                    }
                    if (arrayList3.isEmpty()) {
                        this.f7401.remove(arrayList3);
                    }
                }
            }
        }
    }

    @Override // androidx.recyclerview.widget.RecyclerView.AbstractC0196
    /* JADX INFO: renamed from: ؠ */
    public void mo620(RecyclerView.AbstractC0224 abstractC0224) {
        View view = abstractC0224.f1326;
        view.animate().cancel();
        int size = this.f7397.size();
        while (true) {
            size--;
            if (size < 0) {
                break;
            }
            if (this.f7397.get(size).f7412 == abstractC0224) {
                view.setTranslationY(0.0f);
                view.setTranslationX(0.0f);
                m616(abstractC0224);
                this.f7397.remove(size);
            }
        }
        m4384(this.f7398, abstractC0224);
        if (this.f7395.remove(abstractC0224)) {
            view.setAlpha(1.0f);
            m616(abstractC0224);
        }
        if (this.f7396.remove(abstractC0224)) {
            view.setAlpha(1.0f);
            m616(abstractC0224);
        }
        for (int size2 = this.f7401.size() - 1; size2 >= 0; size2--) {
            ArrayList<C2337> arrayList = this.f7401.get(size2);
            m4384(arrayList, abstractC0224);
            if (arrayList.isEmpty()) {
                this.f7401.remove(size2);
            }
        }
        for (int size3 = this.f7400.size() - 1; size3 >= 0; size3--) {
            ArrayList<C2338> arrayList2 = this.f7400.get(size3);
            int size4 = arrayList2.size() - 1;
            while (true) {
                if (size4 < 0) {
                    break;
                }
                if (arrayList2.get(size4).f7412 == abstractC0224) {
                    view.setTranslationY(0.0f);
                    view.setTranslationX(0.0f);
                    m616(abstractC0224);
                    arrayList2.remove(size4);
                    if (arrayList2.isEmpty()) {
                        this.f7400.remove(size3);
                    }
                } else {
                    size4--;
                }
            }
        }
        for (int size5 = this.f7399.size() - 1; size5 >= 0; size5--) {
            ArrayList<RecyclerView.AbstractC0224> arrayList3 = this.f7399.get(size5);
            if (arrayList3.remove(abstractC0224)) {
                view.setAlpha(1.0f);
                m616(abstractC0224);
                if (arrayList3.isEmpty()) {
                    this.f7399.remove(size5);
                }
            }
        }
        this.f7404.remove(abstractC0224);
        this.f7402.remove(abstractC0224);
        this.f7405.remove(abstractC0224);
        this.f7403.remove(abstractC0224);
        m4387();
    }

    @Override // androidx.recyclerview.widget.RecyclerView.AbstractC0196
    /* JADX INFO: renamed from: ހ */
    public boolean mo622() {
        return (this.f7396.isEmpty() && this.f7398.isEmpty() && this.f7397.isEmpty() && this.f7395.isEmpty() && this.f7403.isEmpty() && this.f7404.isEmpty() && this.f7402.isEmpty() && this.f7405.isEmpty() && this.f7400.isEmpty() && this.f7399.isEmpty() && this.f7401.isEmpty()) ? false : true;
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public void m4387() {
        if (mo622()) {
            return;
        }
        m615();
    }

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public final void m4388(RecyclerView.AbstractC0224 abstractC0224) {
        if (f7394 == null) {
            f7394 = new ValueAnimator().getInterpolator();
        }
        abstractC0224.f1326.animate().setInterpolator(f7394);
        mo620(abstractC0224);
    }
}
