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;
import r4.AbstractC0983h;

/* JADX INFO: renamed from: androidx.fragment.app.f, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0272f extends D0 {

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

    public C0272f(C0274g c0274g) {
        this.f4251c = c0274g;
    }

    @Override // androidx.fragment.app.D0
    public final void b(ViewGroup viewGroup) {
        AbstractC0983h.e("container", viewGroup);
        C0274g c0274g = this.f4251c;
        E0 e02 = c0274g.f4309a;
        View view = e02.f4150c.mView;
        view.clearAnimation();
        viewGroup.endViewTransition(view);
        c0274g.f4309a.c(this);
        if (h0.J(2)) {
            Log.v("FragmentManager", "Animation from operation " + e02 + " has been cancelled.");
        }
    }

    @Override // androidx.fragment.app.D0
    public final void c(ViewGroup viewGroup) {
        AbstractC0983h.e("container", viewGroup);
        C0274g c0274g = this.f4251c;
        boolean zA = c0274g.a();
        E0 e02 = c0274g.f4309a;
        if (zA) {
            e02.c(this);
            return;
        }
        Context context = viewGroup.getContext();
        View view = e02.f4150c.mView;
        AbstractC0983h.d("context", context);
        O oB = c0274g.b(context);
        if (oB == null) {
            throw new IllegalStateException("Required value was null.");
        }
        Animation animation = (Animation) oB.f4187a;
        if (animation == null) {
            throw new IllegalStateException("Required value was null.");
        }
        if (e02.f4148a != 1) {
            view.startAnimation(animation);
            e02.c(this);
            return;
        }
        viewGroup.startViewTransition(view);
        P p = new P(animation, viewGroup, view);
        p.setAnimationListener(new AnimationAnimationListenerC0270e(e02, viewGroup, view, this));
        view.startAnimation(p);
        if (h0.J(2)) {
            Log.v("FragmentManager", "Animation from operation " + e02 + " has started.");
        }
    }
}
