package com.google.android.material.chip;

import android.R;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.InsetDrawable;
import android.graphics.drawable.RippleDrawable;
import android.os.Bundle;
import android.text.TextPaint;
import android.text.TextUtils;
import android.util.Log;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.PointerIcon;
import android.view.View;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
import com.cvte.vman.impl.FwUpgradeManager;
import d.b.g.g;
import d.h.j.i0.c;
import d.h.j.y;
import g.e.a.a.k.b;
import g.e.a.a.t.d;
import g.e.a.a.w.g;
import g.e.a.a.w.j;
import g.e.a.a.w.n;
import java.lang.ref.WeakReference;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;

/* JADX INFO: loaded from: classes.dex */
public class Chip extends g implements b.a, n {

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public static final Rect f1096o = new Rect();

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public static final int[] f1097p = {R.attr.state_selected};

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public static final int[] f1098q = {R.attr.state_checkable};
    public boolean A;
    public int B;
    public int C;
    public final b D;
    public final Rect E;
    public final RectF F;
    public final d G;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public g.e.a.a.k.b f1099r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public InsetDrawable f1100s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public RippleDrawable f1101t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public View.OnClickListener f1102u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public CompoundButton.OnCheckedChangeListener f1103v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public boolean f1104w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public boolean f1105x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public boolean f1106y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public boolean f1107z;

    public class a extends d {
        public a() {
        }

        @Override // g.e.a.a.t.d
        public void a(int i2) {
        }

        @Override // g.e.a.a.t.d
        public void b(Typeface typeface, boolean z2) {
            Chip chip = Chip.this;
            g.e.a.a.k.b bVar = chip.f1099r;
            chip.setText(bVar.R0 ? bVar.S : chip.getText());
            Chip.this.requestLayout();
            Chip.this.invalidate();
        }
    }

    public class b extends d.j.b.a {
        public b(Chip chip) {
            super(chip);
        }

        @Override // d.j.b.a
        public void m(List<Integer> list) {
            boolean z2 = false;
            list.add(0);
            Chip chip = Chip.this;
            Rect rect = Chip.f1096o;
            if (chip.e()) {
                Chip chip2 = Chip.this;
                g.e.a.a.k.b bVar = chip2.f1099r;
                if (bVar != null && bVar.Y) {
                    z2 = true;
                }
                if (!z2 || chip2.f1102u == null) {
                    return;
                }
                list.add(1);
            }
        }

        @Override // d.j.b.a
        public boolean p(int i2, int i3, Bundle bundle) {
            boolean z2 = false;
            if (i3 == 16) {
                if (i2 == 0) {
                    return Chip.this.performClick();
                }
                if (i2 == 1) {
                    Chip chip = Chip.this;
                    chip.playSoundEffect(0);
                    View.OnClickListener onClickListener = chip.f1102u;
                    if (onClickListener != null) {
                        onClickListener.onClick(chip);
                        z2 = true;
                    }
                    chip.D.u(1, 1);
                }
            }
            return z2;
        }

        @Override // d.j.b.a
        public void q(c cVar) {
            cVar.a.setCheckable(Chip.this.f());
            cVar.a.setClickable(Chip.this.isClickable());
            if (Chip.this.f() || Chip.this.isClickable()) {
                cVar.a.setClassName(Chip.this.f() ? "android.widget.CompoundButton" : "android.widget.Button");
            } else {
                cVar.a.setClassName("android.view.View");
            }
            cVar.a.setText(Chip.this.getText());
        }

        @Override // d.j.b.a
        public void r(int i2, c cVar) {
            if (i2 != 1) {
                cVar.a.setContentDescription("");
                cVar.a.setBoundsInParent(Chip.f1096o);
                return;
            }
            CharSequence closeIconContentDescription = Chip.this.getCloseIconContentDescription();
            if (closeIconContentDescription == null) {
                CharSequence text = Chip.this.getText();
                Context context = Chip.this.getContext();
                Object[] objArr = new Object[1];
                objArr[0] = TextUtils.isEmpty(text) ? "" : text;
                closeIconContentDescription = context.getString(com.ifpdos.udi.service.core.pc.R.string.mtrl_chip_close_icon_content_description, objArr).trim();
            }
            cVar.a.setContentDescription(closeIconContentDescription);
            cVar.a.setBoundsInParent(Chip.this.getCloseIconTouchBoundsInt());
            cVar.a(c.a.a);
            cVar.a.setEnabled(Chip.this.isEnabled());
        }

        @Override // d.j.b.a
        public void s(int i2, boolean z2) {
            if (i2 == 1) {
                Chip chip = Chip.this;
                chip.f1107z = z2;
                chip.refreshDrawableState();
            }
        }

        public int w(float f2, float f3) {
            Chip chip = Chip.this;
            Rect rect = Chip.f1096o;
            return (chip.e() && Chip.this.getCloseIconTouchBounds().contains(f2, f3)) ? 1 : 0;
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:58:0x0184  */
    /* JADX WARN: Removed duplicated region for block: B:75:0x0219  */
    /* JADX WARN: Removed duplicated region for block: B:78:0x030a  */
    /* JADX WARN: Removed duplicated region for block: B:81:0x032a  */
    /* JADX WARN: Removed duplicated region for block: B:84:0x033d  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public Chip(android.content.Context r19, android.util.AttributeSet r20) {
        /*
            Method dump skipped, instruction units count: 877
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.chip.Chip.<init>(android.content.Context, android.util.AttributeSet):void");
    }

    /* JADX INFO: Access modifiers changed from: private */
    public RectF getCloseIconTouchBounds() {
        this.F.setEmpty();
        if (e() && this.f1102u != null) {
            g.e.a.a.k.b bVar = this.f1099r;
            bVar.B(bVar.getBounds(), this.F);
        }
        return this.F;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public Rect getCloseIconTouchBoundsInt() {
        RectF closeIconTouchBounds = getCloseIconTouchBounds();
        this.E.set((int) closeIconTouchBounds.left, (int) closeIconTouchBounds.top, (int) closeIconTouchBounds.right, (int) closeIconTouchBounds.bottom);
        return this.E;
    }

    private g.e.a.a.t.b getTextAppearance() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.y0.f3808f;
        }
        return null;
    }

