package a3;

import android.graphics.Shader;
import android.text.TextPaint;
import android.text.style.CharacterStyle;
import android.text.style.UpdateAppearance;
import kotlin.jvm.internal.v;
import r1.m;
import s1.n1;
import y0.n3;
import y0.q1;
import y0.s3;
import y0.y3;
import y2.h;

/* loaded from: classes.dex */
public final class b extends CharacterStyle implements UpdateAppearance {

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

    /* renamed from: q, reason: collision with root package name */
    private final float f140q;

    /* renamed from: r, reason: collision with root package name */
    private final q1 f141r;

    /* renamed from: s, reason: collision with root package name */
    private final y3 f142s;

    /* loaded from: classes.dex */
    static final class a extends v implements dn.a {
        a() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final Shader invoke() {
            if ((b.this.b() == 9205357640488583168L) || m.k(b.this.b())) {
                return null;
            }
            return b.this.a().b(b.this.b());
        }
    }

    public b(n1 n1Var, float f10) {
        q1 d10;
        this.f139p = n1Var;
        this.f140q = f10;
        d10 = s3.d(m.c(m.f34339b.a()), null, 2, null);
        this.f141r = d10;
        this.f142s = n3.d(new a());
    }

    public final n1 a() {
        return this.f139p;
    }

    public final long b() {
        return ((m) this.f141r.getValue()).m();
    }

    public final void c(long j10) {
        this.f141r.setValue(m.c(j10));
    }

    @Override // android.text.style.CharacterStyle
    public void updateDrawState(TextPaint textPaint) {
        h.a(textPaint, this.f140q);
        textPaint.setShader((Shader) this.f142s.getValue());
    }
}
