package com.google.android.material.chip; import android.R; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Outline; import android.graphics.Paint; import android.graphics.Path; import android.graphics.PointF; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.graphics.drawable.RippleDrawable; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.OvalShape; import android.text.TextUtils; import android.util.AttributeSet; import c3.j; import com.google.android.gms.ads.RequestConfiguration; import com.google.android.gms.common.api.Api; import com.google.android.material.internal.e; import com.google.android.material.internal.f; import d3.c; import java.lang.ref.WeakReference; import java.util.Arrays; import m3.d; import p3.g; /* loaded from: classes2.dex */ public class b extends g implements Drawable.Callback, e.b { private static final int[] J0 = {R.attr.state_enabled}; private static final ShapeDrawable K0 = new ShapeDrawable(new OvalShape()); private ColorStateList A; private PorterDuff.Mode A0; private float B; private int[] B0; private ColorStateList C; private boolean C0; private CharSequence D; private ColorStateList D0; private boolean E; private WeakReference E0; private Drawable F; private TextUtils.TruncateAt F0; private ColorStateList G; private boolean G0; private float H; private int H0; private boolean I; private boolean I0; private boolean J; private Drawable K; private Drawable L; private ColorStateList M; private float N; private CharSequence O; private boolean P; private boolean Q; private Drawable V; private c W; private c X; private float Y; private float Z; /* renamed from: a0, reason: collision with root package name */ private float f4431a0; /* renamed from: b0, reason: collision with root package name */ private float f4432b0; /* renamed from: c0, reason: collision with root package name */ private float f4433c0; /* renamed from: d0, reason: collision with root package name */ private float f4434d0; /* renamed from: e0, reason: collision with root package name */ private float f4435e0; /* renamed from: f0, reason: collision with root package name */ private float f4436f0; /* renamed from: g0, reason: collision with root package name */ private final Context f4437g0; /* renamed from: h0, reason: collision with root package name */ private final Paint f4438h0; /* renamed from: i0, reason: collision with root package name */ private final Paint f4439i0; /* renamed from: j0, reason: collision with root package name */ private final Paint.FontMetrics f4440j0; /* renamed from: k0, reason: collision with root package name */ private final RectF f4441k0; /* renamed from: l0, reason: collision with root package name */ private final PointF f4442l0; /* renamed from: m0, reason: collision with root package name */ private final Path f4443m0; /* renamed from: n0, reason: collision with root package name */ private final e f4444n0; /* renamed from: o0, reason: collision with root package name */ private int f4445o0; /* renamed from: p0, reason: collision with root package name */ private int f4446p0; /* renamed from: q0, reason: collision with root package name */ private int f4447q0; /* renamed from: r0, reason: collision with root package name */ private int f4448r0; /* renamed from: s0, reason: collision with root package name */ private int f4449s0; /* renamed from: t0, reason: collision with root package name */ private int f4450t0; /* renamed from: u0, reason: collision with root package name */ private boolean f4451u0; /* renamed from: v0, reason: collision with root package name */ private int f4452v0; /* renamed from: w, reason: collision with root package name */ private ColorStateList f4453w; /* renamed from: w0, reason: collision with root package name */ private int f4454w0; /* renamed from: x, reason: collision with root package name */ private ColorStateList f4455x; /* renamed from: x0, reason: collision with root package name */ private ColorFilter f4456x0; /* renamed from: y, reason: collision with root package name */ private float f4457y; /* renamed from: y0, reason: collision with root package name */ private PorterDuffColorFilter f4458y0; /* renamed from: z, reason: collision with root package name */ private float f4459z; /* renamed from: z0, reason: collision with root package name */ private ColorStateList f4460z0; public interface a { void a(); } private b(Context context, AttributeSet attributeSet, int i10, int i11) { super(context, attributeSet, i10, i11); this.f4438h0 = new Paint(1); this.f4440j0 = new Paint.FontMetrics(); this.f4441k0 = new RectF(); this.f4442l0 = new PointF(); this.f4443m0 = new Path(); this.f4454w0 = 255; this.A0 = PorterDuff.Mode.SRC_IN; this.E0 = new WeakReference(null); J(context); this.f4437g0 = context; e eVar = new e(this); this.f4444n0 = eVar; this.D = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; eVar.e().density = context.getResources().getDisplayMetrics().density; this.f4439i0 = null; int[] iArr = J0; setState(iArr); Y1(iArr); this.G0 = true; if (n3.b.f11961a) { K0.setTint(-1); } } private boolean A2() { return this.E && this.F != null; } private boolean B2() { return this.J && this.K != null; } private void C2(Drawable drawable) { if (drawable != null) { drawable.setCallback(null); } } private void D2() { this.D0 = this.C0 ? n3.b.a(this.C) : null; } private void E2() { this.L = new RippleDrawable(n3.b.a(U0()), this.K, K0); } private void O1(ColorStateList colorStateList) { if (this.f4453w != colorStateList) { this.f4453w = colorStateList; onStateChange(getState()); } } private ColorFilter a1() { ColorFilter colorFilter = this.f4456x0; return colorFilter != null ? colorFilter : this.f4458y0; } private void c0(Drawable drawable) { if (drawable == null) { return; } drawable.setCallback(this); r.c.m(drawable, r.c.f(this)); drawable.setLevel(getLevel()); drawable.setVisible(isVisible(), false); if (drawable == this.K) { if (drawable.isStateful()) { drawable.setState(N0()); } r.c.o(drawable, this.M); return; } if (drawable.isStateful()) { drawable.setState(getState()); } Drawable drawable2 = this.F; if (drawable == drawable2 && this.I) { r.c.o(drawable2, this.G); } } private static boolean c1(int[] iArr, int i10) { if (iArr == null) { return false; } for (int i11 : iArr) { if (i11 == i10) { return true; } } return false; } private void d0(Rect rect, RectF rectF) { rectF.setEmpty(); if (A2() || z2()) { float f10 = this.Y + this.Z; if (r.c.f(this) == 0) { float f11 = rect.left + f10; rectF.left = f11; rectF.right = f11 + this.H; } else { float f12 = rect.right - f10; rectF.right = f12; rectF.left = f12 - this.H; } float exactCenterY = rect.exactCenterY(); float f13 = this.H; float f14 = exactCenterY - (f13 / 2.0f); rectF.top = f14; rectF.bottom = f14 + f13; } } private void f0(Rect rect, RectF rectF) { rectF.set(rect); if (B2()) { float f10 = this.f4436f0 + this.f4435e0 + this.N + this.f4434d0 + this.f4433c0; if (r.c.f(this) == 0) { rectF.right = rect.right - f10; } else { rectF.left = rect.left + f10; } } } private void g0(Rect rect, RectF rectF) { rectF.setEmpty(); if (B2()) { float f10 = this.f4436f0 + this.f4435e0; if (r.c.f(this) == 0) { float f11 = rect.right - f10; rectF.right = f11; rectF.left = f11 - this.N; } else { float f12 = rect.left + f10; rectF.left = f12; rectF.right = f12 + this.N; } float exactCenterY = rect.exactCenterY(); float f13 = this.N; float f14 = exactCenterY - (f13 / 2.0f); rectF.top = f14; rectF.bottom = f14 + f13; } } private static boolean g1(ColorStateList colorStateList) { return colorStateList != null && colorStateList.isStateful(); } private void h0(Rect rect, RectF rectF) { rectF.setEmpty(); if (B2()) { float f10 = this.f4436f0 + this.f4435e0 + this.N + this.f4434d0 + this.f4433c0; if (r.c.f(this) == 0) { float f11 = rect.right; rectF.right = f11; rectF.left = f11 - f10; } else { int i10 = rect.left; rectF.left = i10; rectF.right = i10 + f10; } rectF.top = rect.top; rectF.bottom = rect.bottom; } } private static boolean h1(Drawable drawable) { return drawable != null && drawable.isStateful(); } private static boolean i1(d dVar) { ColorStateList colorStateList; return (dVar == null || (colorStateList = dVar.f11814b) == null || !colorStateList.isStateful()) ? false : true; } private void j0(Rect rect, RectF rectF) { rectF.setEmpty(); if (this.D != null) { float e02 = this.Y + e0() + this.f4432b0; float i02 = this.f4436f0 + i0() + this.f4433c0; if (r.c.f(this) == 0) { rectF.left = rect.left + e02; rectF.right = rect.right - i02; } else { rectF.left = rect.left + i02; rectF.right = rect.right - e02; } rectF.top = rect.top; rectF.bottom = rect.bottom; } } private void j1(AttributeSet attributeSet, int i10, int i11) { TypedArray k10 = f.k(this.f4437g0, attributeSet, j.I, i10, i11, new int[0]); this.I0 = k10.hasValue(j.f3671s0); O1(m3.c.a(this.f4437g0, k10, j.f3594f0)); s1(m3.c.a(this.f4437g0, k10, j.S)); G1(k10.getDimension(j.f3564a0, 0.0f)); int i12 = j.T; if (k10.hasValue(i12)) { u1(k10.getDimension(i12, 0.0f)); } K1(m3.c.a(this.f4437g0, k10, j.f3582d0)); M1(k10.getDimension(j.f3588e0, 0.0f)); l2(m3.c.a(this.f4437g0, k10, j.f3666r0)); q2(k10.getText(j.N)); r2(m3.c.f(this.f4437g0, k10, j.J)); int i13 = k10.getInt(j.L, 0); if (i13 == 1) { d2(TextUtils.TruncateAt.START); } else if (i13 == 2) { d2(TextUtils.TruncateAt.MIDDLE); } else if (i13 == 3) { d2(TextUtils.TruncateAt.END); } F1(k10.getBoolean(j.Z, false)); if (attributeSet != null && attributeSet.getAttributeValue("http://schemas.android.com/apk/res-auto", "chipIconEnabled") != null && attributeSet.getAttributeValue("http://schemas.android.com/apk/res-auto", "chipIconVisible") == null) { F1(k10.getBoolean(j.W, false)); } y1(m3.c.d(this.f4437g0, k10, j.V)); int i14 = j.Y; if (k10.hasValue(i14)) { C1(m3.c.a(this.f4437g0, k10, i14)); } A1(k10.getDimension(j.X, 0.0f)); b2(k10.getBoolean(j.f3636m0, false)); if (attributeSet != null && attributeSet.getAttributeValue("http://schemas.android.com/apk/res-auto", "closeIconEnabled") != null && attributeSet.getAttributeValue("http://schemas.android.com/apk/res-auto", "closeIconVisible") == null) { b2(k10.getBoolean(j.f3606h0, false)); } P1(m3.c.d(this.f4437g0, k10, j.f3600g0)); Z1(m3.c.a(this.f4437g0, k10, j.f3630l0)); U1(k10.getDimension(j.f3618j0, 0.0f)); m1(k10.getBoolean(j.O, false)); r1(k10.getBoolean(j.R, false)); if (attributeSet != null && attributeSet.getAttributeValue("http://schemas.android.com/apk/res-auto", "checkedIconEnabled") != null && attributeSet.getAttributeValue("http://schemas.android.com/apk/res-auto", "checkedIconVisible") == null) { r1(k10.getBoolean(j.Q, false)); } o1(m3.c.d(this.f4437g0, k10, j.P)); o2(c.b(this.f4437g0, k10, j.f3676t0)); e2(c.b(this.f4437g0, k10, j.f3648o0)); I1(k10.getDimension(j.f3576c0, 0.0f)); i2(k10.getDimension(j.f3660q0, 0.0f)); g2(k10.getDimension(j.f3654p0, 0.0f)); v2(k10.getDimension(j.f3686v0, 0.0f)); t2(k10.getDimension(j.f3681u0, 0.0f)); W1(k10.getDimension(j.f3624k0, 0.0f)); R1(k10.getDimension(j.f3612i0, 0.0f)); w1(k10.getDimension(j.U, 0.0f)); k2(k10.getDimensionPixelSize(j.M, Api.BaseClientBuilder.API_PRIORITY_OTHER)); k10.recycle(); } private float k0() { this.f4444n0.e().getFontMetrics(this.f4440j0); Paint.FontMetrics fontMetrics = this.f4440j0; return (fontMetrics.descent + fontMetrics.ascent) / 2.0f; } /* JADX WARN: Removed duplicated region for block: B:60:0x00db */ /* JADX WARN: Removed duplicated region for block: B:63:0x00e7 */ /* JADX WARN: Removed duplicated region for block: B:66:0x00fd */ /* JADX WARN: Removed duplicated region for block: B:69:0x010c */ /* JADX WARN: Removed duplicated region for block: B:72:0x011b */ /* JADX WARN: Removed duplicated region for block: B:79:0x0145 */ /* JADX WARN: Removed duplicated region for block: B:81:0x014a */ /* JADX WARN: Removed duplicated region for block: B:84:0x00f4 */ /* JADX WARN: Removed duplicated region for block: B:85:0x00e2 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ private boolean l1(int[] r7, int[] r8) { /* Method dump skipped, instructions count: 334 To view this dump change 'Code comments level' option to 'DEBUG' */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.chip.b.l1(int[], int[]):boolean"); } private boolean m0() { return this.Q && this.V != null && this.P; } public static b n0(Context context, AttributeSet attributeSet, int i10, int i11) { b bVar = new b(context, attributeSet, i10, i11); bVar.j1(attributeSet, i10, i11); return bVar; } private void o0(Canvas canvas, Rect rect) { if (z2()) { d0(rect, this.f4441k0); RectF rectF = this.f4441k0; float f10 = rectF.left; float f11 = rectF.top; canvas.translate(f10, f11); this.V.setBounds(0, 0, (int) this.f4441k0.width(), (int) this.f4441k0.height()); this.V.draw(canvas); canvas.translate(-f10, -f11); } } private void p0(Canvas canvas, Rect rect) { if (this.I0) { return; } this.f4438h0.setColor(this.f4446p0); this.f4438h0.setStyle(Paint.Style.FILL); this.f4438h0.setColorFilter(a1()); this.f4441k0.set(rect); canvas.drawRoundRect(this.f4441k0, z0(), z0(), this.f4438h0); } private void q0(Canvas canvas, Rect rect) { if (A2()) { d0(rect, this.f4441k0); RectF rectF = this.f4441k0; float f10 = rectF.left; float f11 = rectF.top; canvas.translate(f10, f11); this.F.setBounds(0, 0, (int) this.f4441k0.width(), (int) this.f4441k0.height()); this.F.draw(canvas); canvas.translate(-f10, -f11); } } private void r0(Canvas canvas, Rect rect) { if (this.B <= 0.0f || this.I0) { return; } this.f4438h0.setColor(this.f4448r0); this.f4438h0.setStyle(Paint.Style.STROKE); if (!this.I0) { this.f4438h0.setColorFilter(a1()); } RectF rectF = this.f4441k0; float f10 = rect.left; float f11 = this.B; rectF.set(f10 + (f11 / 2.0f), rect.top + (f11 / 2.0f), rect.right - (f11 / 2.0f), rect.bottom - (f11 / 2.0f)); float f12 = this.f4459z - (this.B / 2.0f); canvas.drawRoundRect(this.f4441k0, f12, f12, this.f4438h0); } private void s0(Canvas canvas, Rect rect) { if (this.I0) { return; } this.f4438h0.setColor(this.f4445o0); this.f4438h0.setStyle(Paint.Style.FILL); this.f4441k0.set(rect); canvas.drawRoundRect(this.f4441k0, z0(), z0(), this.f4438h0); } private void t0(Canvas canvas, Rect rect) { if (B2()) { g0(rect, this.f4441k0); RectF rectF = this.f4441k0; float f10 = rectF.left; float f11 = rectF.top; canvas.translate(f10, f11); this.K.setBounds(0, 0, (int) this.f4441k0.width(), (int) this.f4441k0.height()); if (n3.b.f11961a) { this.L.setBounds(this.K.getBounds()); this.L.jumpToCurrentState(); this.L.draw(canvas); } else { this.K.draw(canvas); } canvas.translate(-f10, -f11); } } private void u0(Canvas canvas, Rect rect) { this.f4438h0.setColor(this.f4449s0); this.f4438h0.setStyle(Paint.Style.FILL); this.f4441k0.set(rect); if (!this.I0) { canvas.drawRoundRect(this.f4441k0, z0(), z0(), this.f4438h0); } else { g(new RectF(rect), this.f4443m0); super.o(canvas, this.f4438h0, this.f4443m0, t()); } } private void v0(Canvas canvas, Rect rect) { Paint paint = this.f4439i0; if (paint != null) { paint.setColor(q.a.f(-16777216, 127)); canvas.drawRect(rect, this.f4439i0); if (A2() || z2()) { d0(rect, this.f4441k0); canvas.drawRect(this.f4441k0, this.f4439i0); } if (this.D != null) { canvas.drawLine(rect.left, rect.exactCenterY(), rect.right, rect.exactCenterY(), this.f4439i0); } if (B2()) { g0(rect, this.f4441k0); canvas.drawRect(this.f4441k0, this.f4439i0); } this.f4439i0.setColor(q.a.f(-65536, 127)); f0(rect, this.f4441k0); canvas.drawRect(this.f4441k0, this.f4439i0); this.f4439i0.setColor(q.a.f(-16711936, 127)); h0(rect, this.f4441k0); canvas.drawRect(this.f4441k0, this.f4439i0); } } private void w0(Canvas canvas, Rect rect) { if (this.D != null) { Paint.Align l02 = l0(rect, this.f4442l0); j0(rect, this.f4441k0); if (this.f4444n0.d() != null) { this.f4444n0.e().drawableState = getState(); this.f4444n0.j(this.f4437g0); } this.f4444n0.e().setTextAlign(l02); int i10 = 0; boolean z10 = Math.round(this.f4444n0.f(W0().toString())) > Math.round(this.f4441k0.width()); if (z10) { i10 = canvas.save(); canvas.clipRect(this.f4441k0); } CharSequence charSequence = this.D; if (z10 && this.F0 != null) { charSequence = TextUtils.ellipsize(charSequence, this.f4444n0.e(), this.f4441k0.width(), this.F0); } CharSequence charSequence2 = charSequence; int length = charSequence2.length(); PointF pointF = this.f4442l0; canvas.drawText(charSequence2, 0, length, pointF.x, pointF.y, this.f4444n0.e()); if (z10) { canvas.restoreToCount(i10); } } } private boolean z2() { return this.Q && this.V != null && this.f4451u0; } public float A0() { return this.f4436f0; } public void A1(float f10) { if (this.H != f10) { float e02 = e0(); this.H = f10; float e03 = e0(); invalidateSelf(); if (e02 != e03) { k1(); } } } public Drawable B0() { Drawable drawable = this.F; if (drawable != null) { return r.c.q(drawable); } return null; } public void B1(int i10) { A1(this.f4437g0.getResources().getDimension(i10)); } public float C0() { return this.H; } public void C1(ColorStateList colorStateList) { this.I = true; if (this.G != colorStateList) { this.G = colorStateList; if (A2()) { r.c.o(this.F, colorStateList); } onStateChange(getState()); } } public ColorStateList D0() { return this.G; } public void D1(int i10) { C1(e.b.c(this.f4437g0, i10)); } public float E0() { return this.f4457y; } public void E1(int i10) { F1(this.f4437g0.getResources().getBoolean(i10)); } public float F0() { return this.Y; } public void F1(boolean z10) { if (this.E != z10) { boolean A2 = A2(); this.E = z10; boolean A22 = A2(); if (A2 != A22) { if (A22) { c0(this.F); } else { C2(this.F); } invalidateSelf(); k1(); } } } public ColorStateList G0() { return this.A; } public void G1(float f10) { if (this.f4457y != f10) { this.f4457y = f10; invalidateSelf(); k1(); } } public float H0() { return this.B; } public void H1(int i10) { G1(this.f4437g0.getResources().getDimension(i10)); } public Drawable I0() { Drawable drawable = this.K; if (drawable != null) { return r.c.q(drawable); } return null; } public void I1(float f10) { if (this.Y != f10) { this.Y = f10; invalidateSelf(); k1(); } } public CharSequence J0() { return this.O; } public void J1(int i10) { I1(this.f4437g0.getResources().getDimension(i10)); } public float K0() { return this.f4435e0; } public void K1(ColorStateList colorStateList) { if (this.A != colorStateList) { this.A = colorStateList; if (this.I0) { X(colorStateList); } onStateChange(getState()); } } public float L0() { return this.N; } public void L1(int i10) { K1(e.b.c(this.f4437g0, i10)); } public float M0() { return this.f4434d0; } public void M1(float f10) { if (this.B != f10) { this.B = f10; this.f4438h0.setStrokeWidth(f10); if (this.I0) { super.Y(f10); } invalidateSelf(); } } public int[] N0() { return this.B0; } public void N1(int i10) { M1(this.f4437g0.getResources().getDimension(i10)); } public ColorStateList O0() { return this.M; } public void P0(RectF rectF) { h0(getBounds(), rectF); } public void P1(Drawable drawable) { Drawable I0 = I0(); if (I0 != drawable) { float i02 = i0(); this.K = drawable != null ? r.c.r(drawable).mutate() : null; if (n3.b.f11961a) { E2(); } float i03 = i0(); C2(I0); if (B2()) { c0(this.K); } invalidateSelf(); if (i02 != i03) { k1(); } } } public TextUtils.TruncateAt Q0() { return this.F0; } public void Q1(CharSequence charSequence) { if (this.O != charSequence) { this.O = x.a.c().h(charSequence); invalidateSelf(); } } public c R0() { return this.X; } public void R1(float f10) { if (this.f4435e0 != f10) { this.f4435e0 = f10; invalidateSelf(); if (B2()) { k1(); } } } public float S0() { return this.f4431a0; } public void S1(int i10) { R1(this.f4437g0.getResources().getDimension(i10)); } public float T0() { return this.Z; } public void T1(int i10) { P1(e.b.d(this.f4437g0, i10)); } public ColorStateList U0() { return this.C; } public void U1(float f10) { if (this.N != f10) { this.N = f10; invalidateSelf(); if (B2()) { k1(); } } } public c V0() { return this.W; } public void V1(int i10) { U1(this.f4437g0.getResources().getDimension(i10)); } public CharSequence W0() { return this.D; } public void W1(float f10) { if (this.f4434d0 != f10) { this.f4434d0 = f10; invalidateSelf(); if (B2()) { k1(); } } } public d X0() { return this.f4444n0.d(); } public void X1(int i10) { W1(this.f4437g0.getResources().getDimension(i10)); } public float Y0() { return this.f4433c0; } public boolean Y1(int[] iArr) { if (Arrays.equals(this.B0, iArr)) { return false; } this.B0 = iArr; if (B2()) { return l1(getState(), iArr); } return false; } public float Z0() { return this.f4432b0; } public void Z1(ColorStateList colorStateList) { if (this.M != colorStateList) { this.M = colorStateList; if (B2()) { r.c.o(this.K, colorStateList); } onStateChange(getState()); } } @Override // com.google.android.material.internal.e.b public void a() { k1(); invalidateSelf(); } public void a2(int i10) { Z1(e.b.c(this.f4437g0, i10)); } public boolean b1() { return this.C0; } public void b2(boolean z10) { if (this.J != z10) { boolean B2 = B2(); this.J = z10; boolean B22 = B2(); if (B2 != B22) { if (B22) { c0(this.K); } else { C2(this.K); } invalidateSelf(); k1(); } } } public void c2(a aVar) { this.E0 = new WeakReference(aVar); } public boolean d1() { return this.P; } public void d2(TextUtils.TruncateAt truncateAt) { this.F0 = truncateAt; } @Override // p3.g, android.graphics.drawable.Drawable public void draw(Canvas canvas) { Rect bounds = getBounds(); if (bounds.isEmpty() || getAlpha() == 0) { return; } int i10 = this.f4454w0; int a10 = i10 < 255 ? e3.a.a(canvas, bounds.left, bounds.top, bounds.right, bounds.bottom, i10) : 0; s0(canvas, bounds); p0(canvas, bounds); if (this.I0) { super.draw(canvas); } r0(canvas, bounds); u0(canvas, bounds); q0(canvas, bounds); o0(canvas, bounds); if (this.G0) { w0(canvas, bounds); } t0(canvas, bounds); v0(canvas, bounds); if (this.f4454w0 < 255) { canvas.restoreToCount(a10); } } float e0() { if (A2() || z2()) { return this.Z + this.H + this.f4431a0; } return 0.0f; } public boolean e1() { return h1(this.K); } public void e2(c cVar) { this.X = cVar; } public boolean f1() { return this.J; } public void f2(int i10) { e2(c.c(this.f4437g0, i10)); } public void g2(float f10) { if (this.f4431a0 != f10) { float e02 = e0(); this.f4431a0 = f10; float e03 = e0(); invalidateSelf(); if (e02 != e03) { k1(); } } } @Override // android.graphics.drawable.Drawable public int getAlpha() { return this.f4454w0; } @Override // android.graphics.drawable.Drawable public ColorFilter getColorFilter() { return this.f4456x0; } @Override // android.graphics.drawable.Drawable public int getIntrinsicHeight() { return (int) this.f4457y; } @Override // android.graphics.drawable.Drawable public int getIntrinsicWidth() { return Math.min(Math.round(this.Y + e0() + this.f4432b0 + this.f4444n0.f(W0().toString()) + this.f4433c0 + i0() + this.f4436f0), this.H0); } @Override // p3.g, android.graphics.drawable.Drawable public int getOpacity() { return -3; } @Override // p3.g, android.graphics.drawable.Drawable public void getOutline(Outline outline) { if (this.I0) { super.getOutline(outline); return; } Rect bounds = getBounds(); if (bounds.isEmpty()) { outline.setRoundRect(0, 0, getIntrinsicWidth(), getIntrinsicHeight(), this.f4459z); } else { outline.setRoundRect(bounds, this.f4459z); } outline.setAlpha(getAlpha() / 255.0f); } public void h2(int i10) { g2(this.f4437g0.getResources().getDimension(i10)); } float i0() { if (B2()) { return this.f4434d0 + this.N + this.f4435e0; } return 0.0f; } public void i2(float f10) { if (this.Z != f10) { float e02 = e0(); this.Z = f10; float e03 = e0(); invalidateSelf(); if (e02 != e03) { k1(); } } } @Override // android.graphics.drawable.Drawable.Callback public void invalidateDrawable(Drawable drawable) { Drawable.Callback callback = getCallback(); if (callback != null) { callback.invalidateDrawable(this); } } @Override // p3.g, android.graphics.drawable.Drawable public boolean isStateful() { return g1(this.f4453w) || g1(this.f4455x) || g1(this.A) || (this.C0 && g1(this.D0)) || i1(this.f4444n0.d()) || m0() || h1(this.F) || h1(this.V) || g1(this.f4460z0); } public void j2(int i10) { i2(this.f4437g0.getResources().getDimension(i10)); } protected void k1() { a aVar = (a) this.E0.get(); if (aVar != null) { aVar.a(); } } public void k2(int i10) { this.H0 = i10; } Paint.Align l0(Rect rect, PointF pointF) { pointF.set(0.0f, 0.0f); Paint.Align align = Paint.Align.LEFT; if (this.D != null) { float e02 = this.Y + e0() + this.f4432b0; if (r.c.f(this) == 0) { pointF.x = rect.left + e02; align = Paint.Align.LEFT; } else { pointF.x = rect.right - e02; align = Paint.Align.RIGHT; } pointF.y = rect.centerY() - k0(); } return align; } public void l2(ColorStateList colorStateList) { if (this.C != colorStateList) { this.C = colorStateList; D2(); onStateChange(getState()); } } public void m1(boolean z10) { if (this.P != z10) { this.P = z10; float e02 = e0(); if (!z10 && this.f4451u0) { this.f4451u0 = false; } float e03 = e0(); invalidateSelf(); if (e02 != e03) { k1(); } } } public void m2(int i10) { l2(e.b.c(this.f4437g0, i10)); } public void n1(int i10) { m1(this.f4437g0.getResources().getBoolean(i10)); } void n2(boolean z10) { this.G0 = z10; } public void o1(Drawable drawable) { if (this.V != drawable) { float e02 = e0(); this.V = drawable; float e03 = e0(); C2(this.V); c0(this.V); invalidateSelf(); if (e02 != e03) { k1(); } } } public void o2(c cVar) { this.W = cVar; } @Override // android.graphics.drawable.Drawable public boolean onLayoutDirectionChanged(int i10) { boolean onLayoutDirectionChanged = super.onLayoutDirectionChanged(i10); if (A2()) { onLayoutDirectionChanged |= r.c.m(this.F, i10); } if (z2()) { onLayoutDirectionChanged |= r.c.m(this.V, i10); } if (B2()) { onLayoutDirectionChanged |= r.c.m(this.K, i10); } if (!onLayoutDirectionChanged) { return true; } invalidateSelf(); return true; } @Override // android.graphics.drawable.Drawable protected boolean onLevelChange(int i10) { boolean onLevelChange = super.onLevelChange(i10); if (A2()) { onLevelChange |= this.F.setLevel(i10); } if (z2()) { onLevelChange |= this.V.setLevel(i10); } if (B2()) { onLevelChange |= this.K.setLevel(i10); } if (onLevelChange) { invalidateSelf(); } return onLevelChange; } @Override // p3.g, android.graphics.drawable.Drawable, com.google.android.material.internal.e.b public boolean onStateChange(int[] iArr) { if (this.I0) { super.onStateChange(iArr); } return l1(iArr, N0()); } public void p1(int i10) { o1(e.b.d(this.f4437g0, i10)); } public void p2(int i10) { o2(c.c(this.f4437g0, i10)); } public void q1(int i10) { r1(this.f4437g0.getResources().getBoolean(i10)); } public void q2(CharSequence charSequence) { if (charSequence == null) { charSequence = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } if (TextUtils.equals(this.D, charSequence)) { return; } this.D = charSequence; this.f4444n0.i(true); invalidateSelf(); k1(); } public void r1(boolean z10) { if (this.Q != z10) { boolean z22 = z2(); this.Q = z10; boolean z23 = z2(); if (z22 != z23) { if (z23) { c0(this.V); } else { C2(this.V); } invalidateSelf(); k1(); } } } public void r2(d dVar) { this.f4444n0.h(dVar, this.f4437g0); } public void s1(ColorStateList colorStateList) { if (this.f4455x != colorStateList) { this.f4455x = colorStateList; onStateChange(getState()); } } public void s2(int i10) { r2(new d(this.f4437g0, i10)); } @Override // android.graphics.drawable.Drawable.Callback public void scheduleDrawable(Drawable drawable, Runnable runnable, long j10) { Drawable.Callback callback = getCallback(); if (callback != null) { callback.scheduleDrawable(this, runnable, j10); } } @Override // p3.g, android.graphics.drawable.Drawable public void setAlpha(int i10) { if (this.f4454w0 != i10) { this.f4454w0 = i10; invalidateSelf(); } } @Override // p3.g, android.graphics.drawable.Drawable public void setColorFilter(ColorFilter colorFilter) { if (this.f4456x0 != colorFilter) { this.f4456x0 = colorFilter; invalidateSelf(); } } @Override // p3.g, android.graphics.drawable.Drawable public void setTintList(ColorStateList colorStateList) { if (this.f4460z0 != colorStateList) { this.f4460z0 = colorStateList; onStateChange(getState()); } } @Override // p3.g, android.graphics.drawable.Drawable public void setTintMode(PorterDuff.Mode mode) { if (this.A0 != mode) { this.A0 = mode; this.f4458y0 = i3.a.a(this, this.f4460z0, mode); invalidateSelf(); } } @Override // android.graphics.drawable.Drawable public boolean setVisible(boolean z10, boolean z11) { boolean visible = super.setVisible(z10, z11); if (A2()) { visible |= this.F.setVisible(z10, z11); } if (z2()) { visible |= this.V.setVisible(z10, z11); } if (B2()) { visible |= this.K.setVisible(z10, z11); } if (visible) { invalidateSelf(); } return visible; } public void t1(int i10) { s1(e.b.c(this.f4437g0, i10)); } public void t2(float f10) { if (this.f4433c0 != f10) { this.f4433c0 = f10; invalidateSelf(); k1(); } } public void u1(float f10) { if (this.f4459z != f10) { this.f4459z = f10; setShapeAppearanceModel(A().w(f10)); } } public void u2(int i10) { t2(this.f4437g0.getResources().getDimension(i10)); } @Override // android.graphics.drawable.Drawable.Callback public void unscheduleDrawable(Drawable drawable, Runnable runnable) { Drawable.Callback callback = getCallback(); if (callback != null) { callback.unscheduleDrawable(this, runnable); } } public void v1(int i10) { u1(this.f4437g0.getResources().getDimension(i10)); } public void v2(float f10) { if (this.f4432b0 != f10) { this.f4432b0 = f10; invalidateSelf(); k1(); } } public void w1(float f10) { if (this.f4436f0 != f10) { this.f4436f0 = f10; invalidateSelf(); k1(); } } public void w2(int i10) { v2(this.f4437g0.getResources().getDimension(i10)); } public Drawable x0() { return this.V; } public void x1(int i10) { w1(this.f4437g0.getResources().getDimension(i10)); } public void x2(boolean z10) { if (this.C0 != z10) { this.C0 = z10; D2(); onStateChange(getState()); } } public ColorStateList y0() { return this.f4455x; } public void y1(Drawable drawable) { Drawable B0 = B0(); if (B0 != drawable) { float e02 = e0(); this.F = drawable != null ? r.c.r(drawable).mutate() : null; float e03 = e0(); C2(B0); if (A2()) { c0(this.F); } invalidateSelf(); if (e02 != e03) { k1(); } } } boolean y2() { return this.G0; } public float z0() { return this.I0 ? C() : this.f4459z; } public void z1(int i10) { y1(e.b.d(this.f4437g0, i10)); } }