package n;

import N1.C0198b;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.text.InputFilter;
import android.util.AttributeSet;
import android.view.ActionMode;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.Button;
import com.google.android.gms.internal.measurement.X1;
import com.martsnew.tv.R;

/* JADX INFO: renamed from: n.m, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractC1222m extends Button implements P.l {

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final C0198b f14899q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final C1187E f14900r;

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public AbstractC1222m(Context context, AttributeSet attributeSet) {
        super(context, attributeSet, R.attr.materialButtonStyle);
        H0.a(context);
        G0.a(this, getContext());
        C0198b c0198b = new C0198b(this);
        this.f14899q = c0198b;
        c0198b.n(attributeSet, R.attr.materialButtonStyle);
        C1187E c1187e = new C1187E(this);
        this.f14900r = c1187e;
        c1187e.d(attributeSet, R.attr.materialButtonStyle);
        c1187e.b();
        getEmojiTextViewHelper().a(attributeSet, R.attr.materialButtonStyle);
    }

    private C1233s getEmojiTextViewHelper() {
        if (this.f14901s == null) {
            this.f14901s = new C1233s(this);
        }
        return this.f14901s;
    }

    @Override // android.widget.TextView, android.view.View
    public final void drawableStateChanged() {
        super.drawableStateChanged();
        C0198b c0198b = this.f14899q;
        if (c0198b != null) {
            c0198b.b();
        }
        C1187E c1187e = this.f14900r;
        if (c1187e != null) {
            c1187e.b();
        }
    }

    @Override // android.widget.TextView
    public int getAutoSizeMaxTextSize() {
        if (X0.f14804a) {
            return super.getAutoSizeMaxTextSize();
        }
        C1187E c1187e = this.f14900r;
        if (c1187e != null) {
            return Math.round(c1187e.i.f14753e);
        }
        return -1;
    }

    @Override // android.widget.TextView
    public int getAutoSizeMinTextSize() {
        if (X0.f14804a) {
            return super.getAutoSizeMinTextSize();
        }
        C1187E c1187e = this.f14900r;
        if (c1187e != null) {
            return Math.round(c1187e.i.f14752d);
        }
        return -1;
    }

    @Override // android.widget.TextView
    public int getAutoSizeStepGranularity() {
        if (X0.f14804a) {
            return super.getAutoSizeStepGranularity();
        }
        C1187E c1187e = this.f14900r;
        if (c1187e != null) {
            return Math.round(c1187e.i.f14751c);
        }
        return -1;
    }

    @Override // android.widget.TextView
    public int[] getAutoSizeTextAvailableSizes() {
        if (X0.f14804a) {
            return super.getAutoSizeTextAvailableSizes();
        }
        C1187E c1187e = this.f14900r;
        return c1187e != null ? c1187e.i.f14754f : new int[0];
    }

    @Override // android.widget.TextView
    @SuppressLint({"WrongConstant"})
    public int getAutoSizeTextType() {
        if (X0.f14804a) {
            return super.getAutoSizeTextType() == 1 ? 1 : 0;
        }
        C1187E c1187e = this.f14900r;
        if (c1187e != null) {
            return c1187e.i.f14749a;
        }
        return 0;
    }

    @Override // android.widget.TextView
    public ActionMode.Callback getCustomSelectionActionModeCallback() {
        return W3.b.z(super.getCustomSelectionActionModeCallback());
    }

    public ColorStateList getSupportBackgroundTintList() {
        C0198b c0198b = this.f14899q;
        if (c0198b != null) {
            return c0198b.k();
        }
        return null;
    }

    public PorterDuff.Mode getSupportBackgroundTintMode() {
        C0198b c0198b = this.f14899q;
        if (c0198b != null) {
            return c0198b.l();
        }
        return null;
    }

    public ColorStateList getSupportCompoundDrawablesTintList() {
        k7.i iVar = this.f14900r.f14698h;
        if (iVar != null) {
            return (ColorStateList) iVar.f14082c;
        }
        return null;
    }

    public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
        k7.i iVar = this.f14900r.f14698h;
        if (iVar != null) {
            return (PorterDuff.Mode) iVar.f14083d;
        }
        return null;
    }

    @Override // android.view.View
    public void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
        super.onInitializeAccessibilityEvent(accessibilityEvent);
        accessibilityEvent.setClassName(Button.class.getName());
    }

    @Override // android.view.View
    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
        super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
        accessibilityNodeInfo.setClassName(Button.class.getName());
    }

    @Override // android.widget.TextView, android.view.View
    public void onLayout(boolean z8, int i, int i5, int i8, int i9) {
        super.onLayout(z8, i, i5, i8, i9);
        C1187E c1187e = this.f14900r;
        if (c1187e == null || X0.f14804a) {
            return;
        }
        c1187e.i.a();
    }

    @Override // android.widget.TextView
    public void onTextChanged(CharSequence charSequence, int i, int i5, int i8) {
        super.onTextChanged(charSequence, i, i5, i8);
        C1187E c1187e = this.f14900r;
        if (c1187e == null || X0.f14804a) {
            return;
        }
        C1197O c1197o = c1187e.i;
        if (c1197o.f()) {
            c1197o.a();
        }
    }

    @Override // android.widget.TextView
    public void setAllCaps(boolean z8) {
        super.setAllCaps(z8);
        ((X1) getEmojiTextViewHelper().f14929b.f11784r).I(z8);
    }

    @Override // android.widget.TextView
    public final void setAutoSizeTextTypeUniformWithConfiguration(int i, int i5, int i8, int i9) {
        if (X0.f14804a) {
            super.setAutoSizeTextTypeUniformWithConfiguration(i, i5, i8, i9);
            return;
        }
        C1187E c1187e = this.f14900r;
        if (c1187e != null) {
            c1187e.g(i, i5, i8, i9);
        }
    }

    @Override // android.widget.TextView
    public final void setAutoSizeTextTypeUniformWithPresetSizes(int[] iArr, int i) {
        if (X0.f14804a) {
            super.setAutoSizeTextTypeUniformWithPresetSizes(iArr, i);
            return;
        }
        C1187E c1187e = this.f14900r;
        if (c1187e != null) {
            c1187e.h(iArr, i);
        }
    }

    @Override // android.widget.TextView
    public void setAutoSizeTextTypeWithDefaults(int i) {
        if (X0.f14804a) {
            super.setAutoSizeTextTypeWithDefaults(i);
            return;
        }
        C1187E c1187e = this.f14900r;
        if (c1187e != null) {
            c1187e.i(i);
        }
    }

    @Override // android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        C0198b c0198b = this.f14899q;
        if (c0198b != null) {
            c0198b.p();
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(int i) {
        super.setBackgroundResource(i);
        C0198b c0198b = this.f14899q;
        if (c0198b != null) {
            c0198b.q(i);
        }
    }

    @Override // android.widget.TextView
    public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
        super.setCustomSelectionActionModeCallback(W3.b.A(callback, this));
    }

    public void setEmojiCompatEnabled(boolean z8) {
        ((X1) getEmojiTextViewHelper().f14929b.f11784r).J(z8);
    }

    @Override // android.widget.TextView
    public void setFilters(InputFilter[] inputFilterArr) {
        super.setFilters(((X1) getEmojiTextViewHelper().f14929b.f11784r).l(inputFilterArr));
    }

    public void setSupportAllCaps(boolean z8) {
        C1187E c1187e = this.f14900r;
        if (c1187e != null) {
            c1187e.f14691a.setAllCaps(z8);
        }
    }

    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        C0198b c0198b = this.f14899q;
        if (c0198b != null) {
            c0198b.v(colorStateList);
        }
    }

    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        C0198b c0198b = this.f14899q;
        if (c0198b != null) {
            c0198b.w(mode);
        }
    }

    @Override // P.l
    public void setSupportCompoundDrawablesTintList(ColorStateList colorStateList) {
        C1187E c1187e = this.f14900r;
        c1187e.j(colorStateList);
        c1187e.b();
    }

    @Override // P.l
    public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode mode) {
        C1187E c1187e = this.f14900r;
        c1187e.k(mode);
        c1187e.b();
    }

    @Override // android.widget.TextView
    public final void setTextAppearance(Context context, int i) {
        super.setTextAppearance(context, i);
        C1187E c1187e = this.f14900r;
        if (c1187e != null) {
            c1187e.e(context, i);
        }
    }

    @Override // android.widget.TextView
    public final void setTextSize(int i, float f3) {
        boolean z8 = X0.f14804a;
        if (z8) {
            super.setTextSize(i, f3);
            return;
        }
        C1187E c1187e = this.f14900r;
        if (c1187e == null || z8) {
            return;
        }
        C1197O c1197o = c1187e.i;
        if (c1197o.f()) {
            return;
        }
        c1197o.g(i, f3);
    }
}
