package androidx.appcompat.view.menu;

import android.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import o.BO;
import o.C70;
import o.CO;
import o.InterfaceC1477iP;
import o.LO;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class ExpandedMenuView extends ListView implements BO, InterfaceC1477iP, AdapterView.OnItemClickListener {
    public static final int[] m = {R.attr.background, R.attr.divider};
    public CO l;

    public ExpandedMenuView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        setOnItemClickListener(this);
        C70 c70R = C70.r(context, attributeSet, m, R.attr.listViewStyle);
        TypedArray typedArray = (TypedArray) c70R.n;
        if (typedArray.hasValue(0)) {
            setBackgroundDrawable(c70R.m(0));
        }
        if (typedArray.hasValue(1)) {
            setDivider(c70R.m(1));
        }
        c70R.t();
    }

    @Override // o.InterfaceC1477iP
    public final void b(CO co) {
        this.l = co;
    }

    @Override // o.BO
    public final boolean c(LO lo) {
        return this.l.q(lo, null, 0);
    }

    public int getWindowAnimations() {
        return 0;
    }

    @Override // android.widget.ListView, android.widget.AbsListView, android.widget.AdapterView, android.view.ViewGroup, android.view.View
    public final void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        setChildrenDrawingCacheEnabled(false);
    }

    @Override // android.widget.AdapterView.OnItemClickListener
    public final void onItemClick(AdapterView adapterView, View view, int i, long j) {
        c((LO) getAdapter().getItem(i));
    }
}
