jimu-decompiled/sources/androidx/appcompat/view/menu/ExpandedMenuView.java
2025-05-13 19:24:51 +02:00

60 lines
1.9 KiB
Java

package androidx.appcompat.view.menu;
import android.R;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import androidx.appcompat.view.menu.MenuBuilder;
import androidx.appcompat.widget.TintTypedArray;
/* loaded from: classes.dex */
public final class ExpandedMenuView extends ListView implements MenuBuilder.ItemInvoker, MenuView, AdapterView.OnItemClickListener {
private static final int[] c = {R.attr.background, R.attr.divider};
private MenuBuilder a;
private int b;
public ExpandedMenuView(Context context, AttributeSet attributeSet) {
this(context, attributeSet, R.attr.listViewStyle);
}
@Override // androidx.appcompat.view.menu.MenuView
public void a(MenuBuilder menuBuilder) {
this.a = menuBuilder;
}
public int getWindowAnimations() {
return this.b;
}
@Override // android.widget.ListView, android.widget.AbsListView, android.widget.AdapterView, android.view.ViewGroup, android.view.View
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
setChildrenDrawingCacheEnabled(false);
}
@Override // android.widget.AdapterView.OnItemClickListener
public void onItemClick(AdapterView adapterView, View view, int i, long j) {
a((MenuItemImpl) getAdapter().getItem(i));
}
public ExpandedMenuView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet);
setOnItemClickListener(this);
TintTypedArray a = TintTypedArray.a(context, attributeSet, c, i, 0);
if (a.g(0)) {
setBackgroundDrawable(a.b(0));
}
if (a.g(1)) {
setDivider(a.b(1));
}
a.a();
}
@Override // androidx.appcompat.view.menu.MenuBuilder.ItemInvoker
public boolean a(MenuItemImpl menuItemImpl) {
return this.a.a(menuItemImpl, 0);
}
}