package X6FRs_4.XnFJ5_9.KQgRr5e_0;

import android.graphics.Rect;
import android.transition.Transition;
import android.transition.TransitionManager;
import android.transition.TransitionSet;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
/* compiled from: FragmentTransitionCompat21.java */
/* loaded from: classes.dex */
public class Nm6q_10 extends KNBe_11 {

    /* compiled from: FragmentTransitionCompat21.java */
    /* loaded from: classes.dex */
    public class KQgRr5e_0 extends Transition.EpicenterCallback {
        public final /* synthetic */ Rect KQgRr5e_0;

        public KQgRr5e_0(Nm6q_10 nm6q_10, Rect rect) {
            this.KQgRr5e_0 = rect;
        }

        @Override // android.transition.Transition.EpicenterCallback
        public Rect onGetEpicenter(Transition transition) {
            return this.KQgRr5e_0;
        }
    }

    /* compiled from: FragmentTransitionCompat21.java */
    /* loaded from: classes.dex */
    public class Mqv2r_3 extends Transition.EpicenterCallback {
        public final /* synthetic */ Rect KQgRr5e_0;

        public Mqv2r_3(Nm6q_10 nm6q_10, Rect rect) {
            this.KQgRr5e_0 = rect;
        }

        @Override // android.transition.Transition.EpicenterCallback
        public Rect onGetEpicenter(Transition transition) {
            Rect rect = this.KQgRr5e_0;
            if (rect == null || rect.isEmpty()) {
                return null;
            }
            return this.KQgRr5e_0;
        }
    }

    /* compiled from: FragmentTransitionCompat21.java */
    /* loaded from: classes.dex */
    public class PGPF6hQ_2 implements Transition.TransitionListener {

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final /* synthetic */ Object f1312KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final /* synthetic */ ArrayList f1313KQgRr5e_0;
        public final /* synthetic */ Object PGPF6hQ_2;

        /* renamed from: PGPF6hQ_2  reason: collision with other field name */
        public final /* synthetic */ ArrayList f1314PGPF6hQ_2;
        public final /* synthetic */ Object QxJ9d_1;

        /* renamed from: QxJ9d_1  reason: collision with other field name */
        public final /* synthetic */ ArrayList f1315QxJ9d_1;

        public PGPF6hQ_2(Object obj, ArrayList arrayList, Object obj2, ArrayList arrayList2, Object obj3, ArrayList arrayList3) {
            this.f1312KQgRr5e_0 = obj;
            this.f1313KQgRr5e_0 = arrayList;
            this.QxJ9d_1 = obj2;
            this.f1315QxJ9d_1 = arrayList2;
            this.PGPF6hQ_2 = obj3;
            this.f1314PGPF6hQ_2 = arrayList3;
        }

        @Override // android.transition.Transition.TransitionListener
        public void onTransitionCancel(Transition transition) {
        }

        @Override // android.transition.Transition.TransitionListener
        public void onTransitionEnd(Transition transition) {
        }

        @Override // android.transition.Transition.TransitionListener
        public void onTransitionPause(Transition transition) {
        }

        @Override // android.transition.Transition.TransitionListener
        public void onTransitionResume(Transition transition) {
        }

        @Override // android.transition.Transition.TransitionListener
        public void onTransitionStart(Transition transition) {
            Object obj = this.f1312KQgRr5e_0;
            if (obj != null) {
                Nm6q_10.this.KQgRr5e_0(obj, this.f1313KQgRr5e_0, (ArrayList<View>) null);
            }
            Object obj2 = this.QxJ9d_1;
            if (obj2 != null) {
                Nm6q_10.this.KQgRr5e_0(obj2, this.f1315QxJ9d_1, (ArrayList<View>) null);
            }
            Object obj3 = this.PGPF6hQ_2;
            if (obj3 != null) {
                Nm6q_10.this.KQgRr5e_0(obj3, this.f1314PGPF6hQ_2, (ArrayList<View>) null);
            }
        }
    }

    /* compiled from: FragmentTransitionCompat21.java */
    /* loaded from: classes.dex */
    public class QxJ9d_1 implements Transition.TransitionListener {
        public final /* synthetic */ View KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final /* synthetic */ ArrayList f1316KQgRr5e_0;

        public QxJ9d_1(Nm6q_10 nm6q_10, View view, ArrayList arrayList) {
            this.KQgRr5e_0 = view;
            this.f1316KQgRr5e_0 = arrayList;
        }

        @Override // android.transition.Transition.TransitionListener
        public void onTransitionCancel(Transition transition) {
        }

        @Override // android.transition.Transition.TransitionListener
        public void onTransitionEnd(Transition transition) {
            transition.removeListener(this);
            this.KQgRr5e_0.setVisibility(8);
            int size = this.f1316KQgRr5e_0.size();
            for (int i = 0; i < size; i++) {
                ((View) this.f1316KQgRr5e_0.get(i)).setVisibility(0);
            }
        }

        @Override // android.transition.Transition.TransitionListener
        public void onTransitionPause(Transition transition) {
        }

        @Override // android.transition.Transition.TransitionListener
        public void onTransitionResume(Transition transition) {
        }

