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.util.AttributeSet;
import android.view.ActionMode;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.widget.AutoCompleteTextView;

/* JADX INFO: compiled from: AppCompatAutoCompleteTextView.java */
/* JADX INFO: loaded from: classes.dex */
public class d extends AutoCompleteTextView implements c.f.l.s {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final e f379b;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private final x f380f;

    public d(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, c.a.a.autoCompleteTextViewStyle);
    }

    @Override // android.widget.TextView, android.view.View
    protected void drawableStateChanged() {
        super.drawableStateChanged();
        e eVar = this.f379b;
        if (eVar != null) {
            eVar.b();
        }
        x xVar = this.f380f;
        if (xVar != null) {
            xVar.b();
        }
    }

    @Override // c.f.l.s
    public ColorStateList getSupportBackgroundTintList() {
        e eVar = this.f379b;
        if (eVar != null) {
            return eVar.c();
        }
        return null;
    }

    @Override // c.f.l.s
    public PorterDuff.Mode getSupportBackgroundTintMode() {
        e eVar = this.f379b;
        if (eVar != null) {
            return eVar.d();
        }
        return null;
    }

    @Override // android.widget.TextView, android.view.View
    public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
        InputConnection inputConnectionOnCreateInputConnection = super.onCreateInputConnection(editorInfo);
        l.a(inputConnectionOnCreateInputConnection, editorInfo, this);
        return inputConnectionOnCreateInputConnection;
    }

    @Override // android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        e eVar = this.f379b;
        if (eVar != null) {
            eVar.f(drawable);
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(int i2) {
        super.setBackgroundResource(i2);
        e eVar = this.f379b;
        if (eVar != null) {
            eVar.g(i2);
        }
    }

    @Override // android.widget.TextView
    public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
        super.setCustomSelectionActionModeCallback(androidx.core.widget.i.m(this, callback));
    }

    @Override // android.widget.AutoCompleteTextView
    public void setDropDownBackgroundResource(int i2) {
        setDropDownBackgroundDrawable(c.a.k.a.a.d(getContext(), i2));
    }

    @Override // c.f.l.s
    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        e eVar = this.f379b;
        if (eVar != null) {
            eVar.i(colorStateList);
        }
    }

    @Override // c.f.l.s
    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        e eVar = this.f379b;
        if (eVar != null) {
            eVar.j(mode);
        }
    }

    @Override // android.widget.TextView
    public void setTextAppearance(Context context, int i2) {
        super.setTextAppearance(context, i2);
        x xVar = this.f380f;
        if (xVar != null) {
            xVar.n(context, i2);
        }
    }

    public d(Context context, AttributeSet attributeSet, int i2) {
        super(q0.b(context), attributeSet, i2);
        t0 t0VarT = t0.t(getContext(), attributeSet, f378g, i2, 0);
        if (t0VarT.q(0)) {
            setDropDownBackgroundDrawable(t0VarT.f(0));
        }
        t0VarT.u();
        e eVar = new e(this);
        this.f379b = eVar;
        eVar.e(attributeSet, i2);
        x xVar = new x(this);
        this.f380f = xVar;
        xVar.k(attributeSet, i2);
        this.f380f.b();
    }
}
