package c.e.i;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.view.View;
import c.b.c.f;
import java.lang.ref.WeakReference;

/* JADX INFO: loaded from: classes.dex */
public final class q {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public WeakReference<View> f5289a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f5290b = -1;

    public class a extends AnimatorListenerAdapter {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public final /* synthetic */ r f5291a;

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

        public a(q qVar, r rVar, View view) {
            this.f5291a = rVar;
            this.f5292b = view;
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationCancel(Animator animator) {
            this.f5291a.a(this.f5292b);
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationEnd(Animator animator) {
            this.f5291a.b(this.f5292b);
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationStart(Animator animator) {
            this.f5291a.c(this.f5292b);
        }
    }

    public class b implements ValueAnimator.AnimatorUpdateListener {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public final /* synthetic */ t f5293a;

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

        public b(q qVar, t tVar, View view) {
            this.f5293a = tVar;
            this.f5294b = view;
        }

        @Override // android.animation.ValueAnimator.AnimatorUpdateListener
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            ((View) ((f.a) this.f5293a).f4763a.f4756d.getParent()).invalidate();
        }
    }

    public q(View view) {
        this.f5289a = new WeakReference<>(view);
    }

    public void a() {
        View view = this.f5289a.get();
        if (view != null) {
            view.animate().cancel();
        }
    }

    public q b(long j2) {
        View view = this.f5289a.get();
        if (view != null) {
            view.animate().setDuration(j2);
        }
        return this;
    }

    public q c(r rVar) {
        View view = this.f5289a.get();
        if (view != null) {
            d(view, rVar);
        }
        return this;
    }

    public final void d(View view, r rVar) {
        if (rVar != null) {
            view.animate().setListener(new a(this, rVar, view));
        } else {
            view.animate().setListener(null);
        }
    }

    public q e(t tVar) {
        View view = this.f5289a.get();
        if (view != null) {
            view.animate().setUpdateListener(tVar != null ? new b(this, tVar, view) : null);
        }
        return this;
    }

    public q f(float f2) {
        View view = this.f5289a.get();
        if (view != null) {
            view.animate().translationY(f2);
        }
        return this;
    }
}
