package androidx.fragment.app;

import F1.ViewTreeObserverOnPreDrawListenerC0188q;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.Transformation;

/* JADX INFO: loaded from: classes.dex */
public final class N extends AnimationSet implements Runnable {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final ViewGroup f11529a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final View f11530b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public boolean f11531c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public boolean f11532d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f11533e;

    public N(Animation animation, ViewGroup viewGroup, View view) {
        super(false);
        this.f11533e = true;
        this.f11529a = viewGroup;
        this.f11530b = view;
        addAnimation(animation);
        viewGroup.post(this);
    }

    @Override // android.view.animation.AnimationSet, android.view.animation.Animation
    public final boolean getTransformation(long j4, Transformation transformation) {
        this.f11533e = true;
        if (this.f11531c) {
            return !this.f11532d;
        }
        if (!super.getTransformation(j4, transformation)) {
            this.f11531c = true;
            ViewTreeObserverOnPreDrawListenerC0188q.a(this.f11529a, this);
        }
        return true;
    }

    @Override // java.lang.Runnable
    public final void run() {
        boolean z6 = this.f11531c;
        ViewGroup viewGroup = this.f11529a;
        if (z6 || !this.f11533e) {
            viewGroup.endViewTransition(this.f11530b);
            this.f11532d = true;
        } else {
            this.f11533e = false;
            viewGroup.post(this);
        }
    }

    @Override // android.view.animation.Animation
    public final boolean getTransformation(long j4, Transformation transformation, float f6) {
        this.f11533e = true;
        if (this.f11531c) {
            return !this.f11532d;
        }
        if (!super.getTransformation(j4, transformation, f6)) {
            this.f11531c = true;
            ViewTreeObserverOnPreDrawListenerC0188q.a(this.f11529a, this);
        }
        return true;
    }
}