    private void setCloseIconHovered(boolean z2) {
        if (this.f1106y != z2) {
            this.f1106y = z2;
            refreshDrawableState();
        }
    }

    private void setCloseIconPressed(boolean z2) {
        if (this.f1105x != z2) {
            this.f1105x = z2;
            refreshDrawableState();
        }
    }

    @Override // g.e.a.a.k.b.a
    public void a() {
        d(this.C);
        requestLayout();
        invalidateOutline();
    }

    /* JADX WARN: Removed duplicated region for block: B:34:0x006f  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public boolean d(int r10) {
        /*
            r9 = this;
            r9.C = r10
            boolean r0 = r9.A
            r1 = 0
            if (r0 != 0) goto L15
            android.graphics.drawable.InsetDrawable r10 = r9.f1100s
            if (r10 == 0) goto Lf
            r9.g()
            goto L14
        Lf:
            int[] r10 = g.e.a.a.u.a.a
            r9.i()
        L14:
            return r1
        L15:
            g.e.a.a.k.b r0 = r9.f1099r
            float r0 = r0.N
            int r0 = (int) r0
            int r0 = r10 - r0
            int r0 = java.lang.Math.max(r1, r0)
            g.e.a.a.k.b r2 = r9.f1099r
            int r2 = r2.getIntrinsicWidth()
            int r2 = r10 - r2
            int r2 = java.lang.Math.max(r1, r2)
            if (r2 > 0) goto L3e
            if (r0 > 0) goto L3e
            android.graphics.drawable.InsetDrawable r10 = r9.f1100s
            if (r10 == 0) goto L38
            r9.g()
            goto L3d
        L38:
            int[] r10 = g.e.a.a.u.a.a
            r9.i()
        L3d:
            return r1
        L3e:
            if (r2 <= 0) goto L44
            int r2 = r2 / 2
            r7 = r2
            goto L45
        L44:
            r7 = r1
        L45:
            if (r0 <= 0) goto L49
            int r1 = r0 / 2
        L49:
            r8 = r1
            android.graphics.drawable.InsetDrawable r0 = r9.f1100s
            r1 = 1
            if (r0 == 0) goto L6f
            android.graphics.Rect r0 = new android.graphics.Rect
            r0.<init>()
            android.graphics.drawable.InsetDrawable r2 = r9.f1100s
            r2.getPadding(r0)
            int r2 = r0.top
            if (r2 != r8) goto L6f
            int r2 = r0.bottom
            if (r2 != r8) goto L6f
            int r2 = r0.left
            if (r2 != r7) goto L6f
            int r0 = r0.right
            if (r0 != r7) goto L6f
        L69:
            int[] r10 = g.e.a.a.u.a.a
            r9.i()
            return r1
        L6f:
            int r0 = r9.getMinHeight()
            if (r0 == r10) goto L78
            r9.setMinHeight(r10)
        L78:
            int r0 = r9.getMinWidth()
            if (r0 == r10) goto L81
            r9.setMinWidth(r10)
        L81:
            android.graphics.drawable.InsetDrawable r10 = new android.graphics.drawable.InsetDrawable
            g.e.a.a.k.b r4 = r9.f1099r
            r3 = r10
            r5 = r7
            r6 = r8
            r3.<init>(r4, r5, r6, r7, r8)
            r9.f1100s = r10
            goto L69
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.chip.Chip.d(int):boolean");
    }

    /* JADX WARN: Removed duplicated region for block: B:16:0x0051  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x00a6  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public boolean dispatchHoverEvent(android.view.MotionEvent r10) {
        /*
            r9 = this;
            java.lang.Class<d.j.b.a> r0 = d.j.b.a.class
            int r1 = r10.getAction()
            r2 = -2147483648(0xffffffff80000000, float:-0.0)
            r3 = 10
            r4 = 1
            r5 = 0
            if (r1 != r3) goto L51
            java.lang.String r1 = "p"
            java.lang.reflect.Field r1 = r0.getDeclaredField(r1)     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            r1.setAccessible(r4)     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            com.google.android.material.chip.Chip$b r6 = r9.D     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            java.lang.Object r1 = r1.get(r6)     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            java.lang.Integer r1 = (java.lang.Integer) r1     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            int r1 = r1.intValue()     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            if (r1 == r2) goto L51
            java.lang.String r1 = "v"
            java.lang.Class[] r6 = new java.lang.Class[r4]     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            java.lang.Class r7 = java.lang.Integer.TYPE     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            r6[r5] = r7     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            java.lang.reflect.Method r0 = r0.getDeclaredMethod(r1, r6)     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            r0.setAccessible(r4)     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            com.google.android.material.chip.Chip$b r1 = r9.D     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            java.lang.Object[] r6 = new java.lang.Object[r4]     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            java.lang.Integer r7 = java.lang.Integer.valueOf(r2)     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            r6[r5] = r7     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            r0.invoke(r1, r6)     // Catch: java.lang.NoSuchFieldException -> L43 java.lang.reflect.InvocationTargetException -> L45 java.lang.IllegalAccessException -> L47 java.lang.NoSuchMethodException -> L49
            r0 = r4
            goto L52
        L43:
            r0 = move-exception
            goto L4a
        L45:
            r0 = move-exception
            goto L4a
        L47:
            r0 = move-exception
            goto L4a
        L49:
            r0 = move-exception
        L4a:
            java.lang.String r1 = "Chip"
            java.lang.String r6 = "Unable to send Accessibility Exit event"
            android.util.Log.e(r1, r6, r0)
        L51:
            r0 = r5
        L52:
            if (r0 != 0) goto Lb1
            com.google.android.material.chip.Chip$b r0 = r9.D
            android.view.accessibility.AccessibilityManager r1 = r0.f2854k
            boolean r1 = r1.isEnabled()
            if (r1 == 0) goto La6
            android.view.accessibility.AccessibilityManager r1 = r0.f2854k
            boolean r1 = r1.isTouchExplorationEnabled()
            if (r1 != 0) goto L67
            goto La6
        L67:
            int r1 = r10.getAction()
            r6 = 7
            r7 = 256(0x100, float:3.59E-43)
            r8 = 128(0x80, float:1.8E-43)
            if (r1 == r6) goto L89
            r6 = 9
            if (r1 == r6) goto L89
            if (r1 == r3) goto L79
            goto La6
        L79:
            int r1 = r0.f2859p
            if (r1 == r2) goto La6
            if (r1 != r2) goto L80
            goto La4
        L80:
            r0.f2859p = r2
            r0.u(r2, r8)
            r0.u(r1, r7)
            goto La4
        L89:
            float r1 = r10.getX()
            float r3 = r10.getY()
            int r1 = r0.w(r1, r3)
            int r3 = r0.f2859p
            if (r3 != r1) goto L9a
            goto La2
        L9a:
            r0.f2859p = r1
            r0.u(r1, r8)
            r0.u(r3, r7)
        La2:
            if (r1 == r2) goto La6
        La4:
            r0 = r4
            goto La7
        La6:
            r0 = r5
        La7:
            if (r0 != 0) goto Lb1
            boolean r10 = super.dispatchHoverEvent(r10)
            if (r10 == 0) goto Lb0
            goto Lb1
        Lb0:
            r4 = r5
        Lb1:
            return r4
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.chip.Chip.dispatchHoverEvent(android.view.MotionEvent):boolean");
    }

    /* JADX WARN: Removed duplicated region for block: B:27:0x004e  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public boolean dispatchKeyEvent(android.view.KeyEvent r10) {
        /*
            r9 = this;
            com.google.android.material.chip.Chip$b r0 = r9.D
            java.util.Objects.requireNonNull(r0)
            int r1 = r10.getAction()
            r2 = 1
            r3 = 0
            r4 = -2147483648(0xffffffff80000000, float:-0.0)
            if (r1 == r2) goto L7b
            int r1 = r10.getKeyCode()
            r5 = 61
            r6 = 0
            if (r1 == r5) goto L65
            r5 = 66
            if (r1 == r5) goto L4e
            switch(r1) {
                case 19: goto L20;
                case 20: goto L20;
                case 21: goto L20;
                case 22: goto L20;
                case 23: goto L4e;
                default: goto L1f;
            }
        L1f:
            goto L7b
        L20:
            boolean r7 = r10.hasNoModifiers()
            if (r7 == 0) goto L7b
            r7 = 19
            if (r1 == r7) goto L38
            r7 = 21
            if (r1 == r7) goto L35
            r7 = 22
            if (r1 == r7) goto L3a
            r5 = 130(0x82, float:1.82E-43)
            goto L3a
        L35:
            r5 = 17
            goto L3a
        L38:
            r5 = 33
        L3a:
            int r1 = r10.getRepeatCount()
            int r1 = r1 + r2
            r7 = r3
        L40:
            if (r3 >= r1) goto L4c
            boolean r8 = r0.n(r5, r6)
            if (r8 == 0) goto L4c
            int r3 = r3 + 1
            r7 = r2
            goto L40
        L4c:
            r3 = r7
            goto L7b
        L4e:
            boolean r1 = r10.hasNoModifiers()
            if (r1 == 0) goto L7b
            int r1 = r10.getRepeatCount()
            if (r1 != 0) goto L7b
            int r1 = r0.f2858o
            if (r1 == r4) goto L63
            r3 = 16
            r0.p(r1, r3, r6)
        L63:
            r3 = r2
            goto L7b
        L65:
            boolean r1 = r10.hasNoModifiers()
            if (r1 == 0) goto L71
            r1 = 2
            boolean r3 = r0.n(r1, r6)
            goto L7b
        L71:
            boolean r1 = r10.hasModifiers(r2)
            if (r1 == 0) goto L7b
            boolean r3 = r0.n(r2, r6)
        L7b:
            if (r3 == 0) goto L84
            com.google.android.material.chip.Chip$b r0 = r9.D
            int r0 = r0.f2858o
            if (r0 == r4) goto L84
            return r2
        L84:
            boolean r10 = super.dispatchKeyEvent(r10)
            return r10
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.chip.Chip.dispatchKeyEvent(android.view.KeyEvent):boolean");
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r2v0, types: [boolean, int] */
    @Override // d.b.g.g, android.widget.CompoundButton, android.widget.TextView, android.view.View
    public void drawableStateChanged() {
        super.drawableStateChanged();
        g.e.a.a.k.b bVar = this.f1099r;
        boolean zD0 = false;
        int i2 = 0;
        zD0 = false;
        if (bVar != null && g.e.a.a.k.b.H(bVar.Z)) {
            g.e.a.a.k.b bVar2 = this.f1099r;
            ?? IsEnabled = isEnabled();
            int i3 = IsEnabled;
            if (this.f1107z) {
                i3 = IsEnabled + 1;
            }
            int i4 = i3;
            if (this.f1106y) {
                i4 = i3 + 1;
            }
            int i5 = i4;
            if (this.f1105x) {
                i5 = i4 + 1;
            }
            int i6 = i5;
            if (isChecked()) {
                i6 = i5 + 1;
            }
            int[] iArr = new int[i6];
            if (isEnabled()) {
                iArr[0] = 16842910;
                i2 = 1;
            }
            if (this.f1107z) {
                iArr[i2] = 16842908;
                i2++;
            }
            if (this.f1106y) {
                iArr[i2] = 16843623;
                i2++;
            }
            if (this.f1105x) {
                iArr[i2] = 16842919;
                i2++;
            }
            if (isChecked()) {
                iArr[i2] = 16842913;
            }
            zD0 = bVar2.d0(iArr);
        }
        if (zD0) {
            invalidate();
        }
    }

