package com.google.android.material.internal;

import android.animation.TimeInterpolator;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.os.Build;
import android.text.Layout;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import androidx.core.view.y;
import com.google.android.material.internal.j;
import z0.a;

/* JADX INFO: compiled from: CollapsingTextHelper.java */
/* JADX INFO: loaded from: classes.dex */
public final class b {

    /* JADX INFO: renamed from: s0, reason: collision with root package name */
    private static final boolean f4027s0;

    /* JADX INFO: renamed from: t0, reason: collision with root package name */
    private static final Paint f4028t0;
    private Typeface A;
    private Typeface B;
    private Typeface C;
    private z0.a D;
    private z0.a E;
    private CharSequence F;
    private CharSequence G;
    private boolean H;
    private boolean J;
    private Bitmap K;
    private Paint L;
    private float M;
    private float N;
    private float O;
    private float P;
    private float Q;
    private int R;
    private int[] S;
    private boolean T;
    private final TextPaint U;
    private final TextPaint V;
    private TimeInterpolator W;
    private TimeInterpolator X;
    private float Y;
    private float Z;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final View f4029a;

    /* JADX INFO: renamed from: a0, reason: collision with root package name */
    private float f4030a0;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private boolean f4031b;

    /* JADX INFO: renamed from: b0, reason: collision with root package name */
    private ColorStateList f4032b0;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private float f4033c;

    /* JADX INFO: renamed from: c0, reason: collision with root package name */
    private float f4034c0;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private boolean f4035d;

    /* JADX INFO: renamed from: d0, reason: collision with root package name */
    private float f4036d0;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private float f4037e;

    /* JADX INFO: renamed from: e0, reason: collision with root package name */
    private float f4038e0;

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

    /* JADX INFO: renamed from: f0, reason: collision with root package name */
    private ColorStateList f4040f0;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private int f4041g;

    /* JADX INFO: renamed from: g0, reason: collision with root package name */
    private float f4042g0;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private final Rect f4043h;

    /* JADX INFO: renamed from: h0, reason: collision with root package name */
    private float f4044h0;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private final Rect f4045i;

    /* JADX INFO: renamed from: i0, reason: collision with root package name */
    private float f4046i0;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    private final RectF f4047j;

    /* JADX INFO: renamed from: j0, reason: collision with root package name */
    private StaticLayout f4048j0;

    /* JADX INFO: renamed from: k0, reason: collision with root package name */
    private float f4050k0;

    /* JADX INFO: renamed from: l0, reason: collision with root package name */
    private float f4052l0;

    /* JADX INFO: renamed from: m0, reason: collision with root package name */
    private float f4054m0;

    /* JADX INFO: renamed from: n0, reason: collision with root package name */
    private CharSequence f4056n0;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    private ColorStateList f4057o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    private ColorStateList f4059p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    private float f4061q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    private float f4063r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    private float f4065s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    private float f4066t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    private float f4067u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    private float f4068v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    private Typeface f4069w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    private Typeface f4070x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    private Typeface f4071y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    private Typeface f4072z;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    private int f4049k = 16;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    private int f4051l = 16;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    private float f4053m = 15.0f;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    private float f4055n = 15.0f;
    private boolean I = true;

    /* JADX INFO: renamed from: o0, reason: collision with root package name */
    private int f4058o0 = 1;

    /* JADX INFO: renamed from: p0, reason: collision with root package name */
    private float f4060p0 = 0.0f;

    /* JADX INFO: renamed from: q0, reason: collision with root package name */
    private float f4062q0 = 1.0f;

    /* JADX INFO: renamed from: r0, reason: collision with root package name */
    private int f4064r0 = j.f4093n;

    /* JADX INFO: compiled from: CollapsingTextHelper.java */
    class a implements a.InterfaceC0089a {
        a() {
        }

        @Override // z0.a.InterfaceC0089a
        public void a(Typeface typeface) {
            b.this.T(typeface);
        }
    }

    static {
        f4027s0 = Build.VERSION.SDK_INT < 18;
        f4028t0 = null;
    }

    public b(View view) {
        this.f4029a = view;
        TextPaint textPaint = new TextPaint(129);
        this.U = textPaint;
        this.V = new TextPaint(textPaint);
        this.f4045i = new Rect();
        this.f4043h = new Rect();
        this.f4047j = new RectF();
        this.f4039f = e();
        H(view.getContext().getResources().getConfiguration());
    }

