package androidx.leanback.app;

import android.animation.TimeAnimator;
import android.view.animation.DecelerateInterpolator;
import androidx.leanback.widget.AbstractC0470i0;
import androidx.leanback.widget.C0468h0;
import androidx.leanback.widget.F;
import androidx.leanback.widget.X;
import com.martsnew.tv.R;

/* JADX INFO: loaded from: classes.dex */
public final class B implements TimeAnimator.TimeListener {

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public static final DecelerateInterpolator f8158h = new DecelerateInterpolator(2.0f);

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

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final int f8162d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final DecelerateInterpolator f8163e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public float f8164f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public float f8165g;

    public B(F f3) {
        TimeAnimator timeAnimator = new TimeAnimator();
        this.f8161c = timeAnimator;
        this.f8159a = (AbstractC0470i0) f3.f8367u;
        this.f8160b = f3.f8368v;
        timeAnimator.setTimeListener(this);
        this.f8162d = f3.f4654a.getResources().getInteger(R.integer.lb_browse_rows_anim_duration);
        this.f8163e = f8158h;
    }

    @Override // android.animation.TimeAnimator.TimeListener
    public final void onTimeUpdate(TimeAnimator timeAnimator, long j8, long j9) {
        float interpolation;
        TimeAnimator timeAnimator2 = this.f8161c;
        if (timeAnimator2.isRunning()) {
            int i = this.f8162d;
            if (j8 >= i) {
                timeAnimator2.end();
                interpolation = 1.0f;
            } else {
                interpolation = (float) (j8 / ((double) i));
            }
            DecelerateInterpolator decelerateInterpolator = this.f8163e;
            if (decelerateInterpolator != null) {
                interpolation = decelerateInterpolator.getInterpolation(interpolation);
            }
            float f3 = (interpolation * this.f8165g) + this.f8164f;
            AbstractC0470i0 abstractC0470i0 = this.f8159a;
            abstractC0470i0.getClass();
            C0468h0 c0468h0K = AbstractC0470i0.k(this.f8160b);
            c0468h0K.f8652j = f3;
            abstractC0470i0.q(c0468h0K);
        }
    }
}
