package com.google.android.material.chip;

import A3.a;
import G.b;
import K.g;
import K.h;
import K4.c;
import M.B;
import M.J;
import android.R;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.InsetDrawable;
import android.graphics.drawable.RippleDrawable;
import android.text.TextPaint;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.PointerIcon;
import android.view.View;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.CompoundButton;
import android.widget.TextView;
import com.google.android.gms.internal.measurement.AbstractC0707u1;
import h3.AbstractC1031a;
import i3.C1052b;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Locale;
import n.AbstractC1224n;
import o3.C1341a;
import o3.C1342b;
import o3.C1343c;
import o3.C1345e;
import o3.InterfaceC1344d;
import s3.k;
import s7.d;
import u3.C1599d;
import v3.AbstractC1674a;
import x3.u;

/* JADX INFO: loaded from: classes.dex */
public class Chip extends AbstractC1224n implements InterfaceC1344d, u {

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

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

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

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

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

    /* JADX INFO: renamed from: C, reason: collision with root package name */
    public boolean f10188C;
    public boolean D;

    /* JADX INFO: renamed from: E, reason: collision with root package name */
    public int f10189E;

    /* JADX INFO: renamed from: F, reason: collision with root package name */
    public int f10190F;

    /* JADX INFO: renamed from: G, reason: collision with root package name */
    public final C1343c f10191G;
    public final Rect H;

    /* JADX INFO: renamed from: I, reason: collision with root package name */
    public final RectF f10192I;

    /* JADX INFO: renamed from: J, reason: collision with root package name */
    public final C1341a f10193J;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public C1345e f10194u;

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

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

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

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

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

