package ῲ.Ԕ.K;

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;

/* renamed from: ῲ.Ԕ.K.ݜ  reason: contains not printable characters */
/* compiled from: FragmentTransitionCompat21 */
public class C1517 extends AbstractC1523 {

    /* renamed from: ῲ.Ԕ.K.ݜ$ʬ  reason: contains not printable characters */
    /* compiled from: FragmentTransitionCompat21 */
    public class C1518 implements Transition.TransitionListener {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final /* synthetic */ Object f5571;

        /* renamed from: ඓ  reason: contains not printable characters */
        public final /* synthetic */ Object f5572;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final /* synthetic */ ArrayList f5573;

        /* renamed from: K  reason: contains not printable characters */
        public final /* synthetic */ Object f5575;

        /* renamed from: 㴹  reason: contains not printable characters */
        public final /* synthetic */ ArrayList f5576;

        /* renamed from: 㸾  reason: contains not printable characters */
        public final /* synthetic */ ArrayList f5577;

        public C1518(Object obj, ArrayList arrayList, Object obj2, ArrayList arrayList2, Object obj3, ArrayList arrayList3) {
            this.f5575 = obj;
            this.f5573 = arrayList;
            this.f5571 = obj2;
            this.f5577 = arrayList2;
            this.f5572 = obj3;
            this.f5576 = arrayList3;
        }

        public void onTransitionCancel(Transition transition) {
        }

        public void onTransitionEnd(Transition transition) {
            transition.removeListener(this);
        }

        public void onTransitionPause(Transition transition) {
        }

        public void onTransitionResume(Transition transition) {
        }

        public void onTransitionStart(Transition transition) {
            Object obj = this.f5575;
            if (obj != null) {
                C1517.this.m3873(obj, this.f5573, (ArrayList<View>) null);
            }
            Object obj2 = this.f5571;
            if (obj2 != null) {
                C1517.this.m3873(obj2, this.f5577, (ArrayList<View>) null);
            }
            Object obj3 = this.f5572;
            if (obj3 != null) {
                C1517.this.m3873(obj3, this.f5576, (ArrayList<View>) null);
            }
        }
    }

    /* renamed from: ῲ.Ԕ.K.ݜ$ῲ  reason: contains not printable characters */
    /* compiled from: FragmentTransitionCompat21 */
    public class C1519 implements Transition.TransitionListener {

        /* renamed from: ῲ  reason: contains not printable characters */
        public final /* synthetic */ ArrayList f5578;

        /* renamed from: K  reason: contains not printable characters */
        public final /* synthetic */ View f5579;

        public C1519(C1517 r1, View view, ArrayList arrayList) {
            this.f5579 = view;
            this.f5578 = arrayList;
        }

        public void onTransitionCancel(Transition transition) {
        }

        public void onTransitionEnd(Transition transition) {
            transition.removeListener(this);
            this.f5579.setVisibility(8);
            int size = this.f5578.size();
            for (int i = 0; i < size; i++) {
                ((View) this.f5578.get(i)).setVisibility(0);
            }
        }

        public void onTransitionPause(Transition transition) {
        }

        public void onTransitionResume(Transition transition) {
        }

        public void onTransitionStart(Transition transition) {
        }
    }

    /* renamed from: ῲ.Ԕ.K.ݜ$K  reason: contains not printable characters */
    /* compiled from: FragmentTransitionCompat21 */
    public class C1520 extends Transition.EpicenterCallback {

        /* renamed from: K  reason: contains not printable characters */
        public final /* synthetic */ Rect f5580;

        public C1520(C1517 r1, Rect rect) {
            this.f5580 = rect;
        }

        public Rect onGetEpicenter(Transition transition) {
            return this.f5580;
        }
    }

    /* renamed from: ῲ.Ԕ.K.ݜ$㸾  reason: contains not printable characters */
    /* compiled from: FragmentTransitionCompat21 */
    public class C1521 extends Transition.EpicenterCallback {

        /* renamed from: K  reason: contains not printable characters */
        public final /* synthetic */ Rect f5581;

        public C1521(C1517 r1, Rect rect) {
            this.f5581 = rect;
        }

