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 a.c.i.k {

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

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

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

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

    @Override // android.widget.TextView, android.view.View
    protected void drawableStateChanged() {
        super.drawableStateChanged();
        e eVar = this.f570d;
        if (eVar != null) {
            eVar.b();
        }
        n nVar = this.f571e;
        if (nVar != null) {
            nVar.b();
        }
    }

    @Override // a.c.i.k
    public ColorStateList getSupportBackgroundTintList() {
        e eVar = this.f570d;
        if (eVar != null) {
            return eVar.c();
        }
        return null;
    }

    @Override // a.c.i.k
    public PorterDuff.Mode getSupportBackgroundTintMode() {
        e eVar = this.f570d;
        if (eVar != null) {
            return eVar.d();
        }
        return null;
    }

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

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

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

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

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

    @Override // a.c.i.k
    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        e eVar = this.f570d;
        if (eVar != null) {
            eVar.i(colorStateList);
        }
    }

    @Override // a.c.i.k
    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        e eVar = this.f570d;
        if (eVar != null) {
            eVar.j(mode);
        }
    }

    @Override // android.widget.TextView
    public void setTextAppearance(Context context, int i) {
        super.setTextAppearance(context, i);
        n nVar = this.f571e;
        if (nVar != null) {
            nVar.n(context, i);
        }
    }

    public d(Context context, AttributeSet attributeSet, int i) {
        super(f0.b(context), attributeSet, i);
        i0 i0VarS = i0.s(getContext(), attributeSet, f569c, i, 0);
        if (i0VarS.p(0)) {
            setDropDownBackgroundDrawable(i0VarS.f(0));
        }
        i0VarS.t();
        e eVar = new e(this);
        this.f570d = eVar;
        eVar.e(attributeSet, i);
        n nVar = new n(this);
        this.f571e = nVar;
        nVar.k(attributeSet, i);
        nVar.b();
    }
}