    private void A(TextPaint textPaint) {
        textPaint.setTextSize(this.f4053m);
        textPaint.setTypeface(this.f4072z);
        if (Build.VERSION.SDK_INT >= 21) {
            textPaint.setLetterSpacing(this.f4044h0);
        }
    }

    private void B(float f3) {
        if (this.f4035d) {
            this.f4047j.set(f3 < this.f4039f ? this.f4043h : this.f4045i);
            return;
        }
        this.f4047j.left = G(this.f4043h.left, this.f4045i.left, f3, this.W);
        this.f4047j.top = G(this.f4061q, this.f4063r, f3, this.W);
        this.f4047j.right = G(this.f4043h.right, this.f4045i.right, f3, this.W);
        this.f4047j.bottom = G(this.f4043h.bottom, this.f4045i.bottom, f3, this.W);
    }

    private static boolean C(float f3, float f4) {
        return Math.abs(f3 - f4) < 1.0E-5f;
    }

    private boolean D() {
        return y.E(this.f4029a) == 1;
    }

    private boolean F(CharSequence charSequence, boolean z2) {
        return (z2 ? androidx.core.text.e.f1823d : androidx.core.text.e.f1822c).a(charSequence, 0, charSequence.length());
    }

    private static float G(float f3, float f4, float f5, TimeInterpolator timeInterpolator) {
        if (timeInterpolator != null) {
            f5 = timeInterpolator.getInterpolation(f5);
        }
        return m0.a.a(f3, f4, f5);
    }

    private float I(TextPaint textPaint, CharSequence charSequence) {
        return textPaint.measureText(charSequence, 0, charSequence.length());
    }

    private static boolean M(Rect rect, int i3, int i4, int i5, int i6) {
        return rect.left == i3 && rect.top == i4 && rect.right == i5 && rect.bottom == i6;
    }

    private void Q(float f3) {
        this.f4052l0 = f3;
        y.i0(this.f4029a);
    }

    private boolean U(Typeface typeface) {
        z0.a aVar = this.E;
        if (aVar != null) {
            aVar.c();
        }
        if (this.f4071y == typeface) {
            return false;
        }
        this.f4071y = typeface;
        Typeface typefaceB = z0.g.b(this.f4029a.getContext().getResources().getConfiguration(), typeface);
        this.f4070x = typefaceB;
        if (typefaceB == null) {
            typefaceB = this.f4071y;
        }
        this.f4069w = typefaceB;
        return true;
    }

    private void Y(float f3) {
        this.f4054m0 = f3;
        y.i0(this.f4029a);
    }

    private static int a(int i3, int i4, float f3) {
        float f4 = 1.0f - f3;
        return Color.argb(Math.round((Color.alpha(i3) * f4) + (Color.alpha(i4) * f3)), Math.round((Color.red(i3) * f4) + (Color.red(i4) * f3)), Math.round((Color.green(i3) * f4) + (Color.green(i4) * f3)), Math.round((Color.blue(i3) * f4) + (Color.blue(i4) * f3)));
    }

    private void b(boolean z2) {
        StaticLayout staticLayout;
        i(1.0f, z2);
        CharSequence charSequence = this.G;
        if (charSequence != null && (staticLayout = this.f4048j0) != null) {
            this.f4056n0 = TextUtils.ellipsize(charSequence, this.U, staticLayout.getWidth(), TextUtils.TruncateAt.END);
        }
        CharSequence charSequence2 = this.f4056n0;
        float fI = 0.0f;
        if (charSequence2 != null) {
            this.f4050k0 = I(this.U, charSequence2);
        } else {
            this.f4050k0 = 0.0f;
        }
        int iB = androidx.core.view.e.b(this.f4051l, this.H ? 1 : 0);
        int i3 = iB & 112;
        if (i3 == 48) {
            this.f4063r = this.f4045i.top;
        } else if (i3 != 80) {
            this.f4063r = this.f4045i.centerY() - ((this.U.descent() - this.U.ascent()) / 2.0f);
        } else {
            this.f4063r = this.f4045i.bottom + this.U.ascent();
        }
        int i4 = iB & 8388615;
        if (i4 == 1) {
            this.f4066t = this.f4045i.centerX() - (this.f4050k0 / 2.0f);
        } else if (i4 != 5) {
            this.f4066t = this.f4045i.left;
        } else {
            this.f4066t = this.f4045i.right - this.f4050k0;
        }
        i(0.0f, z2);
        float height = this.f4048j0 != null ? r10.getHeight() : 0.0f;
        StaticLayout staticLayout2 = this.f4048j0;
        if (staticLayout2 == null || this.f4058o0 <= 1) {
            CharSequence charSequence3 = this.G;
            if (charSequence3 != null) {
                fI = I(this.U, charSequence3);
            }
        } else {
            fI = staticLayout2.getWidth();
        }
        StaticLayout staticLayout3 = this.f4048j0;
        if (staticLayout3 != null) {
            staticLayout3.getLineCount();
        }
        int iB2 = androidx.core.view.e.b(this.f4049k, this.H ? 1 : 0);
        int i5 = iB2 & 112;
        if (i5 == 48) {
            this.f4061q = this.f4043h.top;
        } else if (i5 != 80) {
            this.f4061q = this.f4043h.centerY() - (height / 2.0f);
        } else {
            this.f4061q = (this.f4043h.bottom - height) + this.U.descent();
        }
        int i6 = iB2 & 8388615;
        if (i6 == 1) {
            this.f4065s = this.f4043h.centerX() - (fI / 2.0f);
        } else if (i6 != 5) {
            this.f4065s = this.f4043h.left;
        } else {
            this.f4065s = this.f4043h.right - fI;
        }
        j();
        e0(this.f4033c);
    }

