package ῲ.ῲ.ඓ.㳳;

import android.content.Context;
import android.graphics.Rect;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.FrameLayout;
import android.widget.HeaderViewListAdapter;
import android.widget.ListAdapter;
import android.widget.PopupWindow;

/* renamed from: ῲ.ῲ.ඓ.㳳.㑃  reason: contains not printable characters */
/* compiled from: MenuPopup */
public abstract class AbstractC1916 implements AbstractC1903, AbstractC1897, AdapterView.OnItemClickListener {

    /* renamed from: ῲ  reason: contains not printable characters */
    public Rect f6490;

    /* renamed from: ῲ  reason: contains not printable characters */
    public static boolean m4941(C1912 r5) {
        int size = r5.size();
        for (int i = 0; i < size; i++) {
            MenuItem item = r5.getItem(i);
            if (item.isVisible() && item.getIcon() != null) {
                return true;
            }
        }
        return false;
    }

    @Override // ῲ.ῲ.ඓ.㳳.AbstractC1897
    public boolean collapseItemActionView(C1912 r1, C1922 r2) {
        return false;
    }

    @Override // ῲ.ῲ.ඓ.㳳.AbstractC1897
    public boolean expandItemActionView(C1912 r1, C1922 r2) {
        return false;
    }

    @Override // ῲ.ῲ.ඓ.㳳.AbstractC1897
    public int getId() {
        return 0;
    }

    @Override // ῲ.ῲ.ඓ.㳳.AbstractC1897
    public void initForMenu(Context context, C1912 r2) {
    }

    @Override // android.widget.AdapterView.OnItemClickListener
    public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
        C1924 r2;
        ListAdapter listAdapter = (ListAdapter) adapterView.getAdapter();
        if (listAdapter instanceof HeaderViewListAdapter) {
            r2 = (C1924) ((HeaderViewListAdapter) listAdapter).getWrappedAdapter();
        } else {
            r2 = (C1924) listAdapter;
        }
        r2.f6548.performItemAction((MenuItem) listAdapter.getItem(i), this, m4947() ? 0 : 4);
    }

    public abstract void setOnDismissListener(PopupWindow.OnDismissListener onDismissListener);

    /* renamed from: ʬ  reason: contains not printable characters */
    public Rect m4943() {
        return this.f6490;
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public abstract void m4944(int i);

    /* renamed from: ῲ  reason: contains not printable characters */
    public abstract void m4945(int i);

    /* renamed from: ῲ  reason: contains not printable characters */
    public abstract void m4946(boolean z);

    /* renamed from: ῲ  reason: contains not printable characters */
    public boolean m4947() {
        return true;
    }

    /* renamed from: K  reason: contains not printable characters */
    public abstract void m4948(int i);

    /* renamed from: K  reason: contains not printable characters */
    public void m4949(Rect rect) {
        this.f6490 = rect;
    }

    /* renamed from: K  reason: contains not printable characters */
    public abstract void m4950(View view);

    /* renamed from: K  reason: contains not printable characters */
    public abstract void m4951(C1912 v);

    /* renamed from: K  reason: contains not printable characters */
    public abstract void m4952(boolean z);

    /* renamed from: K  reason: contains not printable characters */
    public static int m4942(ListAdapter listAdapter, ViewGroup viewGroup, Context context, int i) {
        int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, 0);
        int makeMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(0, 0);
        int count = listAdapter.getCount();
        ViewGroup viewGroup2 = viewGroup;
        View view = null;
        int i2 = 0;
        int i3 = 0;
        for (int i4 = 0; i4 < count; i4++) {
            int itemViewType = listAdapter.getItemViewType(i4);
            if (itemViewType != i3) {
                view = null;
                i3 = itemViewType;
            }
            if (viewGroup2 == null) {
                viewGroup2 = new FrameLayout(context);
            }
            view = listAdapter.getView(i4, view, viewGroup2);
            view.measure(makeMeasureSpec, makeMeasureSpec2);
            int measuredWidth = view.getMeasuredWidth();
            if (measuredWidth >= i) {
                return i;
            }
            if (measuredWidth > i2) {
                i2 = measuredWidth;
            }
        }
        return i2;
    }
}