    public Chip(Context context, AttributeSet attributeSet) {
        int resourceId;
        int resourceId2;
        int resourceId3;
        super(a.a(context, attributeSet, com.martsnew.tv.R.attr.chipStyle, com.martsnew.tv.R.style.Widget_MaterialComponents_Chip_Action), attributeSet);
        this.H = new Rect();
        this.f10192I = new RectF();
        this.f10193J = new C1341a(0, this);
        Context context2 = getContext();
        if (attributeSet != null) {
            if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "background") != null) {
                Log.w("Chip", "Do not set the background; Chip manages its own background drawable.");
            }
            if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableLeft") != null) {
                throw new UnsupportedOperationException("Please set left drawable using R.attr#chipIcon.");
            }
            if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableStart") != null) {
                throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
            }
            if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableEnd") != null) {
                throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
            }
            if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableRight") != null) {
                throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
            }
            if (!attributeSet.getAttributeBooleanValue("http://schemas.android.com/apk/res/android", "singleLine", true) || attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "lines", 1) != 1 || attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "minLines", 1) != 1 || attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "maxLines", 1) != 1) {
                throw new UnsupportedOperationException("Chip does not support multi-line text");
            }
            if (attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "gravity", 8388627) != 8388627) {
                Log.w("Chip", "Chip text must be vertically center and start aligned");
            }
        }
        C1345e c1345e = new C1345e(context2, attributeSet);
        int[] iArr = AbstractC1031a.f13397c;
        TypedArray typedArrayE = k.e(c1345e.f15707u0, attributeSet, iArr, com.martsnew.tv.R.attr.chipStyle, com.martsnew.tv.R.style.Widget_MaterialComponents_Chip_Action, new int[0]);
        c1345e.f15683U0 = typedArrayE.hasValue(37);
        Context context3 = c1345e.f15707u0;
        ColorStateList colorStateListQ = d.q(context3, typedArrayE, 24);
        if (c1345e.f15668N != colorStateListQ) {
            c1345e.f15668N = colorStateListQ;
            c1345e.onStateChange(c1345e.getState());
        }
        ColorStateList colorStateListQ2 = d.q(context3, typedArrayE, 11);
        if (c1345e.f15670O != colorStateListQ2) {
            c1345e.f15670O = colorStateListQ2;
            c1345e.onStateChange(c1345e.getState());
        }
        float dimension = typedArrayE.getDimension(19, 0.0f);
        if (c1345e.f15672P != dimension) {
            c1345e.f15672P = dimension;
            c1345e.invalidateSelf();
            c1345e.t();
        }
        if (typedArrayE.hasValue(12)) {
            c1345e.z(typedArrayE.getDimension(12, 0.0f));
        }
        c1345e.E(d.q(context3, typedArrayE, 22));
        c1345e.F(typedArrayE.getDimension(23, 0.0f));
        c1345e.O(d.q(context3, typedArrayE, 36));
        String text = typedArrayE.getText(5);
        text = text == null ? "" : text;
        if (!TextUtils.equals(c1345e.f15682U, text)) {
            c1345e.f15682U = text;
            c1345e.f15656A0.f16853d = true;
            c1345e.invalidateSelf();
            c1345e.t();
        }
        C1599d c1599d = (!typedArrayE.hasValue(0) || (resourceId3 = typedArrayE.getResourceId(0, 0)) == 0) ? null : new C1599d(context3, resourceId3);
        c1599d.f17482k = typedArrayE.getDimension(1, c1599d.f17482k);
        c1345e.P(c1599d);
        int i = typedArrayE.getInt(3, 0);
        if (i == 1) {
            c1345e.f15677R0 = TextUtils.TruncateAt.START;
        } else if (i == 2) {
            c1345e.f15677R0 = TextUtils.TruncateAt.MIDDLE;
        } else if (i == 3) {
            c1345e.f15677R0 = TextUtils.TruncateAt.END;
        }
        c1345e.D(typedArrayE.getBoolean(18, false));
        if (attributeSet != null && attributeSet.getAttributeValue("http://schemas.android.com/apk/res-auto", "chipIconEnabled") != null && attributeSet.getAttributeValue("http://schemas.android.com/apk/res-auto", "chipIconVisible") == null) {
            c1345e.D(typedArrayE.getBoolean(15, false));
        }
        c1345e.A(d.u(context3, typedArrayE, 14));
        if (typedArrayE.hasValue(17)) {
            c1345e.C(d.q(context3, typedArrayE, 17));
        }
        c1345e.B(typedArrayE.getDimension(16, -1.0f));
        c1345e.L(typedArrayE.getBoolean(31, false));
        if (attributeSet != null && attributeSet.getAttributeValue("http://schemas.android.com/apk/res-auto", "closeIconEnabled") != null && attributeSet.getAttributeValue("http://schemas.android.com/apk/res-auto", "closeIconVisible") == null) {
            c1345e.L(typedArrayE.getBoolean(26, false));
        }
        c1345e.G(d.u(context3, typedArrayE, 25));
        c1345e.K(d.q(context3, typedArrayE, 30));
        c1345e.I(typedArrayE.getDimension(28, 0.0f));
        c1345e.v(typedArrayE.getBoolean(6, false));
        c1345e.y(typedArrayE.getBoolean(10, false));
        if (attributeSet != null && attributeSet.getAttributeValue("http://schemas.android.com/apk/res-auto", "checkedIconEnabled") != null && attributeSet.getAttributeValue("http://schemas.android.com/apk/res-auto", "checkedIconVisible") == null) {
            c1345e.y(typedArrayE.getBoolean(8, false));
        }
        c1345e.w(d.u(context3, typedArrayE, 7));
        if (typedArrayE.hasValue(9)) {
            c1345e.x(d.q(context3, typedArrayE, 9));
        }
        c1345e.f15698k0 = (!typedArrayE.hasValue(39) || (resourceId2 = typedArrayE.getResourceId(39, 0)) == 0) ? null : C1052b.a(context3, resourceId2);
        c1345e.f15699l0 = (!typedArrayE.hasValue(33) || (resourceId = typedArrayE.getResourceId(33, 0)) == 0) ? null : C1052b.a(context3, resourceId);
        float dimension2 = typedArrayE.getDimension(21, 0.0f);
        if (c1345e.f15700m0 != dimension2) {
            c1345e.f15700m0 = dimension2;
            c1345e.invalidateSelf();
            c1345e.t();
        }
        c1345e.N(typedArrayE.getDimension(35, 0.0f));
        c1345e.M(typedArrayE.getDimension(34, 0.0f));
        float dimension3 = typedArrayE.getDimension(41, 0.0f);
        if (c1345e.f15703p0 != dimension3) {
            c1345e.f15703p0 = dimension3;
            c1345e.invalidateSelf();
            c1345e.t();
        }
        float dimension4 = typedArrayE.getDimension(40, 0.0f);
        if (c1345e.q0 != dimension4) {
            c1345e.q0 = dimension4;
            c1345e.invalidateSelf();
            c1345e.t();
        }
        c1345e.J(typedArrayE.getDimension(29, 0.0f));
        c1345e.H(typedArrayE.getDimension(27, 0.0f));
        float dimension5 = typedArrayE.getDimension(13, 0.0f);
        if (c1345e.f15706t0 != dimension5) {
            c1345e.f15706t0 = dimension5;
            c1345e.invalidateSelf();
            c1345e.t();
        }
        c1345e.f15681T0 = typedArrayE.getDimensionPixelSize(4, Integer.MAX_VALUE);
        typedArrayE.recycle();
        k.a(context2, attributeSet, com.martsnew.tv.R.attr.chipStyle, com.martsnew.tv.R.style.Widget_MaterialComponents_Chip_Action);
        k.b(context2, attributeSet, iArr, com.martsnew.tv.R.attr.chipStyle, com.martsnew.tv.R.style.Widget_MaterialComponents_Chip_Action, new int[0]);
        TypedArray typedArrayObtainStyledAttributes = context2.obtainStyledAttributes(attributeSet, iArr, com.martsnew.tv.R.attr.chipStyle, com.martsnew.tv.R.style.Widget_MaterialComponents_Chip_Action);
        this.D = typedArrayObtainStyledAttributes.getBoolean(32, false);
        this.f10190F = (int) Math.ceil(typedArrayObtainStyledAttributes.getDimension(20, (float) Math.ceil(TypedValue.applyDimension(1, 48, getContext().getResources().getDisplayMetrics()))));
        typedArrayObtainStyledAttributes.recycle();
        setChipDrawable(c1345e);
        c1345e.h(B.e(this));
        k.a(context2, attributeSet, com.martsnew.tv.R.attr.chipStyle, com.martsnew.tv.R.style.Widget_MaterialComponents_Chip_Action);
        k.b(context2, attributeSet, iArr, com.martsnew.tv.R.attr.chipStyle, com.martsnew.tv.R.style.Widget_MaterialComponents_Chip_Action, new int[0]);
        TypedArray typedArrayObtainStyledAttributes2 = context2.obtainStyledAttributes(attributeSet, iArr, com.martsnew.tv.R.attr.chipStyle, com.martsnew.tv.R.style.Widget_MaterialComponents_Chip_Action);
        boolean zHasValue = typedArrayObtainStyledAttributes2.hasValue(37);
        typedArrayObtainStyledAttributes2.recycle();
        this.f10191G = new C1343c(this, this);
        e();
        if (!zHasValue) {
            setOutlineProvider(new C1342b(this));
        }
        setChecked(this.f10199z);
        setText(c1345e.f15682U);
        setEllipsize(c1345e.f15677R0);
        h();
        if (!this.f10194u.f15679S0) {
            setLines(1);
            setHorizontallyScrolling(true);
        }
        setGravity(8388627);
        g();
        if (this.D) {
            setMinHeight(this.f10190F);
        }
        this.f10189E = getLayoutDirection();
    }

    private RectF getCloseIconTouchBounds() {
        RectF rectF = this.f10192I;
        rectF.setEmpty();
        if (c() && this.f10197x != null) {
            C1345e c1345e = this.f10194u;
            Rect bounds = c1345e.getBounds();
            rectF.setEmpty();
            if (c1345e.S()) {
                float f3 = c1345e.f15706t0 + c1345e.f15705s0 + c1345e.f15692e0 + c1345e.f15704r0 + c1345e.q0;
                if (c1345e.getLayoutDirection() == 0) {
                    float f7 = bounds.right;
                    rectF.right = f7;
                    rectF.left = f7 - f3;
                } else {
                    float f8 = bounds.left;
                    rectF.left = f8;
                    rectF.right = f8 + f3;
                }
                rectF.top = bounds.top;
                rectF.bottom = bounds.bottom;
            }
        }
        return rectF;
    }

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

    private C1599d getTextAppearance() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15656A0.f16855f;
        }
        return null;
    }

    private void setCloseIconHovered(boolean z8) {
        if (this.f10187B != z8) {
            this.f10187B = z8;
            refreshDrawableState();
        }
    }

    private void setCloseIconPressed(boolean z8) {
        if (this.f10186A != z8) {
            this.f10186A = z8;
            refreshDrawableState();
        }
    }

    public final void b(int i) {
        this.f10190F = i;
        if (!this.D) {
            InsetDrawable insetDrawable = this.f10195v;
            if (insetDrawable == null) {
                int[] iArr = AbstractC1674a.f18096a;
                f();
                return;
            } else {
                if (insetDrawable != null) {
                    this.f10195v = null;
                    setMinWidth(0);
                    setMinHeight((int) getChipMinHeight());
                    int[] iArr2 = AbstractC1674a.f18096a;
                    f();
                    return;
                }
                return;
            }
        }
        int iMax = Math.max(0, i - ((int) this.f10194u.f15672P));
        int iMax2 = Math.max(0, i - this.f10194u.getIntrinsicWidth());
        if (iMax2 <= 0 && iMax <= 0) {
            InsetDrawable insetDrawable2 = this.f10195v;
            if (insetDrawable2 == null) {
                int[] iArr3 = AbstractC1674a.f18096a;
                f();
                return;
            } else {
                if (insetDrawable2 != null) {
                    this.f10195v = null;
                    setMinWidth(0);
                    setMinHeight((int) getChipMinHeight());
                    int[] iArr4 = AbstractC1674a.f18096a;
                    f();
                    return;
                }
                return;
            }
        }
        int i5 = iMax2 > 0 ? iMax2 / 2 : 0;
        int i8 = iMax > 0 ? iMax / 2 : 0;
        if (this.f10195v != null) {
            Rect rect = new Rect();
            this.f10195v.getPadding(rect);
            if (rect.top == i8 && rect.bottom == i8 && rect.left == i5 && rect.right == i5) {
                int[] iArr5 = AbstractC1674a.f18096a;
                f();
                return;
            }
        }
        if (getMinHeight() != i) {
            setMinHeight(i);
        }
        if (getMinWidth() != i) {
            setMinWidth(i);
        }
        this.f10195v = new InsetDrawable((Drawable) this.f10194u, i5, i8, i5, i8);
        int[] iArr6 = AbstractC1674a.f18096a;
        f();
    }

    public final boolean c() {
        C1345e c1345e = this.f10194u;
        if (c1345e == null) {
            return false;
        }
        Object obj = c1345e.f15689b0;
        if (obj == null) {
            obj = null;
        } else if (obj instanceof b) {
            obj = null;
        }
        return obj != null;
    }

    public final boolean d() {
        C1345e c1345e = this.f10194u;
        return c1345e != null && c1345e.f15694g0;
    }

    /* JADX WARN: Removed duplicated region for block: B:20:0x005c  */
    /* JADX WARN: Removed duplicated region for block: B:43:0x00a4  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean dispatchHoverEvent(MotionEvent motionEvent) {
        Field declaredField;
        int action = motionEvent.getAction();
        C1343c c1343c = this.f10191G;
        if (action == 10) {
            try {
                declaredField = T.b.class.getDeclaredField("m");
                declaredField.setAccessible(true);
            } catch (IllegalAccessException e8) {
                Log.e("Chip", "Unable to send Accessibility Exit event", e8);
            } catch (NoSuchFieldException e9) {
                Log.e("Chip", "Unable to send Accessibility Exit event", e9);
            } catch (NoSuchMethodException e10) {
                Log.e("Chip", "Unable to send Accessibility Exit event", e10);
            } catch (InvocationTargetException e11) {
                Log.e("Chip", "Unable to send Accessibility Exit event", e11);
            }
            if (((Integer) declaredField.get(c1343c)).intValue() != Integer.MIN_VALUE) {
                Method declaredMethod = T.b.class.getDeclaredMethod("r", Integer.TYPE);
                declaredMethod.setAccessible(true);
                declaredMethod.invoke(c1343c, Integer.MIN_VALUE);
            } else {
                AccessibilityManager accessibilityManager = c1343c.f6307h;
                if (accessibilityManager.isEnabled() && accessibilityManager.isTouchExplorationEnabled()) {
                    int action2 = motionEvent.getAction();
                    if (action2 == 7 || action2 == 9) {
                        float x8 = motionEvent.getX();
                        float y8 = motionEvent.getY();
                        Chip chip = c1343c.f15654q;
                        int i = (chip.c() && chip.getCloseIconTouchBounds().contains(x8, y8)) ? 1 : 0;
                        c1343c.r(i);
                        if (i == Integer.MIN_VALUE) {
                        }
                    } else if (action2 == 10 && c1343c.f6311m != Integer.MIN_VALUE) {
                        c1343c.r(Integer.MIN_VALUE);
                    }
                } else if (!super.dispatchHoverEvent(motionEvent)) {
                    return false;
                }
            }
        }
        return true;
    }

    /* JADX WARN: Removed duplicated region for block: B:27:0x004f  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean dispatchKeyEvent(KeyEvent keyEvent) {
        C1343c c1343c = this.f10191G;
        c1343c.getClass();
        boolean zM = false;
        int i = 0;
        zM = false;
        zM = false;
        zM = false;
        zM = false;
        zM = false;
        if (keyEvent.getAction() != 1) {
            int keyCode = keyEvent.getKeyCode();
            if (keyCode != 61) {
                int i5 = 66;
                if (keyCode != 66) {
                    switch (keyCode) {
                        case 19:
                        case 20:
                        case 21:
                        case 22:
                            if (keyEvent.hasNoModifiers()) {
                                if (keyCode == 19) {
                                    i5 = 33;
                                } else if (keyCode == 21) {
                                    i5 = 17;
                                } else if (keyCode != 22) {
                                    i5 = 130;
                                }
                                int repeatCount = keyEvent.getRepeatCount() + 1;
                                boolean z8 = false;
                                while (i < repeatCount && c1343c.m(i5, null)) {
                                    i++;
                                    z8 = true;
                                }
                                zM = z8;
                            }
                            break;
                        case 23:
                            if (keyEvent.hasNoModifiers() && keyEvent.getRepeatCount() == 0) {
                                int i8 = c1343c.f6310l;
                                if (i8 != Integer.MIN_VALUE) {
                                    Chip chip = c1343c.f15654q;
                                    if (i8 == 0) {
                                        chip.performClick();
                                    } else if (i8 == 1) {
                                        chip.playSoundEffect(0);
                                        View.OnClickListener onClickListener = chip.f10197x;
                                        if (onClickListener != null) {
                                            onClickListener.onClick(chip);
                                        }
                                        chip.f10191G.q(1, 1);
                                    }
                                }
                                zM = true;
                            }
                            break;
                    }
                }
            } else if (keyEvent.hasNoModifiers()) {
                zM = c1343c.m(2, null);
            } else if (keyEvent.hasModifiers(1)) {
                zM = c1343c.m(1, null);
            }
        }
        if (!zM || c1343c.f6310l == Integer.MIN_VALUE) {
            return super.dispatchKeyEvent(keyEvent);
        }
        return true;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r2v0, types: [boolean, int] */
    @Override // n.AbstractC1224n, android.widget.CompoundButton, android.widget.TextView, android.view.View
    public final void drawableStateChanged() {
        int i;
        super.drawableStateChanged();
        C1345e c1345e = this.f10194u;
        boolean zU = false;
        if (c1345e != null && C1345e.s(c1345e.f15689b0)) {
            C1345e c1345e2 = this.f10194u;
            ?? IsEnabled = isEnabled();
            int i5 = IsEnabled;
            if (this.f10188C) {
                i5 = IsEnabled + 1;
            }
            int i8 = i5;
            if (this.f10187B) {
                i8 = i5 + 1;
            }
            int i9 = i8;
            if (this.f10186A) {
                i9 = i8 + 1;
            }
            int i10 = i9;
            if (isChecked()) {
                i10 = i9 + 1;
            }
            int[] iArr = new int[i10];
            if (isEnabled()) {
                iArr[0] = 16842910;
                i = 1;
            } else {
                i = 0;
            }
            if (this.f10188C) {
                iArr[i] = 16842908;
                i++;
            }
            if (this.f10187B) {
                iArr[i] = 16843623;
                i++;
            }
            if (this.f10186A) {
                iArr[i] = 16842919;
                i++;
            }
            if (isChecked()) {
                iArr[i] = 16842913;
            }
            if (!Arrays.equals(c1345e2.f15671O0, iArr)) {
                c1345e2.f15671O0 = iArr;
                if (c1345e2.S()) {
                    zU = c1345e2.u(c1345e2.getState(), iArr);
                }
            }
        }
        if (zU) {
            invalidate();
        }
    }

    public final void e() {
        C1345e c1345e;
        if (!c() || (c1345e = this.f10194u) == null || !c1345e.f15688a0 || this.f10197x == null) {
            J.j(this, null);
        } else {
            J.j(this, this.f10191G);
        }
    }

    public final void f() {
        this.f10196w = new RippleDrawable(AbstractC1674a.a(this.f10194u.f15680T), getBackgroundDrawable(), null);
        this.f10194u.getClass();
        RippleDrawable rippleDrawable = this.f10196w;
        Field field = J.f4065a;
        setBackground(rippleDrawable);
        g();
    }

    public final void g() {
        C1345e c1345e;
        if (TextUtils.isEmpty(getText()) || (c1345e = this.f10194u) == null) {
            return;
        }
        int iP = (int) (c1345e.p() + c1345e.f15706t0 + c1345e.q0);
        C1345e c1345e2 = this.f10194u;
        int iO = (int) (c1345e2.o() + c1345e2.f15700m0 + c1345e2.f15703p0);
        if (this.f10195v != null) {
            Rect rect = new Rect();
            this.f10195v.getPadding(rect);
            iO += rect.left;
            iP += rect.right;
        }
        int paddingTop = getPaddingTop();
        int paddingBottom = getPaddingBottom();
        Field field = J.f4065a;
        setPaddingRelative(iO, paddingTop, iP, paddingBottom);
    }

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

    public Drawable getCheckedIcon() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15696i0;
        }
        return null;
    }

    public ColorStateList getCheckedIconTint() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15697j0;
        }
        return null;
    }

    public ColorStateList getChipBackgroundColor() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15670O;
        }
        return null;
    }

    public float getChipCornerRadius() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return Math.max(0.0f, c1345e.q());
        }
        return 0.0f;
    }

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

    public float getChipEndPadding() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15706t0;
        }
        return 0.0f;
    }

    /* JADX WARN: Multi-variable type inference failed */
    public Drawable getChipIcon() {
        Drawable drawable;
        C1345e c1345e = this.f10194u;
        if (c1345e == null || (drawable = c1345e.f15685W) == 0) {
            return null;
        }
        if (!(drawable instanceof b)) {
            return drawable;
        }
        return null;
    }

    public float getChipIconSize() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15686Y;
        }
        return 0.0f;
    }

    public ColorStateList getChipIconTint() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.X;
        }
        return null;
    }

    public float getChipMinHeight() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15672P;
        }
        return 0.0f;
    }

    public float getChipStartPadding() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15700m0;
        }
        return 0.0f;
    }

    public ColorStateList getChipStrokeColor() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15676R;
        }
        return null;
    }

    public float getChipStrokeWidth() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15678S;
        }
        return 0.0f;
    }

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

    /* JADX WARN: Multi-variable type inference failed */
    public Drawable getCloseIcon() {
        Drawable drawable;
        C1345e c1345e = this.f10194u;
        if (c1345e == null || (drawable = c1345e.f15689b0) == 0) {
            return null;
        }
        if (!(drawable instanceof b)) {
            return drawable;
        }
        return null;
    }

    public CharSequence getCloseIconContentDescription() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15693f0;
        }
        return null;
    }

    public float getCloseIconEndPadding() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15705s0;
        }
        return 0.0f;
    }

    public float getCloseIconSize() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15692e0;
        }
        return 0.0f;
    }

    public float getCloseIconStartPadding() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15704r0;
        }
        return 0.0f;
    }

    public ColorStateList getCloseIconTint() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15691d0;
        }
        return null;
    }

    @Override // android.widget.TextView
    public TextUtils.TruncateAt getEllipsize() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15677R0;
        }
        return null;
    }

    @Override // android.widget.TextView, android.view.View
    public final void getFocusedRect(Rect rect) {
        C1343c c1343c = this.f10191G;
        if (c1343c.f6310l == 1 || c1343c.f6309k == 1) {
            rect.set(getCloseIconTouchBoundsInt());
        } else {
            super.getFocusedRect(rect);
        }
    }

    public C1052b getHideMotionSpec() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15699l0;
        }
        return null;
    }

    public float getIconEndPadding() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15702o0;
        }
        return 0.0f;
    }

    public float getIconStartPadding() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15701n0;
        }
        return 0.0f;
    }

    public ColorStateList getRippleColor() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15680T;
        }
        return null;
    }

    public x3.k getShapeAppearanceModel() {
        return this.f10194u.f18614q.f18588a;
    }

    public C1052b getShowMotionSpec() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15698k0;
        }
        return null;
    }

    public float getTextEndPadding() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.q0;
        }
        return 0.0f;
    }

    public float getTextStartPadding() {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            return c1345e.f15703p0;
        }
        return 0.0f;
    }

    public final void h() {
        TextPaint paint = getPaint();
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            paint.drawableState = c1345e.getState();
        }
        C1599d textAppearance = getTextAppearance();
        if (textAppearance != null) {
            textAppearance.e(getContext(), paint, this.f10193J);
        }
    }

    @Override // android.widget.TextView, android.view.View
    public final void onAttachedToWindow() {
        super.onAttachedToWindow();
        AbstractC0707u1.m(this, this.f10194u);
    }

    @Override // android.widget.CompoundButton, android.widget.TextView, android.view.View
    public final int[] onCreateDrawableState(int i) {
        int[] iArrOnCreateDrawableState = super.onCreateDrawableState(i + 2);
        if (isChecked()) {
            View.mergeDrawableStates(iArrOnCreateDrawableState, f10184L);
        }
        if (d()) {
            View.mergeDrawableStates(iArrOnCreateDrawableState, f10185M);
        }
        return iArrOnCreateDrawableState;
    }

    @Override // android.widget.TextView, android.view.View
    public final void onFocusChanged(boolean z8, int i, Rect rect) {
        super.onFocusChanged(z8, i, rect);
        C1343c c1343c = this.f10191G;
        int i5 = c1343c.f6310l;
        if (i5 != Integer.MIN_VALUE) {
            c1343c.j(i5);
        }
        if (z8) {
            c1343c.m(i, rect);
        }
    }

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

    @Override // android.view.View
    public final void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
        int i;
        super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
        if (d() || isClickable()) {
            accessibilityNodeInfo.setClassName(d() ? "android.widget.CompoundButton" : "android.widget.Button");
        } else {
            accessibilityNodeInfo.setClassName("android.view.View");
        }
        accessibilityNodeInfo.setCheckable(d());
        accessibilityNodeInfo.setClickable(isClickable());
        if (getParent() instanceof ChipGroup) {
            ChipGroup chipGroup = (ChipGroup) getParent();
            if (chipGroup.f16833s) {
                i = 0;
                for (int i5 = 0; i5 < chipGroup.getChildCount(); i5++) {
                    if (chipGroup.getChildAt(i5) instanceof Chip) {
                        if (((Chip) chipGroup.getChildAt(i5)) == this) {
                            break;
                        } else {
                            i++;
                        }
                    }
                }
                i = -1;
            } else {
                i = -1;
            }
            Object tag = getTag(com.martsnew.tv.R.id.row_index_key);
            accessibilityNodeInfo.setCollectionItemInfo((AccessibilityNodeInfo.CollectionItemInfo) c.F(isChecked(), tag instanceof Integer ? ((Integer) tag).intValue() : -1, 1, i, 1).f3604r);
        }
    }

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

    @Override // android.widget.TextView, android.view.View
    public final void onRtlPropertiesChanged(int i) {
        super.onRtlPropertiesChanged(i);
        if (this.f10189E != i) {
            this.f10189E = i;
            g();
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:8:0x001e, code lost:
    
        if (r0 != 3) goto L25;
     */
    @Override // android.widget.TextView, android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean onTouchEvent(MotionEvent motionEvent) {
        boolean z8;
        int actionMasked = motionEvent.getActionMasked();
        boolean zContains = getCloseIconTouchBounds().contains(motionEvent.getX(), motionEvent.getY());
        if (actionMasked != 0) {
            if (actionMasked != 1) {
                if (actionMasked == 2) {
                    if (this.f10186A) {
                        if (!zContains) {
                            setCloseIconPressed(false);
                        }
                        z8 = true;
                    }
                }
                z8 = false;
            } else {
                if (this.f10186A) {
                    playSoundEffect(0);
                    View.OnClickListener onClickListener = this.f10197x;
                    if (onClickListener != null) {
                        onClickListener.onClick(this);
                    }
                    this.f10191G.q(1, 1);
                    z8 = true;
                }
                setCloseIconPressed(false);
            }
            z8 = false;
            setCloseIconPressed(false);
        } else {
            if (zContains) {
                setCloseIconPressed(true);
                z8 = true;
            }
            z8 = false;
        }
        return z8 || super.onTouchEvent(motionEvent);
    }

    @Override // android.view.View
    public void setBackground(Drawable drawable) {
        if (drawable == getBackgroundDrawable() || drawable == this.f10196w) {
            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 i) {
        Log.w("Chip", "Do not set the background color; Chip manages its own background drawable.");
    }

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

    @Override // n.AbstractC1224n, android.view.View
    public void setBackgroundResource(int i) {
        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 z8) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.v(z8);
        }
    }

    public void setCheckableResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.v(c1345e.f15707u0.getResources().getBoolean(i));
        }
    }

    @Override // android.widget.CompoundButton, android.widget.Checkable
    public void setChecked(boolean z8) {
        CompoundButton.OnCheckedChangeListener onCheckedChangeListener;
        C1345e c1345e = this.f10194u;
        if (c1345e == null) {
            this.f10199z = z8;
            return;
        }
        if (c1345e.f15694g0) {
            boolean zIsChecked = isChecked();
            super.setChecked(z8);
            if (zIsChecked == z8 || (onCheckedChangeListener = this.f10198y) == null) {
                return;
            }
            onCheckedChangeListener.onCheckedChanged(this, z8);
        }
    }

    public void setCheckedIcon(Drawable drawable) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.w(drawable);
        }
    }

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

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

    public void setCheckedIconResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.w(android.support.v4.media.session.a.l(c1345e.f15707u0, i));
        }
    }

    public void setCheckedIconTint(ColorStateList colorStateList) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.x(colorStateList);
        }
    }

    public void setCheckedIconTintResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.x(d.p(c1345e.f15707u0, i));
        }
    }

    public void setCheckedIconVisible(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.y(c1345e.f15707u0.getResources().getBoolean(i));
        }
    }

    public void setChipBackgroundColor(ColorStateList colorStateList) {
        C1345e c1345e = this.f10194u;
        if (c1345e == null || c1345e.f15670O == colorStateList) {
            return;
        }
        c1345e.f15670O = colorStateList;
        c1345e.onStateChange(c1345e.getState());
    }

    public void setChipBackgroundColorResource(int i) {
        ColorStateList colorStateListP;
        C1345e c1345e = this.f10194u;
        if (c1345e == null || c1345e.f15670O == (colorStateListP = d.p(c1345e.f15707u0, i))) {
            return;
        }
        c1345e.f15670O = colorStateListP;
        c1345e.onStateChange(c1345e.getState());
    }

    @Deprecated
    public void setChipCornerRadius(float f3) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.z(f3);
        }
    }

    @Deprecated
    public void setChipCornerRadiusResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.z(c1345e.f15707u0.getResources().getDimension(i));
        }
    }

    public void setChipDrawable(C1345e c1345e) {
        C1345e c1345e2 = this.f10194u;
        if (c1345e2 != c1345e) {
            if (c1345e2 != null) {
                c1345e2.f15675Q0 = new WeakReference(null);
            }
            this.f10194u = c1345e;
            c1345e.f15679S0 = false;
            c1345e.f15675Q0 = new WeakReference(this);
            b(this.f10190F);
        }
    }

    public void setChipEndPadding(float f3) {
        C1345e c1345e = this.f10194u;
        if (c1345e == null || c1345e.f15706t0 == f3) {
            return;
        }
        c1345e.f15706t0 = f3;
        c1345e.invalidateSelf();
        c1345e.t();
    }

    public void setChipEndPaddingResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            float dimension = c1345e.f15707u0.getResources().getDimension(i);
            if (c1345e.f15706t0 != dimension) {
                c1345e.f15706t0 = dimension;
                c1345e.invalidateSelf();
                c1345e.t();
            }
        }
    }

    public void setChipIcon(Drawable drawable) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.A(drawable);
        }
    }

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

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

    public void setChipIconResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.A(android.support.v4.media.session.a.l(c1345e.f15707u0, i));
        }
    }

    public void setChipIconSize(float f3) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.B(f3);
        }
    }

    public void setChipIconSizeResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.B(c1345e.f15707u0.getResources().getDimension(i));
        }
    }

    public void setChipIconTint(ColorStateList colorStateList) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.C(colorStateList);
        }
    }

    public void setChipIconTintResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.C(d.p(c1345e.f15707u0, i));
        }
    }

    public void setChipIconVisible(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.D(c1345e.f15707u0.getResources().getBoolean(i));
        }
    }

    public void setChipMinHeight(float f3) {
        C1345e c1345e = this.f10194u;
        if (c1345e == null || c1345e.f15672P == f3) {
            return;
        }
        c1345e.f15672P = f3;
        c1345e.invalidateSelf();
        c1345e.t();
    }

    public void setChipMinHeightResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            float dimension = c1345e.f15707u0.getResources().getDimension(i);
            if (c1345e.f15672P != dimension) {
                c1345e.f15672P = dimension;
                c1345e.invalidateSelf();
                c1345e.t();
            }
        }
    }

    public void setChipStartPadding(float f3) {
        C1345e c1345e = this.f10194u;
        if (c1345e == null || c1345e.f15700m0 == f3) {
            return;
        }
        c1345e.f15700m0 = f3;
        c1345e.invalidateSelf();
        c1345e.t();
    }

    public void setChipStartPaddingResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            float dimension = c1345e.f15707u0.getResources().getDimension(i);
            if (c1345e.f15700m0 != dimension) {
                c1345e.f15700m0 = dimension;
                c1345e.invalidateSelf();
                c1345e.t();
            }
        }
    }

    public void setChipStrokeColor(ColorStateList colorStateList) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.E(colorStateList);
        }
    }

    public void setChipStrokeColorResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.E(d.p(c1345e.f15707u0, i));
        }
    }

    public void setChipStrokeWidth(float f3) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.F(f3);
        }
    }

    public void setChipStrokeWidthResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.F(c1345e.f15707u0.getResources().getDimension(i));
        }
    }

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

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

    public void setCloseIcon(Drawable drawable) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.G(drawable);
        }
        e();
    }

    public void setCloseIconContentDescription(CharSequence charSequence) {
        C1345e c1345e = this.f10194u;
        if (c1345e == null || c1345e.f15693f0 == charSequence) {
            return;
        }
        String str = K.b.f3513b;
        K.b bVar = TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == 1 ? K.b.f3516e : K.b.f3515d;
        bVar.getClass();
        g gVar = h.f3525a;
        c1345e.f15693f0 = bVar.c(charSequence);
        c1345e.invalidateSelf();
    }

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

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

    public void setCloseIconEndPadding(float f3) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.H(f3);
        }
    }

    public void setCloseIconEndPaddingResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.H(c1345e.f15707u0.getResources().getDimension(i));
        }
    }

    public void setCloseIconResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.G(android.support.v4.media.session.a.l(c1345e.f15707u0, i));
        }
        e();
    }

    public void setCloseIconSize(float f3) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.I(f3);
        }
    }

    public void setCloseIconSizeResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.I(c1345e.f15707u0.getResources().getDimension(i));
        }
    }

    public void setCloseIconStartPadding(float f3) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.J(f3);
        }
    }

    public void setCloseIconStartPaddingResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.J(c1345e.f15707u0.getResources().getDimension(i));
        }
    }

    public void setCloseIconTint(ColorStateList colorStateList) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.K(colorStateList);
        }
    }

    public void setCloseIconTintResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.K(d.p(c1345e.f15707u0, i));
        }
    }

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

    @Override // n.AbstractC1224n, android.widget.TextView
    public final 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 // n.AbstractC1224n, android.widget.TextView
    public final 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 final void setCompoundDrawablesRelativeWithIntrinsicBounds(int i, int i5, int i8, int i9) {
        if (i != 0) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (i8 != 0) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawablesRelativeWithIntrinsicBounds(i, i5, i8, i9);
    }

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

    @Override // android.view.View
    public void setElevation(float f3) {
        super.setElevation(f3);
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.h(f3);
        }
    }

    @Override // android.widget.TextView
    public void setEllipsize(TextUtils.TruncateAt truncateAt) {
        if (this.f10194u == null) {
            return;
        }
        if (truncateAt == TextUtils.TruncateAt.MARQUEE) {
            throw new UnsupportedOperationException("Text within a chip are not allowed to scroll.");
        }
        super.setEllipsize(truncateAt);
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.f15677R0 = truncateAt;
        }
    }

    public void setEnsureMinTouchTargetSize(boolean z8) {
        this.D = z8;
        b(this.f10190F);
    }

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

    public void setHideMotionSpec(C1052b c1052b) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.f15699l0 = c1052b;
        }
    }

    public void setHideMotionSpecResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.f15699l0 = C1052b.a(c1345e.f15707u0, i);
        }
    }

    public void setIconEndPadding(float f3) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.M(f3);
        }
    }

    public void setIconEndPaddingResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.M(c1345e.f15707u0.getResources().getDimension(i));
        }
    }

    public void setIconStartPadding(float f3) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.N(f3);
        }
    }

    public void setIconStartPaddingResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.N(c1345e.f15707u0.getResources().getDimension(i));
        }
    }

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

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

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

    @Override // android.widget.TextView
    public void setMaxWidth(int i) {
        super.setMaxWidth(i);
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.f15681T0 = i;
        }
    }

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

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

    public void setOnCloseIconClickListener(View.OnClickListener onClickListener) {
        this.f10197x = onClickListener;
        e();
    }

    public void setRippleColor(ColorStateList colorStateList) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.O(colorStateList);
        }
        this.f10194u.getClass();
        f();
    }

    public void setRippleColorResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.O(d.p(c1345e.f15707u0, i));
            this.f10194u.getClass();
            f();
        }
    }

    @Override // x3.u
    public void setShapeAppearanceModel(x3.k kVar) {
        this.f10194u.setShapeAppearanceModel(kVar);
    }

    public void setShowMotionSpec(C1052b c1052b) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.f15698k0 = c1052b;
        }
    }

    public void setShowMotionSpecResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.f15698k0 = C1052b.a(c1345e.f15707u0, i);
        }
    }

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

    @Override // android.widget.TextView
    public final void setText(CharSequence charSequence, TextView.BufferType bufferType) {
        C1345e c1345e = this.f10194u;
        if (c1345e == null) {
            return;
        }
        if (charSequence == null) {
            charSequence = "";
        }
        super.setText(c1345e.f15679S0 ? null : charSequence, bufferType);
        C1345e c1345e2 = this.f10194u;
        if (c1345e2 == null || TextUtils.equals(c1345e2.f15682U, charSequence)) {
            return;
        }
        c1345e2.f15682U = charSequence;
        c1345e2.f15656A0.f16853d = true;
        c1345e2.invalidateSelf();
        c1345e2.t();
    }

    public void setTextAppearance(C1599d c1599d) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.P(c1599d);
        }
        h();
    }

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

    public void setTextEndPadding(float f3) {
        C1345e c1345e = this.f10194u;
        if (c1345e == null || c1345e.q0 == f3) {
            return;
        }
        c1345e.q0 = f3;
        c1345e.invalidateSelf();
        c1345e.t();
    }

    public void setTextEndPaddingResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            float dimension = c1345e.f15707u0.getResources().getDimension(i);
            if (c1345e.q0 != dimension) {
                c1345e.q0 = dimension;
                c1345e.invalidateSelf();
                c1345e.t();
            }
        }
    }

    public void setTextStartPadding(float f3) {
        C1345e c1345e = this.f10194u;
        if (c1345e == null || c1345e.f15703p0 == f3) {
            return;
        }
        c1345e.f15703p0 = f3;
        c1345e.invalidateSelf();
        c1345e.t();
    }

    public void setTextStartPaddingResource(int i) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            float dimension = c1345e.f15707u0.getResources().getDimension(i);
            if (c1345e.f15703p0 != dimension) {
                c1345e.f15703p0 = dimension;
                c1345e.invalidateSelf();
                c1345e.t();
            }
        }
    }

    public void setCloseIconVisible(boolean z8) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.L(z8);
        }
        e();
    }

    public void setCheckedIconVisible(boolean z8) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.y(z8);
        }
    }

    public void setChipIconVisible(boolean z8) {
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.D(z8);
        }
    }

    @Override // android.widget.TextView
    public final 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) {
            super.setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
            return;
        }
        throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
    }

    @Override // android.widget.TextView
    public final 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) {
            super.setCompoundDrawablesWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
            return;
        }
        throw new UnsupportedOperationException("Please set right drawable using R.attr#closeIcon.");
    }

    @Override // android.widget.TextView
    public final void setTextAppearance(Context context, int i) {
        super.setTextAppearance(context, i);
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.P(new C1599d(c1345e.f15707u0, i));
        }
        h();
    }

    @Override // android.widget.TextView
    public void setTextAppearance(int i) {
        super.setTextAppearance(i);
        C1345e c1345e = this.f10194u;
        if (c1345e != null) {
            c1345e.P(new C1599d(c1345e.f15707u0, i));
        }
        h();
    }
}