    private void c() {
        g(this.f4033c);
    }

    private boolean c0(Typeface typeface) {
        z0.a aVar = this.D;
        if (aVar != null) {
            aVar.c();
        }
        if (this.B == typeface) {
            return false;
        }
        this.B = typeface;
        Typeface typefaceB = z0.g.b(this.f4029a.getContext().getResources().getConfiguration(), typeface);
        this.A = typefaceB;
        if (typefaceB == null) {
            typefaceB = this.B;
        }
        this.f4072z = typefaceB;
        return true;
    }

    private float d(float f3) {
        float f4 = this.f4039f;
        return f3 <= f4 ? m0.a.b(1.0f, 0.0f, this.f4037e, f4, f3) : m0.a.b(0.0f, 1.0f, f4, 1.0f, f3);
    }

    private float e() {
        float f3 = this.f4037e;
        return f3 + ((1.0f - f3) * 0.5f);
    }

    private void e0(float f3) {
        h(f3);
        boolean z2 = f4027s0 && this.M != 1.0f;
        this.J = z2;
        if (z2) {
            n();
        }
        y.i0(this.f4029a);
    }

    private boolean f(CharSequence charSequence) {
        boolean zD = D();
        return this.I ? F(charSequence, zD) : zD;
    }

    private void g(float f3) {
        float f4;
        B(f3);
        if (!this.f4035d) {
            this.f4067u = G(this.f4065s, this.f4066t, f3, this.W);
            this.f4068v = G(this.f4061q, this.f4063r, f3, this.W);
            e0(f3);
            f4 = f3;
        } else if (f3 < this.f4039f) {
            this.f4067u = this.f4065s;
            this.f4068v = this.f4061q;
            e0(0.0f);
            f4 = 0.0f;
        } else {
            this.f4067u = this.f4066t;
            this.f4068v = this.f4063r - Math.max(0, this.f4041g);
            e0(1.0f);
            f4 = 1.0f;
        }
        TimeInterpolator timeInterpolator = m0.a.f5554b;
        Q(1.0f - G(0.0f, 1.0f, 1.0f - f3, timeInterpolator));
        Y(G(1.0f, 0.0f, f3, timeInterpolator));
        if (this.f4059p != this.f4057o) {
            this.U.setColor(a(v(), t(), f4));
        } else {
            this.U.setColor(t());
        }
        if (Build.VERSION.SDK_INT >= 21) {
            float f5 = this.f4042g0;
            float f6 = this.f4044h0;
            if (f5 != f6) {
                this.U.setLetterSpacing(G(f6, f5, f3, timeInterpolator));
            } else {
                this.U.setLetterSpacing(f5);
            }
        }
        this.O = G(this.f4034c0, this.Y, f3, null);
        this.P = G(this.f4036d0, this.Z, f3, null);
        this.Q = G(this.f4038e0, this.f4030a0, f3, null);
        int iA = a(u(this.f4040f0), u(this.f4032b0), f3);
        this.R = iA;
        this.U.setShadowLayer(this.O, this.P, this.Q, iA);
        if (this.f4035d) {
            this.U.setAlpha((int) (d(f3) * this.U.getAlpha()));
        }
        y.i0(this.f4029a);
    }

    private void h(float f3) {
        i(f3, false);
    }

