content: package com.google.android.material.navigation;
  
  import android.content.Context;
  import android.view.MenuItem;
  import android.view.SubMenu;
  import androidx.appcompat.view.menu.MenuBuilder;
  import androidx.appcompat.view.menu.MenuItemImpl;
  
  public final class NavigationBarMenu extends MenuBuilder {
      private final int maxItemCount;
      private final Class<?> viewClass;
  
      public NavigationBarMenu(Context context, Class<?> cls, int maxItemCount2) {
          super(context);
          this.viewClass = cls;
          this.maxItemCount = maxItemCount2;
      }
  
      /* access modifiers changed from: protected */
      public MenuItem addInternal(int group, int id, int categoryOrder, CharSequence title) {
          if (size() + 1 <= this.maxItemCount) {
              stopDispatchingItemsChanged();
              MenuItem addInternal = super.addInternal(group, id, categoryOrder, title);
              if (addInternal instanceof MenuItemImpl) {
                  ((MenuItemImpl) addInternal).setExclusiveCheckable(true);
              }
              startDispatchingItemsChanged();
              return addInternal;
          }
          String simpleName = this.viewClass.getSimpleName();
          throw new IllegalArgumentException("Maximum number of items supported by " + simpleName + " is " + this.maxItemCount + ". Limit can be checked with " + simpleName + "#getMaxItemCount()");
      }
  
      public SubMenu addSubMenu(int group, int id, int categoryOrder, CharSequence title) {
          throw new UnsupportedOperationException(this.viewClass.getSimpleName() + " does not support submenus");
      }
  
      public int getMaxItemCount() {
          return this.maxItemCount;
      }
  }
  