package h0;

import android.content.Context;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import e0.C0853a;

/* JADX INFO: renamed from: h0.f, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1006f extends a0 {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final C1007g f13200c;

    public C1006f(C1007g c1007g) {
        this.f13200c = c1007g;
    }

    @Override // h0.a0
    public final void a(ViewGroup viewGroup) {
        P6.g.e(viewGroup, "container");
        C1007g c1007g = this.f13200c;
        b0 b0Var = (b0) c1007g.f5146q;
        View view = b0Var.f13181c.X;
        view.clearAnimation();
        viewGroup.endViewTransition(view);
        ((b0) c1007g.f5146q).c(this);
        if (P.L(2)) {
            Log.v("FragmentManager", "Animation from operation " + b0Var + " has been cancelled.");
        }
    }

    @Override // h0.a0
    public final void b(ViewGroup viewGroup) {
        P6.g.e(viewGroup, "container");
        C1007g c1007g = this.f13200c;
        boolean zT = c1007g.t();
        b0 b0Var = (b0) c1007g.f5146q;
        if (zT) {
            b0Var.c(this);
            return;
        }
        Context context = viewGroup.getContext();
        View view = b0Var.f13181c.X;
        P6.g.d(context, "context");
        C0853a c0853aF = c1007g.F(context);
        if (c0853aF == null) {
            throw new IllegalStateException("Required value was null.");
        }
        Animation animation = (Animation) c0853aF.f12397r;
        if (animation == null) {
            throw new IllegalStateException("Required value was null.");
        }
        if (b0Var.f13179a != 1) {
            view.startAnimation(animation);
            b0Var.c(this);
            return;
        }
        viewGroup.startViewTransition(view);
        RunnableC0993A runnableC0993A = new RunnableC0993A(animation, viewGroup, view);
        runnableC0993A.setAnimationListener(new AnimationAnimationListenerC1005e(b0Var, viewGroup, view, this));
        view.startAnimation(runnableC0993A);
        if (P.L(2)) {
            Log.v("FragmentManager", "Animation from operation " + b0Var + " has started.");
        }
    }
}