    public final boolean e() {
        g.e.a.a.k.b bVar = this.f1099r;
        return (bVar == null || bVar.E() == null) ? false : true;
    }

    public boolean f() {
        g.e.a.a.k.b bVar = this.f1099r;
        return bVar != null && bVar.e0;
    }

    public final void g() {
        if (this.f1100s != null) {
            this.f1100s = null;
            setMinWidth(0);
            setMinHeight((int) getChipMinHeight());
            int[] iArr = g.e.a.a.u.a.a;
            i();
        }
    }

    public Drawable getBackgroundDrawable() {
        InsetDrawable insetDrawable = this.f1100s;
        return insetDrawable == null ? this.f1099r : insetDrawable;
    }

    public Drawable getCheckedIcon() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.g0;
        }
        return null;
    }

    public ColorStateList getCheckedIconTint() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.h0;
        }
        return null;
    }

    public ColorStateList getChipBackgroundColor() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.M;
        }
        return null;
    }

    public float getChipCornerRadius() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return Math.max(0.0f, bVar.D());
        }
        return 0.0f;
    }

    public Drawable getChipDrawable() {
        return this.f1099r;
    }

    public float getChipEndPadding() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.r0;
        }
        return 0.0f;
    }

    /* JADX WARN: Multi-variable type inference failed */
    public Drawable getChipIcon() {
        Drawable drawable;
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar == null || (drawable = bVar.U) == 0) {
            return null;
        }
        return drawable instanceof d.h.d.k.d ? ((d.h.d.k.d) drawable).b() : drawable;
    }

    public float getChipIconSize() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.W;
        }
        return 0.0f;
    }

    public ColorStateList getChipIconTint() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.V;
        }
        return null;
    }

    public float getChipMinHeight() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.N;
        }
        return 0.0f;
    }

    public float getChipStartPadding() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.k0;
        }
        return 0.0f;
    }

    public ColorStateList getChipStrokeColor() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.P;
        }
        return null;
    }

    public float getChipStrokeWidth() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.Q;
        }
        return 0.0f;
    }

    @Deprecated
    public CharSequence getChipText() {
        return getText();
    }

    public Drawable getCloseIcon() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.E();
        }
        return null;
    }

    public CharSequence getCloseIconContentDescription() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.f3650d0;
        }
        return null;
    }

    public float getCloseIconEndPadding() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.q0;
        }
        return 0.0f;
    }

    public float getCloseIconSize() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.f3649c0;
        }
        return 0.0f;
    }

    public float getCloseIconStartPadding() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.p0;
        }
        return 0.0f;
    }

    public ColorStateList getCloseIconTint() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.f3648b0;
        }
        return null;
    }

    @Override // android.widget.TextView
    public TextUtils.TruncateAt getEllipsize() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.Q0;
        }
        return null;
    }

    @Override // android.widget.TextView, android.view.View
    public void getFocusedRect(Rect rect) {
        b bVar = this.D;
        if (bVar.f2858o == 1 || bVar.f2857n == 1) {
            rect.set(getCloseIconTouchBoundsInt());
        } else {
            super.getFocusedRect(rect);
        }
    }

    public g.e.a.a.c.g getHideMotionSpec() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.j0;
        }
        return null;
    }

    public float getIconEndPadding() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.m0;
        }
        return 0.0f;
    }

    public float getIconStartPadding() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.l0;
        }
        return 0.0f;
    }

    public ColorStateList getRippleColor() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.R;
        }
        return null;
    }

    public j getShapeAppearanceModel() {
        return this.f1099r.f3851n.a;
    }

    public g.e.a.a.c.g getShowMotionSpec() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.i0;
        }
        return null;
    }

    public float getTextEndPadding() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.o0;
        }
        return 0.0f;
    }

    public float getTextStartPadding() {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            return bVar.n0;
        }
        return 0.0f;
    }

    /* JADX WARN: Removed duplicated region for block: B:14:0x001a  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void h() {
        /*
            r1 = this;
            boolean r0 = r1.e()
            if (r0 == 0) goto L1a
            g.e.a.a.k.b r0 = r1.f1099r
            if (r0 == 0) goto L10
            boolean r0 = r0.Y
            if (r0 == 0) goto L10
            r0 = 1
            goto L11
        L10:
            r0 = 0
        L11:
            if (r0 == 0) goto L1a
            android.view.View$OnClickListener r0 = r1.f1102u
            if (r0 == 0) goto L1a
            com.google.android.material.chip.Chip$b r0 = r1.D
            goto L1b
        L1a:
            r0 = 0
        L1b:
            d.h.j.y.p(r1, r0)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.chip.Chip.h():void");
    }

    public final void i() {
        this.f1101t = new RippleDrawable(g.e.a.a.u.a.a(this.f1099r.R), getBackgroundDrawable(), null);
        this.f1099r.n0(false);
        RippleDrawable rippleDrawable = this.f1101t;
        AtomicInteger atomicInteger = y.a;
        y.c.q(this, rippleDrawable);
        j();
    }

    public final void j() {
        g.e.a.a.k.b bVar;
        if (TextUtils.isEmpty(getText()) || (bVar = this.f1099r) == null) {
            return;
        }
        int iC = (int) (bVar.C() + bVar.r0 + bVar.o0);
        g.e.a.a.k.b bVar2 = this.f1099r;
        int iZ = (int) (bVar2.z() + bVar2.k0 + bVar2.n0);
        if (this.f1100s != null) {
            Rect rect = new Rect();
            this.f1100s.getPadding(rect);
            iZ += rect.left;
            iC += rect.right;
        }
        int paddingTop = getPaddingTop();
        int paddingBottom = getPaddingBottom();
        AtomicInteger atomicInteger = y.a;
        y.d.k(this, iZ, paddingTop, iC, paddingBottom);
    }

    public final void k() {
        TextPaint paint = getPaint();
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            paint.drawableState = bVar.getState();
        }
        g.e.a.a.t.b textAppearance = getTextAppearance();
        if (textAppearance != null) {
            textAppearance.e(getContext(), paint, this.G);
        }
    }

    @Override // android.widget.TextView, android.view.View
    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        g.e.a.a.a.I(this, this.f1099r);
    }

    @Override // android.widget.CompoundButton, android.widget.TextView, android.view.View
    public int[] onCreateDrawableState(int i2) {
        int[] iArrOnCreateDrawableState = super.onCreateDrawableState(i2 + 2);
        if (isChecked()) {
            CheckBox.mergeDrawableStates(iArrOnCreateDrawableState, f1097p);
        }
        if (f()) {
            CheckBox.mergeDrawableStates(iArrOnCreateDrawableState, f1098q);
        }
        return iArrOnCreateDrawableState;
    }

    @Override // android.widget.TextView, android.view.View
    public void onFocusChanged(boolean z2, int i2, Rect rect) {
        super.onFocusChanged(z2, i2, rect);
        b bVar = this.D;
        int i3 = bVar.f2858o;
        if (i3 != Integer.MIN_VALUE) {
            bVar.k(i3);
        }
        if (z2) {
            bVar.n(i2, rect);
        }
    }

    @Override // android.view.View
    public boolean onHoverEvent(MotionEvent motionEvent) {
        boolean zContains;
        int actionMasked = motionEvent.getActionMasked();
        if (actionMasked != 7) {
            if (actionMasked == 10) {
                zContains = false;
            }
            return super.onHoverEvent(motionEvent);
        }
        zContains = getCloseIconTouchBounds().contains(motionEvent.getX(), motionEvent.getY());
        setCloseIconHovered(zContains);
        return super.onHoverEvent(motionEvent);
    }

    @Override // android.view.View
    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
        int i2;
        super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
        accessibilityNodeInfo.setClassName((f() || isClickable()) ? f() ? "android.widget.CompoundButton" : "android.widget.Button" : "android.view.View");
        accessibilityNodeInfo.setCheckable(f());
        accessibilityNodeInfo.setClickable(isClickable());
        if (getParent() instanceof ChipGroup) {
            ChipGroup chipGroup = (ChipGroup) getParent();
            if (chipGroup.f3798n) {
                int i3 = 0;
                int i4 = 0;
                while (true) {
                    if (i3 >= chipGroup.getChildCount()) {
                        i4 = -1;
                        break;
                    }
                    if (chipGroup.getChildAt(i3) instanceof Chip) {
                        if (((Chip) chipGroup.getChildAt(i3)) == this) {
                            break;
                        } else {
                            i4++;
                        }
                    }
                    i3++;
                }
                i2 = i4;
            } else {
                i2 = -1;
            }
            Object tag = getTag(com.ifpdos.udi.service.core.pc.R.id.row_index_key);
            accessibilityNodeInfo.setCollectionItemInfo((AccessibilityNodeInfo.CollectionItemInfo) c.C0035c.a(tag instanceof Integer ? ((Integer) tag).intValue() : -1, 1, i2, 1, false, isChecked()).a);
        }
    }

    @Override // android.widget.Button, android.widget.TextView, android.view.View
    @TargetApi(24)
    public PointerIcon onResolvePointerIcon(MotionEvent motionEvent, int i2) {
        if (getCloseIconTouchBounds().contains(motionEvent.getX(), motionEvent.getY()) && isEnabled()) {
            return PointerIcon.getSystemIcon(getContext(), FwUpgradeManager.TYPE_FW_SXCAM_MC1_32_CAMERA);
        }
        return null;
    }

    @Override // android.widget.TextView, android.view.View
    @TargetApi(17)
    public void onRtlPropertiesChanged(int i2) {
        super.onRtlPropertiesChanged(i2);
        if (this.B != i2) {
            this.B = i2;
            j();
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:8:0x001e, code lost:
    
        if (r0 != 3) goto L25;
     */
    @Override // android.widget.TextView, android.view.View
    @android.annotation.SuppressLint({"ClickableViewAccessibility"})
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public boolean onTouchEvent(android.view.MotionEvent r6) {
        /*
            r5 = this;
            int r0 = r6.getActionMasked()
            android.graphics.RectF r1 = r5.getCloseIconTouchBounds()
            float r2 = r6.getX()
            float r3 = r6.getY()
            boolean r1 = r1.contains(r2, r3)
            r2 = 0
            r3 = 1
            if (r0 == 0) goto L45
            if (r0 == r3) goto L2b
            r4 = 2
            if (r0 == r4) goto L21
            r1 = 3
            if (r0 == r1) goto L40
            goto L4c
        L21:
            boolean r0 = r5.f1105x
            if (r0 == 0) goto L4c
            if (r1 != 0) goto L4a
            r5.setCloseIconPressed(r2)
            goto L4a
        L2b:
            boolean r0 = r5.f1105x
            if (r0 == 0) goto L40
            r5.playSoundEffect(r2)
            android.view.View$OnClickListener r0 = r5.f1102u
            if (r0 == 0) goto L39
            r0.onClick(r5)
        L39:
            com.google.android.material.chip.Chip$b r0 = r5.D
            r0.u(r3, r3)
            r0 = r3
            goto L41
        L40:
            r0 = r2
        L41:
            r5.setCloseIconPressed(r2)
            goto L4d
        L45:
            if (r1 == 0) goto L4c
            r5.setCloseIconPressed(r3)
        L4a:
            r0 = r3
            goto L4d
        L4c:
            r0 = r2
        L4d:
            if (r0 != 0) goto L55
            boolean r6 = super.onTouchEvent(r6)
            if (r6 == 0) goto L56
        L55:
            r2 = r3
        L56:
            return r2
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.chip.Chip.onTouchEvent(android.view.MotionEvent):boolean");
    }

    @Override // android.view.View
    public void setBackground(Drawable drawable) {
        if (drawable == getBackgroundDrawable() || drawable == this.f1101t) {
            super.setBackground(drawable);
        } else {
            Log.w("Chip", "Do not set the background; Chip manages its own background drawable.");
        }
    }

    @Override // android.view.View
    public void setBackgroundColor(int i2) {
        Log.w("Chip", "Do not set the background color; Chip manages its own background drawable.");
    }

    @Override // d.b.g.g, android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        if (drawable == getBackgroundDrawable() || drawable == this.f1101t) {
            super.setBackgroundDrawable(drawable);
        } else {
            Log.w("Chip", "Do not set the background drawable; Chip manages its own background drawable.");
        }
    }

    @Override // d.b.g.g, android.view.View
    public void setBackgroundResource(int i2) {
        Log.w("Chip", "Do not set the background resource; Chip manages its own background drawable.");
    }

    @Override // android.view.View
    public void setBackgroundTintList(ColorStateList colorStateList) {
        Log.w("Chip", "Do not set the background tint list; Chip manages its own background drawable.");
    }

    @Override // android.view.View
    public void setBackgroundTintMode(PorterDuff.Mode mode) {
        Log.w("Chip", "Do not set the background tint mode; Chip manages its own background drawable.");
    }

    public void setCheckable(boolean z2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.K(z2);
        }
    }

    public void setCheckableResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.K(bVar.s0.getResources().getBoolean(i2));
        }
    }

    @Override // android.widget.CompoundButton, android.widget.Checkable
    public void setChecked(boolean z2) {
        CompoundButton.OnCheckedChangeListener onCheckedChangeListener;
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar == null) {
            this.f1104w = z2;
            return;
        }
        if (bVar.e0) {
            boolean zIsChecked = isChecked();
            super.setChecked(z2);
            if (zIsChecked == z2 || (onCheckedChangeListener = this.f1103v) == null) {
                return;
            }
            onCheckedChangeListener.onCheckedChanged(this, z2);
        }
    }

    public void setCheckedIcon(Drawable drawable) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.L(drawable);
        }
    }

    @Deprecated
    public void setCheckedIconEnabled(boolean z2) {
        setCheckedIconVisible(z2);
    }

    @Deprecated
    public void setCheckedIconEnabledResource(int i2) {
        setCheckedIconVisible(i2);
    }

    public void setCheckedIconResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.L(d.b.d.a.a.a(bVar.s0, i2));
        }
    }

    public void setCheckedIconTint(ColorStateList colorStateList) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.M(colorStateList);
        }
    }

    public void setCheckedIconTintResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            Context context = bVar.s0;
            ThreadLocal<TypedValue> threadLocal = d.b.d.a.a.a;
            bVar.M(context.getColorStateList(i2));
        }
    }

    public void setCheckedIconVisible(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.N(bVar.s0.getResources().getBoolean(i2));
        }
    }

    public void setCheckedIconVisible(boolean z2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.N(z2);
        }
    }

    public void setChipBackgroundColor(ColorStateList colorStateList) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar == null || bVar.M == colorStateList) {
            return;
        }
        bVar.M = colorStateList;
        bVar.onStateChange(bVar.getState());
    }

    public void setChipBackgroundColorResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            Context context = bVar.s0;
            ThreadLocal<TypedValue> threadLocal = d.b.d.a.a.a;
            bVar.O(context.getColorStateList(i2));
        }
    }

    @Deprecated
    public void setChipCornerRadius(float f2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.P(f2);
        }
    }

    @Deprecated
    public void setChipCornerRadiusResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.P(bVar.s0.getResources().getDimension(i2));
        }
    }

    public void setChipDrawable(g.e.a.a.k.b bVar) {
        g.e.a.a.k.b bVar2 = this.f1099r;
        if (bVar2 != bVar) {
            if (bVar2 != null) {
                bVar2.P0 = new WeakReference<>(null);
            }
            this.f1099r = bVar;
            bVar.R0 = false;
            Objects.requireNonNull(bVar);
            bVar.P0 = new WeakReference<>(this);
            d(this.C);
        }
    }

    public void setChipEndPadding(float f2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar == null || bVar.r0 == f2) {
            return;
        }
        bVar.r0 = f2;
        bVar.invalidateSelf();
        bVar.I();
    }

    public void setChipEndPaddingResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.Q(bVar.s0.getResources().getDimension(i2));
        }
    }

    public void setChipIcon(Drawable drawable) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.R(drawable);
        }
    }

    @Deprecated
    public void setChipIconEnabled(boolean z2) {
        setChipIconVisible(z2);
    }

    @Deprecated
    public void setChipIconEnabledResource(int i2) {
        setChipIconVisible(i2);
    }

    public void setChipIconResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.R(d.b.d.a.a.a(bVar.s0, i2));
        }
    }

    public void setChipIconSize(float f2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.S(f2);
        }
    }

    public void setChipIconSizeResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.S(bVar.s0.getResources().getDimension(i2));
        }
    }

    public void setChipIconTint(ColorStateList colorStateList) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.T(colorStateList);
        }
    }

    public void setChipIconTintResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            Context context = bVar.s0;
            ThreadLocal<TypedValue> threadLocal = d.b.d.a.a.a;
            bVar.T(context.getColorStateList(i2));
        }
    }

    public void setChipIconVisible(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.U(bVar.s0.getResources().getBoolean(i2));
        }
    }

    public void setChipIconVisible(boolean z2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.U(z2);
        }
    }

    public void setChipMinHeight(float f2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar == null || bVar.N == f2) {
            return;
        }
        bVar.N = f2;
        bVar.invalidateSelf();
        bVar.I();
    }

    public void setChipMinHeightResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.V(bVar.s0.getResources().getDimension(i2));
        }
    }

    public void setChipStartPadding(float f2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar == null || bVar.k0 == f2) {
            return;
        }
        bVar.k0 = f2;
        bVar.invalidateSelf();
        bVar.I();
    }

    public void setChipStartPaddingResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.W(bVar.s0.getResources().getDimension(i2));
        }
    }

    public void setChipStrokeColor(ColorStateList colorStateList) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.X(colorStateList);
        }
    }

    public void setChipStrokeColorResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            Context context = bVar.s0;
            ThreadLocal<TypedValue> threadLocal = d.b.d.a.a.a;
            bVar.X(context.getColorStateList(i2));
        }
    }

    public void setChipStrokeWidth(float f2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.Y(f2);
        }
    }

    public void setChipStrokeWidthResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.Y(bVar.s0.getResources().getDimension(i2));
        }
    }

    @Deprecated
    public void setChipText(CharSequence charSequence) {
        setText(charSequence);
    }

    @Deprecated
    public void setChipTextResource(int i2) {
        setText(getResources().getString(i2));
    }

    public void setCloseIcon(Drawable drawable) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.Z(drawable);
        }
        h();
    }

    public void setCloseIconContentDescription(CharSequence charSequence) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar == null || bVar.f3650d0 == charSequence) {
            return;
        }
        d.h.h.a aVarC = d.h.h.a.c();
        bVar.f3650d0 = aVarC.d(charSequence, aVarC.f2708h, true);
        bVar.invalidateSelf();
    }

    @Deprecated
    public void setCloseIconEnabled(boolean z2) {
        setCloseIconVisible(z2);
    }

    @Deprecated
    public void setCloseIconEnabledResource(int i2) {
        setCloseIconVisible(i2);
    }

    public void setCloseIconEndPadding(float f2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.a0(f2);
        }
    }

    public void setCloseIconEndPaddingResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.a0(bVar.s0.getResources().getDimension(i2));
        }
    }

    public void setCloseIconResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.Z(d.b.d.a.a.a(bVar.s0, i2));
        }
        h();
    }

    public void setCloseIconSize(float f2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.b0(f2);
        }
    }

    public void setCloseIconSizeResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.b0(bVar.s0.getResources().getDimension(i2));
        }
    }

    public void setCloseIconStartPadding(float f2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.c0(f2);
        }
    }

    public void setCloseIconStartPaddingResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.c0(bVar.s0.getResources().getDimension(i2));
        }
    }

    public void setCloseIconTint(ColorStateList colorStateList) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.e0(colorStateList);
        }
    }

    public void setCloseIconTintResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            Context context = bVar.s0;
            ThreadLocal<TypedValue> threadLocal = d.b.d.a.a.a;
            bVar.e0(context.getColorStateList(i2));
        }
    }

    public void setCloseIconVisible(int i2) {
        setCloseIconVisible(getResources().getBoolean(i2));
    }

    public void setCloseIconVisible(boolean z2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.f0(z2);
        }
        h();
    }

    @Override // android.widget.TextView
    public void setCompoundDrawables(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (drawable3 != null) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelative(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (drawable3 != null) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelativeWithIntrinsicBounds(int i2, int i3, int i4, int i5) {
        if (i2 != 0) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (i4 != 0) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawablesRelativeWithIntrinsicBounds(i2, i3, i4, i5);
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelativeWithIntrinsicBounds(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (drawable3 != null) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesWithIntrinsicBounds(int i2, int i3, int i4, int i5) {
        if (i2 != 0) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (i4 != 0) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawablesWithIntrinsicBounds(i2, i3, i4, i5);
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesWithIntrinsicBounds(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set left drawable using R.attr#chipIcon.");
        }
        if (drawable3 != null) {
            throw new UnsupportedOperationException("Please set right drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawablesWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
    }

    @Override // android.view.View
    public void setElevation(float f2) {
        super.setElevation(f2);
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            g.b bVar2 = bVar.f3851n;
            if (bVar2.f3877o != f2) {
                bVar2.f3877o = f2;
                bVar.w();
            }
        }
    }

    @Override // android.widget.TextView
    public void setEllipsize(TextUtils.TruncateAt truncateAt) {
        if (this.f1099r == null) {
            return;
        }
        if (truncateAt == TextUtils.TruncateAt.MARQUEE) {
            throw new UnsupportedOperationException("Text within a chip are not allowed to scroll.");
        }
        super.setEllipsize(truncateAt);
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.Q0 = truncateAt;
        }
    }

    public void setEnsureMinTouchTargetSize(boolean z2) {
        this.A = z2;
        d(this.C);
    }

    @Override // android.widget.TextView
    public void setGravity(int i2) {
        if (i2 != 8388627) {
            Log.w("Chip", "Chip text must be vertically center and start aligned");
        } else {
            super.setGravity(i2);
        }
    }

    public void setHideMotionSpec(g.e.a.a.c.g gVar) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.j0 = gVar;
        }
    }

    public void setHideMotionSpecResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.j0 = g.e.a.a.c.g.b(bVar.s0, i2);
        }
    }

    public void setIconEndPadding(float f2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.g0(f2);
        }
    }

    public void setIconEndPaddingResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.g0(bVar.s0.getResources().getDimension(i2));
        }
    }

    public void setIconStartPadding(float f2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.h0(f2);
        }
    }

    public void setIconStartPaddingResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.h0(bVar.s0.getResources().getDimension(i2));
        }
    }

    @Override // android.view.View
    public void setLayoutDirection(int i2) {
        if (this.f1099r == null) {
            return;
        }
        super.setLayoutDirection(i2);
    }

    @Override // android.widget.TextView
    public void setLines(int i2) {
        if (i2 > 1) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setLines(i2);
    }

    @Override // android.widget.TextView
    public void setMaxLines(int i2) {
        if (i2 > 1) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setMaxLines(i2);
    }

    @Override // android.widget.TextView
    public void setMaxWidth(int i2) {
        super.setMaxWidth(i2);
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.S0 = i2;
        }
    }

    @Override // android.widget.TextView
    public void setMinLines(int i2) {
        if (i2 > 1) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setMinLines(i2);
    }

    public void setOnCheckedChangeListenerInternal(CompoundButton.OnCheckedChangeListener onCheckedChangeListener) {
        this.f1103v = onCheckedChangeListener;
    }

    public void setOnCloseIconClickListener(View.OnClickListener onClickListener) {
        this.f1102u = onClickListener;
        h();
    }

    public void setRippleColor(ColorStateList colorStateList) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.i0(colorStateList);
        }
        if (this.f1099r.N0) {
            return;
        }
        i();
    }

    public void setRippleColorResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            Context context = bVar.s0;
            ThreadLocal<TypedValue> threadLocal = d.b.d.a.a.a;
            bVar.i0(context.getColorStateList(i2));
            if (this.f1099r.N0) {
                return;
            }
            i();
        }
    }

    @Override // g.e.a.a.w.n
    public void setShapeAppearanceModel(j jVar) {
        g.e.a.a.k.b bVar = this.f1099r;
        bVar.f3851n.a = jVar;
        bVar.invalidateSelf();
    }

    public void setShowMotionSpec(g.e.a.a.c.g gVar) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.i0 = gVar;
        }
    }

    public void setShowMotionSpecResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.i0 = g.e.a.a.c.g.b(bVar.s0, i2);
        }
    }

    @Override // android.widget.TextView
    public void setSingleLine(boolean z2) {
        if (!z2) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setSingleLine(z2);
    }

    @Override // android.widget.TextView
    public void setText(CharSequence charSequence, TextView.BufferType bufferType) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar == null) {
            return;
        }
        if (charSequence == null) {
            charSequence = "";
        }
        super.setText(bVar.R0 ? null : charSequence, bufferType);
        g.e.a.a.k.b bVar2 = this.f1099r;
        if (bVar2 != null) {
            bVar2.j0(charSequence);
        }
    }

    @Override // android.widget.TextView
    public void setTextAppearance(int i2) {
        super.setTextAppearance(i2);
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.k0(new g.e.a.a.t.b(bVar.s0, i2));
        }
        k();
    }

    public void setTextAppearance(g.e.a.a.t.b bVar) {
        g.e.a.a.k.b bVar2 = this.f1099r;
        if (bVar2 != null) {
            bVar2.k0(bVar);
        }
        k();
    }

    public void setTextAppearanceResource(int i2) {
        setTextAppearance(getContext(), i2);
    }

    public void setTextEndPadding(float f2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar == null || bVar.o0 == f2) {
            return;
        }
        bVar.o0 = f2;
        bVar.invalidateSelf();
        bVar.I();
    }

    public void setTextEndPaddingResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.l0(bVar.s0.getResources().getDimension(i2));
        }
    }

    public void setTextStartPadding(float f2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar == null || bVar.n0 == f2) {
            return;
        }
        bVar.n0 = f2;
        bVar.invalidateSelf();
        bVar.I();
    }

    public void setTextStartPaddingResource(int i2) {
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.m0(bVar.s0.getResources().getDimension(i2));
        }
    }

    @Override // android.widget.TextView
    public void setTextAppearance(Context context, int i2) {
        super.setTextAppearance(context, i2);
        g.e.a.a.k.b bVar = this.f1099r;
        if (bVar != null) {
            bVar.k0(new g.e.a.a.t.b(bVar.s0, i2));
        }
        k();
    }
}
