package com.google.android.material.textfield; import android.animation.ValueAnimator; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Canvas; import android.graphics.PorterDuff; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Typeface; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.os.Parcel; import android.os.Parcelable; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; import android.util.AttributeSet; import android.util.Log; import android.util.SparseArray; import android.view.View; import android.view.ViewGroup; import android.view.ViewStructure; import android.widget.EditText; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.TextView; import androidx.appcompat.widget.j; import androidx.appcompat.widget.j1; import androidx.appcompat.widget.r0; import androidx.core.view.n0; import androidx.core.view.v; import androidx.core.widget.t; import c3.i; import com.google.android.material.internal.CheckableImageButton; import java.util.Iterator; import java.util.LinkedHashSet; import p3.k; import z.a0; /* loaded from: classes2.dex */ public class TextInputLayout extends LinearLayout { /* renamed from: v0, reason: collision with root package name */ private static final int f4651v0 = i.f3553c; private int A; private final Rect B; private final Rect C; private final RectF D; private Typeface E; private final CheckableImageButton F; private ColorStateList G; private boolean H; private PorterDuff.Mode I; private boolean J; private Drawable K; private View.OnLongClickListener L; private final LinkedHashSet M; private int N; private final SparseArray O; private final CheckableImageButton P; private final LinkedHashSet Q; private ColorStateList V; private boolean W; /* renamed from: a, reason: collision with root package name */ private final FrameLayout f4652a; /* renamed from: a0, reason: collision with root package name */ private PorterDuff.Mode f4653a0; /* renamed from: b, reason: collision with root package name */ private final FrameLayout f4654b; /* renamed from: b0, reason: collision with root package name */ private boolean f4655b0; /* renamed from: c, reason: collision with root package name */ EditText f4656c; /* renamed from: c0, reason: collision with root package name */ private Drawable f4657c0; /* renamed from: d, reason: collision with root package name */ private CharSequence f4658d; /* renamed from: d0, reason: collision with root package name */ private Drawable f4659d0; /* renamed from: e, reason: collision with root package name */ private final com.google.android.material.textfield.f f4660e; /* renamed from: e0, reason: collision with root package name */ private final CheckableImageButton f4661e0; /* renamed from: f, reason: collision with root package name */ boolean f4662f; /* renamed from: f0, reason: collision with root package name */ private View.OnLongClickListener f4663f0; /* renamed from: g, reason: collision with root package name */ private int f4664g; /* renamed from: g0, reason: collision with root package name */ private ColorStateList f4665g0; /* renamed from: h, reason: collision with root package name */ private boolean f4666h; /* renamed from: h0, reason: collision with root package name */ private ColorStateList f4667h0; /* renamed from: i, reason: collision with root package name */ private TextView f4668i; /* renamed from: i0, reason: collision with root package name */ private final int f4669i0; /* renamed from: j, reason: collision with root package name */ private int f4670j; /* renamed from: j0, reason: collision with root package name */ private final int f4671j0; /* renamed from: k, reason: collision with root package name */ private int f4672k; /* renamed from: k0, reason: collision with root package name */ private int f4673k0; /* renamed from: l, reason: collision with root package name */ private ColorStateList f4674l; /* renamed from: l0, reason: collision with root package name */ private int f4675l0; /* renamed from: m, reason: collision with root package name */ private ColorStateList f4676m; /* renamed from: m0, reason: collision with root package name */ private final int f4677m0; /* renamed from: n, reason: collision with root package name */ private boolean f4678n; /* renamed from: n0, reason: collision with root package name */ private final int f4679n0; /* renamed from: o, reason: collision with root package name */ private CharSequence f4680o; /* renamed from: o0, reason: collision with root package name */ private final int f4681o0; /* renamed from: p, reason: collision with root package name */ private boolean f4682p; /* renamed from: p0, reason: collision with root package name */ private boolean f4683p0; /* renamed from: q, reason: collision with root package name */ private p3.g f4684q; /* renamed from: q0, reason: collision with root package name */ final com.google.android.material.internal.a f4685q0; /* renamed from: r, reason: collision with root package name */ private p3.g f4686r; /* renamed from: r0, reason: collision with root package name */ private boolean f4687r0; /* renamed from: s, reason: collision with root package name */ private k f4688s; /* renamed from: s0, reason: collision with root package name */ private ValueAnimator f4689s0; /* renamed from: t, reason: collision with root package name */ private final int f4690t; /* renamed from: t0, reason: collision with root package name */ private boolean f4691t0; /* renamed from: u, reason: collision with root package name */ private int f4692u; /* renamed from: u0, reason: collision with root package name */ private boolean f4693u0; /* renamed from: v, reason: collision with root package name */ private final int f4694v; /* renamed from: w, reason: collision with root package name */ private int f4695w; /* renamed from: x, reason: collision with root package name */ private final int f4696x; /* renamed from: y, reason: collision with root package name */ private final int f4697y; /* renamed from: z, reason: collision with root package name */ private int f4698z; class a implements TextWatcher { a() { } @Override // android.text.TextWatcher public void afterTextChanged(Editable editable) { TextInputLayout.this.c0(!r0.f4693u0); TextInputLayout textInputLayout = TextInputLayout.this; if (textInputLayout.f4662f) { textInputLayout.V(editable.length()); } } @Override // android.text.TextWatcher public void beforeTextChanged(CharSequence charSequence, int i10, int i11, int i12) { } @Override // android.text.TextWatcher public void onTextChanged(CharSequence charSequence, int i10, int i11, int i12) { } } class b implements Runnable { b() { } @Override // java.lang.Runnable public void run() { TextInputLayout.this.P.performClick(); TextInputLayout.this.P.jumpDrawablesToCurrentState(); } } class c implements Runnable { c() { } @Override // java.lang.Runnable public void run() { TextInputLayout.this.f4656c.requestLayout(); } } class d implements ValueAnimator.AnimatorUpdateListener { d() { } @Override // android.animation.ValueAnimator.AnimatorUpdateListener public void onAnimationUpdate(ValueAnimator valueAnimator) { TextInputLayout.this.f4685q0.O(((Float) valueAnimator.getAnimatedValue()).floatValue()); } } public static class e extends androidx.core.view.a { /* renamed from: d, reason: collision with root package name */ private final TextInputLayout f4703d; public e(TextInputLayout textInputLayout) { this.f4703d = textInputLayout; } @Override // androidx.core.view.a public void g(View view, a0 a0Var) { super.g(view, a0Var); EditText editText = this.f4703d.getEditText(); Editable text = editText != null ? editText.getText() : null; CharSequence hint = this.f4703d.getHint(); CharSequence error = this.f4703d.getError(); CharSequence counterOverflowDescription = this.f4703d.getCounterOverflowDescription(); boolean z10 = !TextUtils.isEmpty(text); boolean z11 = !TextUtils.isEmpty(hint); boolean z12 = !TextUtils.isEmpty(error); boolean z13 = false; boolean z14 = z12 || !TextUtils.isEmpty(counterOverflowDescription); if (z10) { a0Var.r0(text); } else if (z11) { a0Var.r0(hint); } if (z11) { a0Var.h0(hint); if (!z10 && z11) { z13 = true; } a0Var.o0(z13); } if (z14) { if (!z12) { error = counterOverflowDescription; } a0Var.d0(error); a0Var.b0(true); } } } public interface f { void a(TextInputLayout textInputLayout); } public interface g { void a(TextInputLayout textInputLayout, int i10); } static class h extends c0.a { public static final Parcelable.Creator CREATOR = new a(); /* renamed from: c, reason: collision with root package name */ CharSequence f4704c; /* renamed from: d, reason: collision with root package name */ boolean f4705d; static class a implements Parcelable.ClassLoaderCreator { a() { } @Override // android.os.Parcelable.Creator /* renamed from: a, reason: merged with bridge method [inline-methods] */ public h createFromParcel(Parcel parcel) { return new h(parcel, null); } @Override // android.os.Parcelable.ClassLoaderCreator /* renamed from: b, reason: merged with bridge method [inline-methods] */ public h createFromParcel(Parcel parcel, ClassLoader classLoader) { return new h(parcel, classLoader); } @Override // android.os.Parcelable.Creator /* renamed from: c, reason: merged with bridge method [inline-methods] */ public h[] newArray(int i10) { return new h[i10]; } } h(Parcelable parcelable) { super(parcelable); } public String toString() { return "TextInputLayout.SavedState{" + Integer.toHexString(System.identityHashCode(this)) + " error=" + ((Object) this.f4704c) + "}"; } @Override // c0.a, android.os.Parcelable public void writeToParcel(Parcel parcel, int i10) { super.writeToParcel(parcel, i10); TextUtils.writeToParcel(this.f4704c, parcel, i10); parcel.writeInt(this.f4705d ? 1 : 0); } h(Parcel parcel, ClassLoader classLoader) { super(parcel, classLoader); this.f4704c = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel); this.f4705d = parcel.readInt() == 1; } } public TextInputLayout(Context context, AttributeSet attributeSet) { this(context, attributeSet, c3.a.f3464t); } private void A(Canvas canvas) { if (this.f4678n) { this.f4685q0.i(canvas); } } private void B(boolean z10) { ValueAnimator valueAnimator = this.f4689s0; if (valueAnimator != null && valueAnimator.isRunning()) { this.f4689s0.cancel(); } if (z10 && this.f4687r0) { e(0.0f); } else { this.f4685q0.O(0.0f); } if (w() && ((com.google.android.material.textfield.c) this.f4684q).c0()) { u(); } this.f4683p0 = true; } private boolean C() { return this.N != 0; } private boolean D() { return getStartIconDrawable() != null; } private boolean H() { return this.f4692u == 1 && this.f4656c.getMinLines() <= 1; } private void J() { l(); M(); e0(); if (this.f4692u != 0) { b0(); } } private void K() { if (w()) { RectF rectF = this.D; this.f4685q0.k(rectF); h(rectF); rectF.offset(-getPaddingLeft(), 0.0f); ((com.google.android.material.textfield.c) this.f4684q).i0(rectF); } } private static void L(ViewGroup viewGroup, boolean z10) { int childCount = viewGroup.getChildCount(); for (int i10 = 0; i10 < childCount; i10++) { View childAt = viewGroup.getChildAt(i10); childAt.setEnabled(z10); if (childAt instanceof ViewGroup) { L((ViewGroup) childAt, z10); } } } private void M() { if (R()) { n0.q0(this.f4656c, this.f4684q); } } private static void N(CheckableImageButton checkableImageButton, View.OnLongClickListener onLongClickListener) { boolean M = n0.M(checkableImageButton); boolean z10 = onLongClickListener != null; boolean z11 = M || z10; checkableImageButton.setFocusable(z11); checkableImageButton.setClickable(M); checkableImageButton.setPressable(M); checkableImageButton.setLongClickable(z10); n0.w0(checkableImageButton, z11 ? 1 : 2); } private static void O(CheckableImageButton checkableImageButton, View.OnClickListener onClickListener, View.OnLongClickListener onLongClickListener) { checkableImageButton.setOnClickListener(onClickListener); N(checkableImageButton, onLongClickListener); } private static void P(CheckableImageButton checkableImageButton, View.OnLongClickListener onLongClickListener) { checkableImageButton.setOnLongClickListener(onLongClickListener); N(checkableImageButton, onLongClickListener); } private boolean R() { EditText editText = this.f4656c; return (editText == null || this.f4684q == null || editText.getBackground() != null || this.f4692u == 0) ? false : true; } private void S(boolean z10) { if (!z10 || getEndIconDrawable() == null) { i(); return; } Drawable mutate = r.c.r(getEndIconDrawable()).mutate(); r.c.n(mutate, this.f4660e.n()); this.P.setImageDrawable(mutate); } private void T(Rect rect) { p3.g gVar = this.f4686r; if (gVar != null) { int i10 = rect.bottom; gVar.setBounds(rect.left, i10 - this.f4697y, rect.right, i10); } } private void U() { if (this.f4668i != null) { EditText editText = this.f4656c; V(editText == null ? 0 : editText.getText().length()); } } private static void W(Context context, TextView textView, int i10, int i11, boolean z10) { textView.setContentDescription(context.getString(z10 ? c3.h.f3537b : c3.h.f3536a, Integer.valueOf(i10), Integer.valueOf(i11))); } private void X() { ColorStateList colorStateList; ColorStateList colorStateList2; TextView textView = this.f4668i; if (textView != null) { Q(textView, this.f4666h ? this.f4670j : this.f4672k); if (!this.f4666h && (colorStateList2 = this.f4674l) != null) { this.f4668i.setTextColor(colorStateList2); } if (!this.f4666h || (colorStateList = this.f4676m) == null) { return; } this.f4668i.setTextColor(colorStateList); } } private boolean Z() { int max; if (this.f4656c == null || this.f4656c.getMeasuredHeight() >= (max = Math.max(this.P.getMeasuredHeight(), this.F.getMeasuredHeight()))) { return false; } this.f4656c.setMinimumHeight(max); return true; } private boolean a0() { boolean z10; if (this.f4656c == null) { return false; } boolean z11 = true; if (D() && I() && this.F.getMeasuredWidth() > 0) { if (this.K == null) { this.K = new ColorDrawable(); this.K.setBounds(0, 0, (this.F.getMeasuredWidth() - this.f4656c.getPaddingLeft()) + v.a((ViewGroup.MarginLayoutParams) this.F.getLayoutParams()), 1); } Drawable[] a10 = t.a(this.f4656c); Drawable drawable = a10[0]; Drawable drawable2 = this.K; if (drawable != drawable2) { t.i(this.f4656c, drawable2, a10[1], a10[2], a10[3]); z10 = true; } z10 = false; } else { if (this.K != null) { Drawable[] a11 = t.a(this.f4656c); t.i(this.f4656c, null, a11[1], a11[2], a11[3]); this.K = null; z10 = true; } z10 = false; } CheckableImageButton endIconToUpdateDummyDrawable = getEndIconToUpdateDummyDrawable(); if (endIconToUpdateDummyDrawable != null && endIconToUpdateDummyDrawable.getMeasuredWidth() > 0) { if (this.f4657c0 == null) { this.f4657c0 = new ColorDrawable(); this.f4657c0.setBounds(0, 0, (endIconToUpdateDummyDrawable.getMeasuredWidth() - this.f4656c.getPaddingRight()) + v.b((ViewGroup.MarginLayoutParams) endIconToUpdateDummyDrawable.getLayoutParams()), 1); } Drawable[] a12 = t.a(this.f4656c); Drawable drawable3 = a12[2]; Drawable drawable4 = this.f4657c0; if (drawable3 != drawable4) { this.f4659d0 = drawable3; t.i(this.f4656c, a12[0], a12[1], drawable4, a12[3]); } else { z11 = z10; } } else { if (this.f4657c0 == null) { return z10; } Drawable[] a13 = t.a(this.f4656c); if (a13[2] == this.f4657c0) { t.i(this.f4656c, a13[0], a13[1], this.f4659d0, a13[3]); } else { z11 = z10; } this.f4657c0 = null; } return z11; } private void b0() { if (this.f4692u != 1) { LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) this.f4652a.getLayoutParams(); int r10 = r(); if (r10 != layoutParams.topMargin) { layoutParams.topMargin = r10; this.f4652a.requestLayout(); } } } private void d0(boolean z10, boolean z11) { ColorStateList colorStateList; TextView textView; boolean isEnabled = isEnabled(); EditText editText = this.f4656c; boolean z12 = (editText == null || TextUtils.isEmpty(editText.getText())) ? false : true; EditText editText2 = this.f4656c; boolean z13 = editText2 != null && editText2.hasFocus(); boolean k10 = this.f4660e.k(); ColorStateList colorStateList2 = this.f4665g0; if (colorStateList2 != null) { this.f4685q0.E(colorStateList2); this.f4685q0.K(this.f4665g0); } if (!isEnabled) { this.f4685q0.E(ColorStateList.valueOf(this.f4681o0)); this.f4685q0.K(ColorStateList.valueOf(this.f4681o0)); } else if (k10) { this.f4685q0.E(this.f4660e.o()); } else if (this.f4666h && (textView = this.f4668i) != null) { this.f4685q0.E(textView.getTextColors()); } else if (z13 && (colorStateList = this.f4667h0) != null) { this.f4685q0.E(colorStateList); } if (z12 || (isEnabled() && (z13 || k10))) { if (z11 || this.f4683p0) { v(z10); return; } return; } if (z11 || !this.f4683p0) { B(z10); } } private void f() { p3.g gVar = this.f4684q; if (gVar == null) { return; } gVar.setShapeAppearanceModel(this.f4688s); if (s()) { this.f4684q.V(this.f4695w, this.f4698z); } int m10 = m(); this.A = m10; this.f4684q.R(ColorStateList.valueOf(m10)); if (this.N == 3) { this.f4656c.getBackground().invalidateSelf(); } g(); invalidate(); } private void g() { if (this.f4686r == null) { return; } if (t()) { this.f4686r.R(ColorStateList.valueOf(this.f4698z)); } invalidate(); } private com.google.android.material.textfield.e getEndIconDelegate() { com.google.android.material.textfield.e eVar = (com.google.android.material.textfield.e) this.O.get(this.N); return eVar != null ? eVar : (com.google.android.material.textfield.e) this.O.get(0); } private CheckableImageButton getEndIconToUpdateDummyDrawable() { if (this.f4661e0.getVisibility() == 0) { return this.f4661e0; } if (C() && E()) { return this.P; } return null; } private void h(RectF rectF) { float f10 = rectF.left; int i10 = this.f4690t; rectF.left = f10 - i10; rectF.top -= i10; rectF.right += i10; rectF.bottom += i10; } private void i() { j(this.P, this.W, this.V, this.f4655b0, this.f4653a0); } private void j(CheckableImageButton checkableImageButton, boolean z10, ColorStateList colorStateList, boolean z11, PorterDuff.Mode mode) { Drawable drawable = checkableImageButton.getDrawable(); if (drawable != null && (z10 || z11)) { drawable = r.c.r(drawable).mutate(); if (z10) { r.c.o(drawable, colorStateList); } if (z11) { r.c.p(drawable, mode); } } if (checkableImageButton.getDrawable() != drawable) { checkableImageButton.setImageDrawable(drawable); } } private void k() { j(this.F, this.H, this.G, this.J, this.I); } private void l() { int i10 = this.f4692u; if (i10 == 0) { this.f4684q = null; this.f4686r = null; return; } if (i10 == 1) { this.f4684q = new p3.g(this.f4688s); this.f4686r = new p3.g(); } else { if (i10 != 2) { throw new IllegalArgumentException(this.f4692u + " is illegal; only @BoxBackgroundMode constants are supported."); } if (!this.f4678n || (this.f4684q instanceof com.google.android.material.textfield.c)) { this.f4684q = new p3.g(this.f4688s); } else { this.f4684q = new com.google.android.material.textfield.c(this.f4688s); } this.f4686r = null; } } private int m() { return this.f4692u == 1 ? g3.a.e(g3.a.d(this, c3.a.f3454j, 0), this.A) : this.A; } private Rect n(Rect rect) { EditText editText = this.f4656c; if (editText == null) { throw new IllegalStateException(); } Rect rect2 = this.C; rect2.bottom = rect.bottom; int i10 = this.f4692u; if (i10 == 1) { rect2.left = rect.left + editText.getCompoundPaddingLeft(); rect2.top = rect.top + this.f4694v; rect2.right = rect.right - this.f4656c.getCompoundPaddingRight(); return rect2; } if (i10 != 2) { rect2.left = rect.left + editText.getCompoundPaddingLeft(); rect2.top = getPaddingTop(); rect2.right = rect.right - this.f4656c.getCompoundPaddingRight(); return rect2; } rect2.left = rect.left + editText.getPaddingLeft(); rect2.top = rect.top - r(); rect2.right = rect.right - this.f4656c.getPaddingRight(); return rect2; } private int o(Rect rect, Rect rect2, float f10) { return this.f4692u == 1 ? (int) (rect2.top + f10) : rect.bottom - this.f4656c.getCompoundPaddingBottom(); } private int p(Rect rect, float f10) { return H() ? (int) (rect.centerY() - (f10 / 2.0f)) : rect.top + this.f4656c.getCompoundPaddingTop(); } private Rect q(Rect rect) { if (this.f4656c == null) { throw new IllegalStateException(); } Rect rect2 = this.C; float q10 = this.f4685q0.q(); rect2.left = rect.left + this.f4656c.getCompoundPaddingLeft(); rect2.top = p(rect, q10); rect2.right = rect.right - this.f4656c.getCompoundPaddingRight(); rect2.bottom = o(rect, rect2, q10); return rect2; } private int r() { float m10; if (!this.f4678n) { return 0; } int i10 = this.f4692u; if (i10 == 0 || i10 == 1) { m10 = this.f4685q0.m(); } else { if (i10 != 2) { return 0; } m10 = this.f4685q0.m() / 2.0f; } return (int) m10; } private boolean s() { return this.f4692u == 2 && t(); } private void setEditText(EditText editText) { if (this.f4656c != null) { throw new IllegalArgumentException("We already have an EditText, can only have one"); } if (this.N != 3 && !(editText instanceof TextInputEditText)) { Log.i("TextInputLayout", "EditText added is not a TextInputEditText. Please switch to using that class instead."); } this.f4656c = editText; J(); setTextInputAccessibilityDelegate(new e(this)); this.f4685q0.U(this.f4656c.getTypeface()); this.f4685q0.M(this.f4656c.getTextSize()); int gravity = this.f4656c.getGravity(); this.f4685q0.F((gravity & (-113)) | 48); this.f4685q0.L(gravity); this.f4656c.addTextChangedListener(new a()); if (this.f4665g0 == null) { this.f4665g0 = this.f4656c.getHintTextColors(); } if (this.f4678n) { if (TextUtils.isEmpty(this.f4680o)) { CharSequence hint = this.f4656c.getHint(); this.f4658d = hint; setHint(hint); this.f4656c.setHint((CharSequence) null); } this.f4682p = true; } if (this.f4668i != null) { V(this.f4656c.getText().length()); } Y(); this.f4660e.e(); this.F.bringToFront(); this.f4654b.bringToFront(); this.f4661e0.bringToFront(); x(); d0(false, true); } private void setErrorIconVisible(boolean z10) { this.f4661e0.setVisibility(z10 ? 0 : 8); this.f4654b.setVisibility(z10 ? 8 : 0); if (C()) { return; } a0(); } private void setHintInternal(CharSequence charSequence) { if (TextUtils.equals(charSequence, this.f4680o)) { return; } this.f4680o = charSequence; this.f4685q0.S(charSequence); if (this.f4683p0) { return; } K(); } private boolean t() { return this.f4695w > -1 && this.f4698z != 0; } private void u() { if (w()) { ((com.google.android.material.textfield.c) this.f4684q).f0(); } } private void v(boolean z10) { ValueAnimator valueAnimator = this.f4689s0; if (valueAnimator != null && valueAnimator.isRunning()) { this.f4689s0.cancel(); } if (z10 && this.f4687r0) { e(1.0f); } else { this.f4685q0.O(1.0f); } this.f4683p0 = false; if (w()) { K(); } } private boolean w() { return this.f4678n && !TextUtils.isEmpty(this.f4680o) && (this.f4684q instanceof com.google.android.material.textfield.c); } private void x() { Iterator it = this.M.iterator(); while (it.hasNext()) { ((f) it.next()).a(this); } } private void y(int i10) { Iterator it = this.Q.iterator(); while (it.hasNext()) { ((g) it.next()).a(this, i10); } } private void z(Canvas canvas) { p3.g gVar = this.f4686r; if (gVar != null) { Rect bounds = gVar.getBounds(); bounds.top = bounds.bottom - this.f4695w; this.f4686r.draw(canvas); } } public boolean E() { return this.f4654b.getVisibility() == 0 && this.P.getVisibility() == 0; } public boolean F() { return this.f4660e.w(); } boolean G() { return this.f4682p; } public boolean I() { return this.F.getVisibility() == 0; } /* JADX WARN: Code restructure failed: missing block: B:7:0x0015, code lost: if (r3.getTextColors().getDefaultColor() == (-65281)) goto L11; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ void Q(android.widget.TextView r3, int r4) { /* r2 = this; r0 = 1 androidx.core.widget.t.n(r3, r4) // Catch: java.lang.Exception -> L1b int r4 = android.os.Build.VERSION.SDK_INT // Catch: java.lang.Exception -> L1b r1 = 23 if (r4 < r1) goto L18 android.content.res.ColorStateList r4 = r3.getTextColors() // Catch: java.lang.Exception -> L1b int r4 = r4.getDefaultColor() // Catch: java.lang.Exception -> L1b r1 = -65281(0xffffffffffff00ff, float:NaN) if (r4 != r1) goto L18 goto L1c L18: r4 = 0 r0 = 0 goto L1c L1b: L1c: if (r0 == 0) goto L30 int r4 = c3.i.f3551a androidx.core.widget.t.n(r3, r4) android.content.Context r4 = r2.getContext() int r0 = c3.b.f3467a int r4 = androidx.core.content.a.getColor(r4, r0) r3.setTextColor(r4) L30: return */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.textfield.TextInputLayout.Q(android.widget.TextView, int):void"); } void V(int i10) { boolean z10 = this.f4666h; if (this.f4664g == -1) { this.f4668i.setText(String.valueOf(i10)); this.f4668i.setContentDescription(null); this.f4666h = false; } else { if (n0.o(this.f4668i) == 1) { n0.p0(this.f4668i, 0); } this.f4666h = i10 > this.f4664g; W(getContext(), this.f4668i, i10, this.f4664g, this.f4666h); if (z10 != this.f4666h) { X(); if (this.f4666h) { n0.p0(this.f4668i, 1); } } this.f4668i.setText(getContext().getString(c3.h.f3538c, Integer.valueOf(i10), Integer.valueOf(this.f4664g))); } if (this.f4656c == null || z10 == this.f4666h) { return; } c0(false); e0(); Y(); } void Y() { Drawable background; TextView textView; EditText editText = this.f4656c; if (editText == null || this.f4692u != 0 || (background = editText.getBackground()) == null) { return; } if (j1.a(background)) { background = background.mutate(); } if (this.f4660e.k()) { background.setColorFilter(j.e(this.f4660e.n(), PorterDuff.Mode.SRC_IN)); } else if (this.f4666h && (textView = this.f4668i) != null) { background.setColorFilter(j.e(textView.getCurrentTextColor(), PorterDuff.Mode.SRC_IN)); } else { r.c.c(background); this.f4656c.refreshDrawableState(); } } @Override // android.view.ViewGroup public void addView(View view, int i10, ViewGroup.LayoutParams layoutParams) { if (!(view instanceof EditText)) { super.addView(view, i10, layoutParams); return; } FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(layoutParams); layoutParams2.gravity = (layoutParams2.gravity & (-113)) | 16; this.f4652a.addView(view, layoutParams2); this.f4652a.setLayoutParams(layoutParams); b0(); setEditText((EditText) view); } public void c(f fVar) { this.M.add(fVar); if (this.f4656c != null) { fVar.a(this); } } void c0(boolean z10) { d0(z10, false); } public void d(g gVar) { this.Q.add(gVar); } @Override // android.view.ViewGroup, android.view.View public void dispatchProvideAutofillStructure(ViewStructure viewStructure, int i10) { EditText editText; if (this.f4658d == null || (editText = this.f4656c) == null) { super.dispatchProvideAutofillStructure(viewStructure, i10); return; } boolean z10 = this.f4682p; this.f4682p = false; CharSequence hint = editText.getHint(); this.f4656c.setHint(this.f4658d); try { super.dispatchProvideAutofillStructure(viewStructure, i10); } finally { this.f4656c.setHint(hint); this.f4682p = z10; } } @Override // android.view.ViewGroup, android.view.View protected void dispatchRestoreInstanceState(SparseArray sparseArray) { this.f4693u0 = true; super.dispatchRestoreInstanceState(sparseArray); this.f4693u0 = false; } @Override // android.view.View public void draw(Canvas canvas) { super.draw(canvas); A(canvas); z(canvas); } @Override // android.view.ViewGroup, android.view.View protected void drawableStateChanged() { if (this.f4691t0) { return; } this.f4691t0 = true; super.drawableStateChanged(); int[] drawableState = getDrawableState(); com.google.android.material.internal.a aVar = this.f4685q0; boolean R = aVar != null ? aVar.R(drawableState) | false : false; c0(n0.R(this) && isEnabled()); Y(); e0(); if (R) { invalidate(); } this.f4691t0 = false; } void e(float f10) { if (this.f4685q0.r() == f10) { return; } if (this.f4689s0 == null) { ValueAnimator valueAnimator = new ValueAnimator(); this.f4689s0 = valueAnimator; valueAnimator.setInterpolator(d3.a.f9106b); this.f4689s0.setDuration(167L); this.f4689s0.addUpdateListener(new d()); } this.f4689s0.setFloatValues(this.f4685q0.r(), f10); this.f4689s0.start(); } void e0() { TextView textView; EditText editText; EditText editText2; if (this.f4684q == null || this.f4692u == 0) { return; } boolean z10 = false; boolean z11 = isFocused() || ((editText2 = this.f4656c) != null && editText2.hasFocus()); boolean z12 = isHovered() || ((editText = this.f4656c) != null && editText.isHovered()); if (!isEnabled()) { this.f4698z = this.f4681o0; } else if (this.f4660e.k()) { this.f4698z = this.f4660e.n(); } else if (this.f4666h && (textView = this.f4668i) != null) { this.f4698z = textView.getCurrentTextColor(); } else if (z11) { this.f4698z = this.f4673k0; } else if (z12) { this.f4698z = this.f4671j0; } else { this.f4698z = this.f4669i0; } S(this.f4660e.k() && getEndIconDelegate().c()); if (getErrorIconDrawable() != null && this.f4660e.v() && this.f4660e.k()) { z10 = true; } setErrorIconVisible(z10); if ((z12 || z11) && isEnabled()) { this.f4695w = this.f4697y; } else { this.f4695w = this.f4696x; } if (this.f4692u == 1) { if (!isEnabled()) { this.A = this.f4677m0; } else if (z12) { this.A = this.f4679n0; } else { this.A = this.f4675l0; } } f(); } @Override // android.widget.LinearLayout, android.view.View public int getBaseline() { EditText editText = this.f4656c; return editText != null ? editText.getBaseline() + getPaddingTop() + r() : super.getBaseline(); } p3.g getBoxBackground() { int i10 = this.f4692u; if (i10 == 1 || i10 == 2) { return this.f4684q; } throw new IllegalStateException(); } public int getBoxBackgroundColor() { return this.A; } public int getBoxBackgroundMode() { return this.f4692u; } public float getBoxCornerRadiusBottomEnd() { return this.f4684q.r(); } public float getBoxCornerRadiusBottomStart() { return this.f4684q.s(); } public float getBoxCornerRadiusTopEnd() { return this.f4684q.D(); } public float getBoxCornerRadiusTopStart() { return this.f4684q.C(); } public int getBoxStrokeColor() { return this.f4673k0; } public int getCounterMaxLength() { return this.f4664g; } CharSequence getCounterOverflowDescription() { TextView textView; if (this.f4662f && this.f4666h && (textView = this.f4668i) != null) { return textView.getContentDescription(); } return null; } public ColorStateList getCounterOverflowTextColor() { return this.f4674l; } public ColorStateList getCounterTextColor() { return this.f4674l; } public ColorStateList getDefaultHintTextColor() { return this.f4665g0; } public EditText getEditText() { return this.f4656c; } public CharSequence getEndIconContentDescription() { return this.P.getContentDescription(); } public Drawable getEndIconDrawable() { return this.P.getDrawable(); } public int getEndIconMode() { return this.N; } CheckableImageButton getEndIconView() { return this.P; } public CharSequence getError() { if (this.f4660e.v()) { return this.f4660e.m(); } return null; } public int getErrorCurrentTextColors() { return this.f4660e.n(); } public Drawable getErrorIconDrawable() { return this.f4661e0.getDrawable(); } final int getErrorTextCurrentColor() { return this.f4660e.n(); } public CharSequence getHelperText() { if (this.f4660e.w()) { return this.f4660e.p(); } return null; } public int getHelperTextCurrentTextColor() { return this.f4660e.q(); } public CharSequence getHint() { if (this.f4678n) { return this.f4680o; } return null; } final float getHintCollapsedTextHeight() { return this.f4685q0.m(); } final int getHintCurrentCollapsedTextColor() { return this.f4685q0.n(); } public ColorStateList getHintTextColor() { return this.f4667h0; } @Deprecated public CharSequence getPasswordVisibilityToggleContentDescription() { return this.P.getContentDescription(); } @Deprecated public Drawable getPasswordVisibilityToggleDrawable() { return this.P.getDrawable(); } public CharSequence getStartIconContentDescription() { return this.F.getContentDescription(); } public Drawable getStartIconDrawable() { return this.F.getDrawable(); } public Typeface getTypeface() { return this.E; } @Override // android.widget.LinearLayout, android.view.ViewGroup, android.view.View protected void onLayout(boolean z10, int i10, int i11, int i12, int i13) { super.onLayout(z10, i10, i11, i12, i13); EditText editText = this.f4656c; if (editText != null) { Rect rect = this.B; com.google.android.material.internal.b.a(this, editText, rect); T(rect); if (this.f4678n) { this.f4685q0.C(n(rect)); this.f4685q0.J(q(rect)); this.f4685q0.z(); if (!w() || this.f4683p0) { return; } K(); } } } @Override // android.widget.LinearLayout, android.view.View protected void onMeasure(int i10, int i11) { super.onMeasure(i10, i11); boolean Z = Z(); boolean a02 = a0(); if (Z || a02) { this.f4656c.post(new c()); } } @Override // android.view.View protected void onRestoreInstanceState(Parcelable parcelable) { if (!(parcelable instanceof h)) { super.onRestoreInstanceState(parcelable); return; } h hVar = (h) parcelable; super.onRestoreInstanceState(hVar.a()); setError(hVar.f4704c); if (hVar.f4705d) { this.P.post(new b()); } requestLayout(); } @Override // android.view.View public Parcelable onSaveInstanceState() { h hVar = new h(super.onSaveInstanceState()); if (this.f4660e.k()) { hVar.f4704c = getError(); } hVar.f4705d = C() && this.P.isChecked(); return hVar; } public void setBoxBackgroundColor(int i10) { if (this.A != i10) { this.A = i10; this.f4675l0 = i10; f(); } } public void setBoxBackgroundColorResource(int i10) { setBoxBackgroundColor(androidx.core.content.a.getColor(getContext(), i10)); } public void setBoxBackgroundMode(int i10) { if (i10 == this.f4692u) { return; } this.f4692u = i10; if (this.f4656c != null) { J(); } } public void setBoxStrokeColor(int i10) { if (this.f4673k0 != i10) { this.f4673k0 = i10; e0(); } } public void setCounterEnabled(boolean z10) { if (this.f4662f != z10) { if (z10) { r0 r0Var = new r0(getContext()); this.f4668i = r0Var; r0Var.setId(c3.e.f3521u); Typeface typeface = this.E; if (typeface != null) { this.f4668i.setTypeface(typeface); } this.f4668i.setMaxLines(1); this.f4660e.d(this.f4668i, 2); X(); U(); } else { this.f4660e.x(this.f4668i, 2); this.f4668i = null; } this.f4662f = z10; } } public void setCounterMaxLength(int i10) { if (this.f4664g != i10) { if (i10 > 0) { this.f4664g = i10; } else { this.f4664g = -1; } if (this.f4662f) { U(); } } } public void setCounterOverflowTextAppearance(int i10) { if (this.f4670j != i10) { this.f4670j = i10; X(); } } public void setCounterOverflowTextColor(ColorStateList colorStateList) { if (this.f4676m != colorStateList) { this.f4676m = colorStateList; X(); } } public void setCounterTextAppearance(int i10) { if (this.f4672k != i10) { this.f4672k = i10; X(); } } public void setCounterTextColor(ColorStateList colorStateList) { if (this.f4674l != colorStateList) { this.f4674l = colorStateList; X(); } } public void setDefaultHintTextColor(ColorStateList colorStateList) { this.f4665g0 = colorStateList; this.f4667h0 = colorStateList; if (this.f4656c != null) { c0(false); } } @Override // android.view.View public void setEnabled(boolean z10) { L(this, z10); super.setEnabled(z10); } public void setEndIconActivated(boolean z10) { this.P.setActivated(z10); } public void setEndIconCheckable(boolean z10) { this.P.setCheckable(z10); } public void setEndIconContentDescription(int i10) { setEndIconContentDescription(i10 != 0 ? getResources().getText(i10) : null); } public void setEndIconDrawable(int i10) { setEndIconDrawable(i10 != 0 ? e.b.d(getContext(), i10) : null); } public void setEndIconMode(int i10) { int i11 = this.N; this.N = i10; setEndIconVisible(i10 != 0); if (getEndIconDelegate().b(this.f4692u)) { getEndIconDelegate().a(); i(); y(i11); } else { throw new IllegalStateException("The current box background mode " + this.f4692u + " is not supported by the end icon mode " + i10); } } public void setEndIconOnClickListener(View.OnClickListener onClickListener) { O(this.P, onClickListener, this.f4663f0); } public void setEndIconOnLongClickListener(View.OnLongClickListener onLongClickListener) { this.f4663f0 = onLongClickListener; P(this.P, onLongClickListener); } public void setEndIconTintList(ColorStateList colorStateList) { if (this.V != colorStateList) { this.V = colorStateList; this.W = true; i(); } } public void setEndIconTintMode(PorterDuff.Mode mode) { if (this.f4653a0 != mode) { this.f4653a0 = mode; this.f4655b0 = true; i(); } } public void setEndIconVisible(boolean z10) { if (E() != z10) { this.P.setVisibility(z10 ? 0 : 4); a0(); } } public void setError(CharSequence charSequence) { if (!this.f4660e.v()) { if (TextUtils.isEmpty(charSequence)) { return; } else { setErrorEnabled(true); } } if (TextUtils.isEmpty(charSequence)) { this.f4660e.r(); } else { this.f4660e.J(charSequence); } } public void setErrorEnabled(boolean z10) { this.f4660e.z(z10); } public void setErrorIconDrawable(int i10) { setErrorIconDrawable(i10 != 0 ? e.b.d(getContext(), i10) : null); } public void setErrorIconTintList(ColorStateList colorStateList) { Drawable drawable = this.f4661e0.getDrawable(); if (drawable != null) { drawable = r.c.r(drawable).mutate(); r.c.o(drawable, colorStateList); } if (this.f4661e0.getDrawable() != drawable) { this.f4661e0.setImageDrawable(drawable); } } public void setErrorIconTintMode(PorterDuff.Mode mode) { Drawable drawable = this.f4661e0.getDrawable(); if (drawable != null) { drawable = r.c.r(drawable).mutate(); r.c.p(drawable, mode); } if (this.f4661e0.getDrawable() != drawable) { this.f4661e0.setImageDrawable(drawable); } } public void setErrorTextAppearance(int i10) { this.f4660e.A(i10); } public void setErrorTextColor(ColorStateList colorStateList) { this.f4660e.B(colorStateList); } public void setHelperText(CharSequence charSequence) { if (TextUtils.isEmpty(charSequence)) { if (F()) { setHelperTextEnabled(false); } } else { if (!F()) { setHelperTextEnabled(true); } this.f4660e.K(charSequence); } } public void setHelperTextColor(ColorStateList colorStateList) { this.f4660e.E(colorStateList); } public void setHelperTextEnabled(boolean z10) { this.f4660e.D(z10); } public void setHelperTextTextAppearance(int i10) { this.f4660e.C(i10); } public void setHint(CharSequence charSequence) { if (this.f4678n) { setHintInternal(charSequence); sendAccessibilityEvent(2048); } } public void setHintAnimationEnabled(boolean z10) { this.f4687r0 = z10; } public void setHintEnabled(boolean z10) { if (z10 != this.f4678n) { this.f4678n = z10; if (z10) { CharSequence hint = this.f4656c.getHint(); if (!TextUtils.isEmpty(hint)) { if (TextUtils.isEmpty(this.f4680o)) { setHint(hint); } this.f4656c.setHint((CharSequence) null); } this.f4682p = true; } else { this.f4682p = false; if (!TextUtils.isEmpty(this.f4680o) && TextUtils.isEmpty(this.f4656c.getHint())) { this.f4656c.setHint(this.f4680o); } setHintInternal(null); } if (this.f4656c != null) { b0(); } } } public void setHintTextAppearance(int i10) { this.f4685q0.D(i10); this.f4667h0 = this.f4685q0.l(); if (this.f4656c != null) { c0(false); b0(); } } public void setHintTextColor(ColorStateList colorStateList) { if (this.f4667h0 != colorStateList) { if (this.f4665g0 == null) { this.f4685q0.E(colorStateList); } this.f4667h0 = colorStateList; if (this.f4656c != null) { c0(false); } } } @Deprecated public void setPasswordVisibilityToggleContentDescription(int i10) { setPasswordVisibilityToggleContentDescription(i10 != 0 ? getResources().getText(i10) : null); } @Deprecated public void setPasswordVisibilityToggleDrawable(int i10) { setPasswordVisibilityToggleDrawable(i10 != 0 ? e.b.d(getContext(), i10) : null); } @Deprecated public void setPasswordVisibilityToggleEnabled(boolean z10) { if (z10 && this.N != 1) { setEndIconMode(1); } else { if (z10) { return; } setEndIconMode(0); } } @Deprecated public void setPasswordVisibilityToggleTintList(ColorStateList colorStateList) { this.V = colorStateList; this.W = true; i(); } @Deprecated public void setPasswordVisibilityToggleTintMode(PorterDuff.Mode mode) { this.f4653a0 = mode; this.f4655b0 = true; i(); } public void setStartIconCheckable(boolean z10) { this.F.setCheckable(z10); } public void setStartIconContentDescription(int i10) { setStartIconContentDescription(i10 != 0 ? getResources().getText(i10) : null); } public void setStartIconDrawable(int i10) { setStartIconDrawable(i10 != 0 ? e.b.d(getContext(), i10) : null); } public void setStartIconOnClickListener(View.OnClickListener onClickListener) { O(this.F, onClickListener, this.L); } public void setStartIconOnLongClickListener(View.OnLongClickListener onLongClickListener) { this.L = onLongClickListener; P(this.F, onLongClickListener); } public void setStartIconTintList(ColorStateList colorStateList) { if (this.G != colorStateList) { this.G = colorStateList; this.H = true; k(); } } public void setStartIconTintMode(PorterDuff.Mode mode) { if (this.I != mode) { this.I = mode; this.J = true; k(); } } public void setStartIconVisible(boolean z10) { if (I() != z10) { this.F.setVisibility(z10 ? 0 : 8); a0(); } } public void setTextInputAccessibilityDelegate(e eVar) { EditText editText = this.f4656c; if (editText != null) { n0.n0(editText, eVar); } } public void setTypeface(Typeface typeface) { if (typeface != this.E) { this.E = typeface; this.f4685q0.U(typeface); this.f4660e.G(typeface); TextView textView = this.f4668i; if (textView != null) { textView.setTypeface(typeface); } } } /* JADX WARN: Illegal instructions before constructor call */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public TextInputLayout(android.content.Context r23, android.util.AttributeSet r24, int r25) { /* Method dump skipped, instructions count: 1166 To view this dump change 'Code comments level' option to 'DEBUG' */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.textfield.TextInputLayout.(android.content.Context, android.util.AttributeSet, int):void"); } public void setEndIconContentDescription(CharSequence charSequence) { if (getEndIconContentDescription() != charSequence) { this.P.setContentDescription(charSequence); } } public void setEndIconDrawable(Drawable drawable) { this.P.setImageDrawable(drawable); } public void setErrorIconDrawable(Drawable drawable) { this.f4661e0.setImageDrawable(drawable); setErrorIconVisible(drawable != null && this.f4660e.v()); } public void setStartIconContentDescription(CharSequence charSequence) { if (getStartIconContentDescription() != charSequence) { this.F.setContentDescription(charSequence); } } public void setStartIconDrawable(Drawable drawable) { this.F.setImageDrawable(drawable); if (drawable != null) { setStartIconVisible(true); k(); } else { setStartIconVisible(false); setStartIconOnClickListener(null); setStartIconOnLongClickListener(null); setStartIconContentDescription((CharSequence) null); } } @Deprecated public void setPasswordVisibilityToggleContentDescription(CharSequence charSequence) { this.P.setContentDescription(charSequence); } @Deprecated public void setPasswordVisibilityToggleDrawable(Drawable drawable) { this.P.setImageDrawable(drawable); } }