        @Override // android.transition.Transition.TransitionListener
        public void onTransitionStart(Transition transition) {
        }
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public boolean KQgRr5e_0(Object obj) {
        return obj instanceof Transition;
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public void PGPF6hQ_2(Object obj, View view) {
        if (view != null) {
            Rect rect = new Rect();
            KQgRr5e_0(view, rect);
            ((Transition) obj).setEpicenterCallback(new KQgRr5e_0(this, rect));
        }
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public Object QxJ9d_1(Object obj) {
        if (obj == null) {
            return null;
        }
        TransitionSet transitionSet = new TransitionSet();
        transitionSet.addTransition((Transition) obj);
        return transitionSet;
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public Object KQgRr5e_0(Object obj) {
        if (obj != null) {
            return ((Transition) obj).clone();
        }
        return null;
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public void KQgRr5e_0(Object obj, ArrayList<View> arrayList) {
        Transition transition = (Transition) obj;
        if (transition == null) {
            return;
        }
        int i = 0;
        if (transition instanceof TransitionSet) {
            TransitionSet transitionSet = (TransitionSet) transition;
            int transitionCount = transitionSet.getTransitionCount();
            while (i < transitionCount) {
                KQgRr5e_0(transitionSet.getTransitionAt(i), arrayList);
                i++;
            }
        } else if (KQgRr5e_0(transition) || !KNBe_11.KQgRr5e_0((List) transition.getTargets())) {
        } else {
            int size = arrayList.size();
            while (i < size) {
                transition.addTarget(arrayList.get(i));
                i++;
            }
        }
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public void QxJ9d_1(Object obj, View view, ArrayList<View> arrayList) {
        TransitionSet transitionSet = (TransitionSet) obj;
        List<View> targets = transitionSet.getTargets();
        targets.clear();
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            KNBe_11.KQgRr5e_0(targets, arrayList.get(i));
        }
        targets.add(view);
        arrayList.add(view);
        KQgRr5e_0(transitionSet, arrayList);
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public Object QxJ9d_1(Object obj, Object obj2, Object obj3) {
        TransitionSet transitionSet = new TransitionSet();
        if (obj != null) {
            transitionSet.addTransition((Transition) obj);
        }
        if (obj2 != null) {
            transitionSet.addTransition((Transition) obj2);
        }
        if (obj3 != null) {
            transitionSet.addTransition((Transition) obj3);
        }
        return transitionSet;
    }

    public static boolean KQgRr5e_0(Transition transition) {
        return (KNBe_11.KQgRr5e_0((List) transition.getTargetIds()) && KNBe_11.KQgRr5e_0((List) transition.getTargetNames()) && KNBe_11.KQgRr5e_0((List) transition.getTargetTypes())) ? false : true;
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public void QxJ9d_1(Object obj, ArrayList<View> arrayList, ArrayList<View> arrayList2) {
        TransitionSet transitionSet = (TransitionSet) obj;
        if (transitionSet != null) {
            transitionSet.getTargets().clear();
            transitionSet.getTargets().addAll(arrayList2);
            KQgRr5e_0((Object) transitionSet, arrayList, arrayList2);
        }
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public void KQgRr5e_0(Object obj, View view, ArrayList<View> arrayList) {
        ((Transition) obj).addListener(new QxJ9d_1(this, view, arrayList));
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public Object KQgRr5e_0(Object obj, Object obj2, Object obj3) {
        Transition transition = (Transition) obj;
        Transition transition2 = (Transition) obj2;
        Transition transition3 = (Transition) obj3;
        if (transition != null && transition2 != null) {
            transition = new TransitionSet().addTransition(transition).addTransition(transition2).setOrdering(1);
        } else if (transition == null) {
            transition = transition2 != null ? transition2 : null;
        }
        if (transition3 != null) {
            TransitionSet transitionSet = new TransitionSet();
            if (transition != null) {
                transitionSet.addTransition(transition);
            }
            transitionSet.addTransition(transition3);
            return transitionSet;
        }
        return transition;
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public void QxJ9d_1(Object obj, View view) {
        if (obj != null) {
            ((Transition) obj).removeTarget(view);
        }
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public void KQgRr5e_0(ViewGroup viewGroup, Object obj) {
        TransitionManager.beginDelayedTransition(viewGroup, (Transition) obj);
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public void KQgRr5e_0(Object obj, Object obj2, ArrayList<View> arrayList, Object obj3, ArrayList<View> arrayList2, Object obj4, ArrayList<View> arrayList3) {
        ((Transition) obj).addListener(new PGPF6hQ_2(obj2, arrayList, obj3, arrayList2, obj4, arrayList3));
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public void KQgRr5e_0(Object obj, ArrayList<View> arrayList, ArrayList<View> arrayList2) {
        List<View> targets;
        Transition transition = (Transition) obj;
        int i = 0;
        if (transition instanceof TransitionSet) {
            TransitionSet transitionSet = (TransitionSet) transition;
            int transitionCount = transitionSet.getTransitionCount();
            while (i < transitionCount) {
                KQgRr5e_0((Object) transitionSet.getTransitionAt(i), arrayList, arrayList2);
                i++;
            }
        } else if (!KQgRr5e_0(transition) && (targets = transition.getTargets()) != null && targets.size() == arrayList.size() && targets.containsAll(arrayList)) {
            int size = arrayList2 == null ? 0 : arrayList2.size();
            while (i < size) {
                transition.addTarget(arrayList2.get(i));
                i++;
            }
            for (int size2 = arrayList.size() - 1; size2 >= 0; size2--) {
                transition.removeTarget(arrayList.get(size2));
            }
        }
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public void KQgRr5e_0(Object obj, View view) {
        if (obj != null) {
            ((Transition) obj).addTarget(view);
        }
    }

    @Override // X6FRs_4.XnFJ5_9.KQgRr5e_0.KNBe_11
    public void KQgRr5e_0(Object obj, Rect rect) {
        if (obj != null) {
            ((Transition) obj).setEpicenterCallback(new Mqv2r_3(this, rect));
        }
    }
}