    private void i(float f3, boolean z2) {
        boolean z3;
        float f4;
        float f5;
        boolean z4;
        if (this.F == null) {
            return;
        }
        float fWidth = this.f4045i.width();
        float fWidth2 = this.f4043h.width();
        if (C(f3, 1.0f)) {
            f4 = this.f4055n;
            f5 = this.f4042g0;
            this.M = 1.0f;
            Typeface typeface = this.C;
            Typeface typeface2 = this.f4069w;
            if (typeface != typeface2) {
                this.C = typeface2;
                z4 = true;
            } else {
                z4 = false;
            }
        } else {
            float f6 = this.f4053m;
            float f7 = this.f4044h0;
            Typeface typeface3 = this.C;
            Typeface typeface4 = this.f4072z;
            if (typeface3 != typeface4) {
                this.C = typeface4;
                z3 = true;
            } else {
                z3 = false;
            }
            if (C(f3, 0.0f)) {
                this.M = 1.0f;
            } else {
                this.M = G(this.f4053m, this.f4055n, f3, this.X) / this.f4053m;
            }
            float f8 = this.f4055n / this.f4053m;
            fWidth = (!z2 && fWidth2 * f8 > fWidth) ? Math.min(fWidth / f8, fWidth2) : fWidth2;
            f4 = f6;
            f5 = f7;
            z4 = z3;
        }
        if (fWidth > 0.0f) {
            z4 = ((this.N > f4 ? 1 : (this.N == f4 ? 0 : -1)) != 0) || ((this.f4046i0 > f5 ? 1 : (this.f4046i0 == f5 ? 0 : -1)) != 0) || this.T || z4;
            this.N = f4;
            this.f4046i0 = f5;
            this.T = false;
        }
        if (this.G == null || z4) {
            this.U.setTextSize(this.N);
            this.U.setTypeface(this.C);
            if (Build.VERSION.SDK_INT >= 21) {
                this.U.setLetterSpacing(this.f4046i0);
            }
            this.U.setLinearText(this.M != 1.0f);
            this.H = f(this.F);
            StaticLayout staticLayoutK = k(k0() ? this.f4058o0 : 1, fWidth, this.H);
            this.f4048j0 = staticLayoutK;
            this.G = staticLayoutK.getText();
        }
    }

    private void j() {
        Bitmap bitmap = this.K;
        if (bitmap != null) {
            bitmap.recycle();
            this.K = null;
        }
    }

    private StaticLayout k(int i3, float f3, boolean z2) {
        StaticLayout staticLayoutA;
        try {
            staticLayoutA = j.c(this.F, this.U, (int) f3).e(TextUtils.TruncateAt.END).h(z2).d(i3 == 1 ? Layout.Alignment.ALIGN_NORMAL : y()).g(false).j(i3).i(this.f4060p0, this.f4062q0).f(this.f4064r0).a();
        } catch (j.a e3) {
            Log.e("CollapsingTextHelper", e3.getCause().getMessage(), e3);
            staticLayoutA = null;
        }
        return (StaticLayout) androidx.core.util.h.f(staticLayoutA);
    }

    private boolean k0() {
        return this.f4058o0 > 1 && (!this.H || this.f4035d) && !this.J;
    }

    private void m(Canvas canvas, float f3, float f4) {
        int alpha = this.U.getAlpha();
        canvas.translate(f3, f4);
        float f5 = alpha;
        this.U.setAlpha((int) (this.f4054m0 * f5));
        int i3 = Build.VERSION.SDK_INT;
        if (i3 >= 31) {
            TextPaint textPaint = this.U;
            textPaint.setShadowLayer(this.O, this.P, this.Q, r0.a.a(this.R, textPaint.getAlpha()));
        }
        this.f4048j0.draw(canvas);
        this.U.setAlpha((int) (this.f4052l0 * f5));
        if (i3 >= 31) {
            TextPaint textPaint2 = this.U;
            textPaint2.setShadowLayer(this.O, this.P, this.Q, r0.a.a(this.R, textPaint2.getAlpha()));
        }
        int lineBaseline = this.f4048j0.getLineBaseline(0);
        CharSequence charSequence = this.f4056n0;
        float f6 = lineBaseline;
        canvas.drawText(charSequence, 0, charSequence.length(), 0.0f, f6, this.U);
        if (i3 >= 31) {
            this.U.setShadowLayer(this.O, this.P, this.Q, this.R);
        }
        if (this.f4035d) {
            return;
        }
        String strTrim = this.f4056n0.toString().trim();
        if (strTrim.endsWith("…")) {
            strTrim = strTrim.substring(0, strTrim.length() - 1);
        }
        String str = strTrim;
        this.U.setAlpha(alpha);
        canvas.drawText(str, 0, Math.min(this.f4048j0.getLineEnd(0), str.length()), 0.0f, f6, (Paint) this.U);
    }

