package o;

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

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class TB extends AnimationSet implements Runnable {
    public final ViewGroup l;
    public final View m;
    public boolean n;

    /* renamed from: o, reason: collision with root package name */
    public boolean f339o;
    public boolean p;

    public TB(Animation animation, ViewGroup viewGroup, View view) {
        super(false);
        this.p = true;
        this.l = viewGroup;
        this.m = view;
        addAnimation(animation);
        viewGroup.post(this);
    }

    @Override // android.view.animation.AnimationSet, android.view.animation.Animation
    public final boolean getTransformation(long j, Transformation transformation) {
        this.p = true;
        if (this.n) {
            return !this.f339o;
        }
        if (!super.getTransformation(j, transformation)) {
            this.n = true;
            UT.a(this.l, this);
        }
        return true;
    }

    @Override // java.lang.Runnable
    public final void run() {
        boolean z = this.n;
        ViewGroup viewGroup = this.l;
        if (z || !this.p) {
            viewGroup.endViewTransition(this.m);
            this.f339o = true;
        } else {
            this.p = false;
            viewGroup.post(this);
        }
    }

    @Override // android.view.animation.Animation
    public final boolean getTransformation(long j, Transformation transformation, float f) {
        this.p = true;
        if (this.n) {
            return !this.f339o;
        }
        if (!super.getTransformation(j, transformation, f)) {
            this.n = true;
            UT.a(this.l, this);
        }
        return true;
    }
}
