package com.google.android.material.bottomnavigation;

import X6FRs_4.KQgRr5e_0.YghfZG_14.XnFJ5_9.FSaI4_7;
import X6FRs_4.KQgRr5e_0.YghfZG_14.XnFJ5_9.XnFJ5_9;
import android.content.Context;
import android.view.MenuItem;
import android.view.SubMenu;
/* loaded from: classes.dex */
public final class BottomNavigationMenu extends FSaI4_7 {
    public static final int MAX_ITEM_COUNT = 5;

    public BottomNavigationMenu(Context context) {
        super(context);
    }

    @Override // X6FRs_4.KQgRr5e_0.YghfZG_14.XnFJ5_9.FSaI4_7
    public MenuItem addInternal(int i, int i2, int i3, CharSequence charSequence) {
        if (size() + 1 <= 5) {
            stopDispatchingItemsChanged();
            MenuItem addInternal = super.addInternal(i, i2, i3, charSequence);
            if (addInternal instanceof XnFJ5_9) {
                ((XnFJ5_9) addInternal).PGPF6hQ_2(true);
            }
            startDispatchingItemsChanged();
            return addInternal;
        }
        throw new IllegalArgumentException("Maximum number of items supported by BottomNavigationView is 5. Limit can be checked with BottomNavigationView#getMaxItemCount()");
    }

    @Override // X6FRs_4.KQgRr5e_0.YghfZG_14.XnFJ5_9.FSaI4_7, android.view.Menu
    public SubMenu addSubMenu(int i, int i2, int i3, CharSequence charSequence) {
        throw new UnsupportedOperationException("BottomNavigationView does not support submenus");
    }
}