    private void n() {
        if (this.K != null || this.f4043h.isEmpty() || TextUtils.isEmpty(this.G)) {
            return;
        }
        g(0.0f);
        int width = this.f4048j0.getWidth();
        int height = this.f4048j0.getHeight();
        if (width <= 0 || height <= 0) {
            return;
        }
        this.K = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
        this.f4048j0.draw(new Canvas(this.K));
        if (this.L == null) {
            this.L = new Paint(3);
        }
    }

    private float r(int i3, int i4) {
        return (i4 == 17 || (i4 & 7) == 1) ? (i3 / 2.0f) - (this.f4050k0 / 2.0f) : ((i4 & 8388613) == 8388613 || (i4 & 5) == 5) ? this.H ? this.f4045i.left : this.f4045i.right - this.f4050k0 : this.H ? this.f4045i.right - this.f4050k0 : this.f4045i.left;
    }

    private float s(RectF rectF, int i3, int i4) {
        if (i4 == 17 || (i4 & 7) == 1) {
            return (i3 / 2.0f) + (this.f4050k0 / 2.0f);
        }
        if ((i4 & 8388613) == 8388613 || (i4 & 5) == 5) {
            return this.H ? rectF.left + this.f4050k0 : this.f4045i.right;
        }
        if (this.H) {
            return this.f4045i.right;
        }
        return this.f4050k0 + rectF.left;
    }

    private int u(ColorStateList colorStateList) {
        if (colorStateList == null) {
            return 0;
        }
        int[] iArr = this.S;
        return iArr != null ? colorStateList.getColorForState(iArr, 0) : colorStateList.getDefaultColor();
    }

    private int v() {
        return u(this.f4057o);
    }

    private Layout.Alignment y() {
        int iB = androidx.core.view.e.b(this.f4049k, this.H ? 1 : 0) & 7;
        return iB != 1 ? iB != 5 ? this.H ? Layout.Alignment.ALIGN_OPPOSITE : Layout.Alignment.ALIGN_NORMAL : this.H ? Layout.Alignment.ALIGN_NORMAL : Layout.Alignment.ALIGN_OPPOSITE : Layout.Alignment.ALIGN_CENTER;
    }

    private void z(TextPaint textPaint) {
        textPaint.setTextSize(this.f4055n);
        textPaint.setTypeface(this.f4069w);
        if (Build.VERSION.SDK_INT >= 21) {
            textPaint.setLetterSpacing(this.f4042g0);
        }
    }

    public final boolean E() {
        ColorStateList colorStateList;
        ColorStateList colorStateList2 = this.f4059p;
        return (colorStateList2 != null && colorStateList2.isStateful()) || ((colorStateList = this.f4057o) != null && colorStateList.isStateful());
    }

    public void H(Configuration configuration) {
        if (Build.VERSION.SDK_INT >= 31) {
            Typeface typeface = this.f4071y;
            if (typeface != null) {
                this.f4070x = z0.g.b(configuration, typeface);
            }
            Typeface typeface2 = this.B;
            if (typeface2 != null) {
                this.A = z0.g.b(configuration, typeface2);
            }
            Typeface typeface3 = this.f4070x;
            if (typeface3 == null) {
                typeface3 = this.f4071y;
            }
            this.f4069w = typeface3;
            Typeface typeface4 = this.A;
            if (typeface4 == null) {
                typeface4 = this.B;
            }
            this.f4072z = typeface4;
            L(true);
        }
    }

    void J() {
        this.f4031b = this.f4045i.width() > 0 && this.f4045i.height() > 0 && this.f4043h.width() > 0 && this.f4043h.height() > 0;
    }

    public void K() {
        L(false);
    }

    public void L(boolean z2) {
        if ((this.f4029a.getHeight() <= 0 || this.f4029a.getWidth() <= 0) && !z2) {
            return;
        }
        b(z2);
        c();
    }

    public void N(int i3, int i4, int i5, int i6) {
        if (M(this.f4045i, i3, i4, i5, i6)) {
            return;
        }
        this.f4045i.set(i3, i4, i5, i6);
        this.T = true;
        J();
    }

    public void O(Rect rect) {
        N(rect.left, rect.top, rect.right, rect.bottom);
    }

