package androidx.fragment.app;

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

/* JADX INFO: loaded from: classes.dex */
public final class f extends d2 {

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

    public f(g gVar) {
        this.f2437c = gVar;
    }

    @Override // androidx.fragment.app.d2
    public final void b(ViewGroup viewGroup) {
        nb.g.i(viewGroup, "container");
        g gVar = this.f2437c;
        f2 f2Var = (f2) gVar.f31277a;
        View view = f2Var.f2442c.f2419k0;
        view.clearAnimation();
        viewGroup.endViewTransition(view);
        ((f2) gVar.f31277a).c(this);
        if (Log.isLoggable("FragmentManager", 2)) {
            f2Var.toString();
        }
    }

    @Override // androidx.fragment.app.d2
    public final void c(ViewGroup viewGroup) {
        nb.g.i(viewGroup, "container");
        g gVar = this.f2437c;
        if (gVar.m()) {
            ((f2) gVar.f31277a).c(this);
            return;
        }
        Context context = viewGroup.getContext();
        f2 f2Var = (f2) gVar.f31277a;
        View view = f2Var.f2442c.f2419k0;
        nb.g.h(context, "context");
        com.google.android.gms.internal.atv_ads_framework.d1 d1VarX = gVar.x(context);
        if (d1VarX == null) {
            throw new IllegalStateException("Required value was null.".toString());
        }
        Animation animation = (Animation) d1VarX.f19914b;
        if (animation == null) {
            throw new IllegalStateException("Required value was null.".toString());
        }
        if (f2Var.f2440a != SpecialEffectsController$Operation$State.f2305a) {
            view.startAnimation(animation);
            ((f2) gVar.f31277a).c(this);
            return;
        }
        viewGroup.startViewTransition(view);
        j0 j0Var = new j0(animation, viewGroup, view);
        j0Var.setAnimationListener(new e(f2Var, viewGroup, view, this));
        view.startAnimation(j0Var);
        if (Log.isLoggable("FragmentManager", 2)) {
            f2Var.toString();
        }
    }
}