        public Rect onGetEpicenter(Transition transition) {
            Rect rect = this.f5581;
            if (rect == null || rect.isEmpty()) {
                return null;
            }
            return this.f5581;
        }
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: ʬ  reason: contains not printable characters */
    public Object m3859(Object obj) {
        if (obj == null) {
            return null;
        }
        TransitionSet transitionSet = new TransitionSet();
        transitionSet.addTransition((Transition) obj);
        return transitionSet;
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: ῲ  reason: contains not printable characters */
    public Object m3861(Object obj) {
        if (obj != null) {
            return ((Transition) obj).clone();
        }
        return null;
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: K  reason: contains not printable characters */
    public boolean m3874(Object obj) {
        return obj instanceof Transition;
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m3864(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++) {
            AbstractC1523.m3879(targets, arrayList.get(i));
        }
        targets.add(view);
        arrayList.add(view);
        m3872(transitionSet, arrayList);
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: K  reason: contains not printable characters */
    public void m3872(Object obj, ArrayList<View> arrayList) {
        Transition transition = (Transition) obj;
        if (transition != null) {
            int i = 0;
            if (transition instanceof TransitionSet) {
                TransitionSet transitionSet = (TransitionSet) transition;
                int transitionCount = transitionSet.getTransitionCount();
                while (i < transitionCount) {
                    m3872(transitionSet.getTransitionAt(i), arrayList);
                    i++;
                }
            } else if (!m3858(transition) && AbstractC1523.m3880((List) transition.getTargets())) {
                int size = arrayList.size();
                while (i < size) {
                    transition.addTarget(arrayList.get(i));
                    i++;
                }
            }
        }
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: ʬ  reason: contains not printable characters */
    public void m3860(Object obj, View view) {
        if (view != null) {
            Rect rect = new Rect();
            m3890(view, rect);
            ((Transition) obj).setEpicenterCallback(new C1520(this, rect));
        }
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: ῲ  reason: contains not printable characters */
    public Object m3862(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;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static boolean m3858(Transition transition) {
        return !AbstractC1523.m3880(transition.getTargetIds()) || !AbstractC1523.m3880(transition.getTargetNames()) || !AbstractC1523.m3880(transition.getTargetTypes());
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m3865(Object obj, ArrayList<View> arrayList, ArrayList<View> arrayList2) {
        TransitionSet transitionSet = (TransitionSet) obj;
        if (transitionSet != null) {
            transitionSet.getTargets().clear();
            transitionSet.getTargets().addAll(arrayList2);
            m3873((Object) transitionSet, arrayList, arrayList2);
        }
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: K  reason: contains not printable characters */
    public void m3870(Object obj, View view, ArrayList<View> arrayList) {
        ((Transition) obj).addListener(new C1519(this, view, arrayList));
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: K  reason: contains not printable characters */
    public Object m3866(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) {
            return transition;
        }
        TransitionSet transitionSet = new TransitionSet();
        if (transition != null) {
            transitionSet.addTransition(transition);
        }
        transitionSet.addTransition(transition3);
        return transitionSet;
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m3863(Object obj, View view) {
        if (obj != null) {
            ((Transition) obj).removeTarget(view);
        }
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: K  reason: contains not printable characters */
    public void m3867(ViewGroup viewGroup, Object obj) {
        TransitionManager.beginDelayedTransition(viewGroup, (Transition) obj);
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: K  reason: contains not printable characters */
    public void m3871(Object obj, Object obj2, ArrayList<View> arrayList, Object obj3, ArrayList<View> arrayList2, Object obj4, ArrayList<View> arrayList3) {
        ((Transition) obj).addListener(new C1518(obj2, arrayList, obj3, arrayList2, obj4, arrayList3));
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: K  reason: contains not printable characters */
    public void m3873(Object obj, ArrayList<View> arrayList, ArrayList<View> arrayList2) {
        List<View> targets;
        int i;
        Transition transition = (Transition) obj;
        int i2 = 0;
        if (transition instanceof TransitionSet) {
            TransitionSet transitionSet = (TransitionSet) transition;
            int transitionCount = transitionSet.getTransitionCount();
            while (i2 < transitionCount) {
                m3873((Object) transitionSet.getTransitionAt(i2), arrayList, arrayList2);
                i2++;
            }
        } else if (!m3858(transition) && (targets = transition.getTargets()) != null && targets.size() == arrayList.size() && targets.containsAll(arrayList)) {
            if (arrayList2 == null) {
                i = 0;
            } else {
                i = arrayList2.size();
            }
            while (i2 < i) {
                transition.addTarget(arrayList2.get(i2));
                i2++;
            }
            for (int size = arrayList.size() - 1; size >= 0; size--) {
                transition.removeTarget(arrayList.get(size));
            }
        }
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: K  reason: contains not printable characters */
    public void m3869(Object obj, View view) {
        if (obj != null) {
            ((Transition) obj).addTarget(view);
        }
    }

    @Override // ῲ.Ԕ.K.AbstractC1523
    /* renamed from: K  reason: contains not printable characters */
    public void m3868(Object obj, Rect rect) {
        if (obj != null) {
            ((Transition) obj).setEpicenterCallback(new C1521(this, rect));
        }
    }
}