    public void P(int i3) {
        z0.d dVar = new z0.d(this.f4029a.getContext(), i3);
        if (dVar.i() != null) {
            this.f4059p = dVar.i();
        }
        if (dVar.j() != 0.0f) {
            this.f4055n = dVar.j();
        }
        ColorStateList colorStateList = dVar.f5979a;
        if (colorStateList != null) {
            this.f4032b0 = colorStateList;
        }
        this.Z = dVar.f5983e;
        this.f4030a0 = dVar.f5984f;
        this.Y = dVar.f5985g;
        this.f4042g0 = dVar.f5987i;
        z0.a aVar = this.E;
        if (aVar != null) {
            aVar.c();
        }
        this.E = new z0.a(new a(), dVar.e());
        dVar.h(this.f4029a.getContext(), this.E);
        K();
    }

    public void R(ColorStateList colorStateList) {
        if (this.f4059p != colorStateList) {
            this.f4059p = colorStateList;
            K();
        }
    }

    public void S(int i3) {
        if (this.f4051l != i3) {
            this.f4051l = i3;
            K();
        }
    }

    public void T(Typeface typeface) {
        if (U(typeface)) {
            K();
        }
    }

    public void V(int i3, int i4, int i5, int i6) {
        if (M(this.f4043h, i3, i4, i5, i6)) {
            return;
        }
        this.f4043h.set(i3, i4, i5, i6);
        this.T = true;
        J();
    }

    public void W(Rect rect) {
        V(rect.left, rect.top, rect.right, rect.bottom);
    }

    public void X(float f3) {
        if (this.f4044h0 != f3) {
            this.f4044h0 = f3;
            K();
        }
    }

    public void Z(ColorStateList colorStateList) {
        if (this.f4057o != colorStateList) {
            this.f4057o = colorStateList;
            K();
        }
    }

    public void a0(int i3) {
        if (this.f4049k != i3) {
            this.f4049k = i3;
            K();
        }
    }

    public void b0(float f3) {
        if (this.f4053m != f3) {
            this.f4053m = f3;
            K();
        }
    }

    public void d0(float f3) {
        float fA = t.a.a(f3, 0.0f, 1.0f);
        if (fA != this.f4033c) {
            this.f4033c = fA;
            c();
        }
    }

    public void f0(TimeInterpolator timeInterpolator) {
        this.W = timeInterpolator;
        K();
    }

    public final boolean g0(int[] iArr) {
        this.S = iArr;
        if (!E()) {
            return false;
        }
        K();
        return true;
    }

    public void h0(CharSequence charSequence) {
        if (charSequence == null || !TextUtils.equals(this.F, charSequence)) {
            this.F = charSequence;
            this.G = null;
            j();
            K();
        }
    }

    public void i0(TimeInterpolator timeInterpolator) {
        this.X = timeInterpolator;
        K();
    }

    public void j0(Typeface typeface) {
        boolean zU = U(typeface);
        boolean zC0 = c0(typeface);
        if (zU || zC0) {
            K();
        }
    }

    public void l(Canvas canvas) {
        int iSave = canvas.save();
        if (this.G == null || !this.f4031b) {
            return;
        }
        this.U.setTextSize(this.N);
        float f3 = this.f4067u;
        float f4 = this.f4068v;
        boolean z2 = this.J && this.K != null;
        float f5 = this.M;
        if (f5 != 1.0f && !this.f4035d) {
            canvas.scale(f5, f5, f3, f4);
        }
        if (z2) {
            canvas.drawBitmap(this.K, f3, f4, this.L);
            canvas.restoreToCount(iSave);
            return;
        }
        if (!k0() || (this.f4035d && this.f4033c <= this.f4039f)) {
            canvas.translate(f3, f4);
            this.f4048j0.draw(canvas);
        } else {
            m(canvas, this.f4067u - this.f4048j0.getLineStart(0), f4);
        }
        canvas.restoreToCount(iSave);
    }

    public void o(RectF rectF, int i3, int i4) {
        this.H = f(this.F);
        rectF.left = r(i3, i4);
        rectF.top = this.f4045i.top;
        rectF.right = s(rectF, i3, i4);
        rectF.bottom = this.f4045i.top + q();
    }

    public ColorStateList p() {
        return this.f4059p;
    }

    public float q() {
        z(this.V);
        return -this.V.ascent();
    }

    public int t() {
        return u(this.f4059p);
    }

    public float w() {
        A(this.V);
        return -this.V.ascent();
    }

    public float x() {
        return this.f4033c;
    }
}
