package androidx.appcompat.widget;

import android.R;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.text.method.KeyListener;
import android.text.method.NumberKeyListener;
import android.util.AttributeSet;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.widget.MultiAutoCompleteTextView;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.core.view.x0;
import l.a1;
import l.e0;
import l.l3;
import l.m3;
import l.p3;
import l.y;
import u0.t;

/* JADX INFO: loaded from: classes.dex */
public class AppCompatMultiAutoCompleteTextView extends MultiAutoCompleteTextView implements x0, t {

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

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final y f672a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final a1 f673b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final e0 f674c;

    public AppCompatMultiAutoCompleteTextView(@NonNull Context context) {
        this(context, null);
    }

    @Override // android.widget.TextView, android.view.View
    public final void drawableStateChanged() {
        super.drawableStateChanged();
        y yVar = this.f672a;
        if (yVar != null) {
            yVar.a();
        }
        a1 a1Var = this.f673b;
        if (a1Var != null) {
            a1Var.b();
        }
    }

    @Override // androidx.core.view.x0
    @Nullable
    @RestrictTo({RestrictTo.Scope.f557c})
    public ColorStateList getSupportBackgroundTintList() {
        y yVar = this.f672a;
        if (yVar != null) {
            return yVar.b();
        }
        return null;
    }

    @Override // androidx.core.view.x0
    @Nullable
    @RestrictTo({RestrictTo.Scope.f557c})
    public PorterDuff.Mode getSupportBackgroundTintMode() {
        y yVar = this.f672a;
        if (yVar != null) {
            return yVar.c();
        }
        return null;
    }

    @Override // u0.t
    @Nullable
    @RestrictTo({RestrictTo.Scope.f557c})
    public ColorStateList getSupportCompoundDrawablesTintList() {
        return this.f673b.getCompoundDrawableTintList();
    }

    @Override // u0.t
    @Nullable
    @RestrictTo({RestrictTo.Scope.f557c})
    public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
        return this.f673b.getCompoundDrawableTintMode();
    }

    @Override // android.widget.TextView, android.view.View
    public final InputConnection onCreateInputConnection(EditorInfo editorInfo) {
        InputConnection inputConnectionOnCreateInputConnection = super.onCreateInputConnection(editorInfo);
        kotlinx.coroutines.y.Q(this, editorInfo, inputConnectionOnCreateInputConnection);
        return this.f674c.onCreateInputConnection(inputConnectionOnCreateInputConnection, editorInfo);
    }

    @Override // android.view.View
    public void setBackgroundDrawable(@Nullable Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        y yVar = this.f672a;
        if (yVar != null) {
            yVar.d();
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(@DrawableRes int i10) {
        super.setBackgroundResource(i10);
        y yVar = this.f672a;
        if (yVar != null) {
            yVar.e(i10);
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawables(@Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
        super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
        a1 a1Var = this.f673b;
        if (a1Var != null) {
            a1Var.b();
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelative(@Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
        super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
        a1 a1Var = this.f673b;
        if (a1Var != null) {
            a1Var.b();
        }
    }

    @Override // android.widget.AutoCompleteTextView
    public void setDropDownBackgroundResource(@DrawableRes int i10) {
        setDropDownBackgroundDrawable(f.a.getDrawable(getContext(), i10));
    }

    public void setEmojiCompatEnabled(boolean z10) {
        this.f674c.a(z10);
    }

    @Override // android.widget.TextView
    public void setKeyListener(@Nullable KeyListener keyListener) {
        super.setKeyListener(this.f674c.getKeyListener(keyListener));
    }

    @Override // androidx.core.view.x0
    @RestrictTo({RestrictTo.Scope.f557c})
    public void setSupportBackgroundTintList(@Nullable ColorStateList colorStateList) {
        y yVar = this.f672a;
        if (yVar != null) {
            yVar.g(colorStateList);
        }
    }

    @Override // androidx.core.view.x0
    @RestrictTo({RestrictTo.Scope.f557c})
    public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode mode) {
        y yVar = this.f672a;
        if (yVar != null) {
            yVar.h(mode);
        }
    }

    @Override // u0.t
    @RestrictTo({RestrictTo.Scope.f557c})
    public void setSupportCompoundDrawablesTintList(@Nullable ColorStateList colorStateList) {
        a1 a1Var = this.f673b;
        a1Var.setCompoundDrawableTintList(colorStateList);
        a1Var.b();
    }

    @Override // u0.t
    @RestrictTo({RestrictTo.Scope.f557c})
    public void setSupportCompoundDrawablesTintMode(@Nullable PorterDuff.Mode mode) {
        a1 a1Var = this.f673b;
        a1Var.setCompoundDrawableTintMode(mode);
        a1Var.b();
    }

    @Override // android.widget.TextView
    public void setTextAppearance(Context context, int i10) {
        super.setTextAppearance(context, i10);
        a1 a1Var = this.f673b;
        if (a1Var != null) {
            a1Var.d(context, i10);
        }
    }

    public AppCompatMultiAutoCompleteTextView(@NonNull Context context, @Nullable AttributeSet attributeSet) {
        this(context, attributeSet, d.a.autoCompleteTextViewStyle);
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public AppCompatMultiAutoCompleteTextView(@NonNull Context context, @Nullable AttributeSet attributeSet, int i10) {
        super(context, attributeSet, i10);
        m3.a(context);
        l3.a(getContext(), this);
        p3 p3VarD = p3.d(getContext(), attributeSet, f671d, i10);
        if (p3VarD.f29809b.hasValue(0)) {
            setDropDownBackgroundDrawable(p3VarD.b(0));
        }
        p3VarD.e();
        y yVar = new y(this);
        this.f672a = yVar;
        yVar.loadFromAttributes(attributeSet, i10);
        a1 a1Var = new a1(this);
        this.f673b = a1Var;
        a1Var.loadFromAttributes(attributeSet, i10);
        a1Var.b();
        e0 e0Var = new e0(this);
        this.f674c = e0Var;
        e0Var.loadFromAttributes(attributeSet, i10);
        KeyListener keyListener = getKeyListener();
        if (!(keyListener instanceof NumberKeyListener)) {
            boolean zIsFocusable = super.isFocusable();
            boolean zIsClickable = super.isClickable();
            boolean zIsLongClickable = super.isLongClickable();
            int inputType = super.getInputType();
            KeyListener keyListener2 = e0Var.getKeyListener(keyListener);
            if (keyListener2 == keyListener) {
                return;
            }
            super.setKeyListener(keyListener2);
            super.setRawInputType(inputType);
            super.setFocusable(zIsFocusable);
            super.setClickable(zIsClickable);
            super.setLongClickable(zIsLongClickable);
        }
    }
}
