package u0;

import android.content.res.ColorStateList;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.RippleDrawable;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import s1.g0;
import s1.i0;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public final class v extends RippleDrawable {

    /* renamed from: t, reason: collision with root package name */
    public static final a f36746t = new a(null);

    /* renamed from: p, reason: collision with root package name */
    private final boolean f36747p;

    /* renamed from: q, reason: collision with root package name */
    private g0 f36748q;

    /* renamed from: r, reason: collision with root package name */
    private Integer f36749r;

    /* renamed from: s, reason: collision with root package name */
    private boolean f36750s;

    /* loaded from: classes.dex */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(kotlin.jvm.internal.k kVar) {
            this();
        }
    }

    /* loaded from: classes.dex */
    private static final class b {

        /* renamed from: a, reason: collision with root package name */
        public static final b f36751a = new b();

        private b() {
        }

        public final void a(RippleDrawable rippleDrawable, int i10) {
            rippleDrawable.setRadius(i10);
        }
    }

    public v(boolean z10) {
        super(ColorStateList.valueOf(-16777216), null, z10 ? new ColorDrawable(-1) : null);
        this.f36747p = z10;
    }

    private final long a(long j10, float f10) {
        float f11;
        f11 = jn.o.f(f10, 1.0f);
        return g0.l(j10, f11, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, 14, null);
    }

    public final void b(long j10, float f10) {
        long a10 = a(j10, f10);
        g0 g0Var = this.f36748q;
        if (g0Var == null ? false : g0.n(g0Var.v(), a10)) {
            return;
        }
        this.f36748q = g0.h(a10);
        setColor(ColorStateList.valueOf(i0.j(a10)));
    }

    public final void c(int i10) {
        Integer num = this.f36749r;
        if (num != null && num.intValue() == i10) {
            return;
        }
        this.f36749r = Integer.valueOf(i10);
        b.f36751a.a(this, i10);
    }

    @Override // android.graphics.drawable.RippleDrawable, android.graphics.drawable.Drawable
    public Rect getDirtyBounds() {
        if (!this.f36747p) {
            this.f36750s = true;
        }
        Rect dirtyBounds = super.getDirtyBounds();
        this.f36750s = false;
        return dirtyBounds;
    }

    @Override // android.graphics.drawable.RippleDrawable, android.graphics.drawable.LayerDrawable, android.graphics.drawable.Drawable
    public boolean isProjected() {
        return this.f36750s;
    }
}
