@NonNull
    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        AdapterDelegate<T> delegate = getDelegateForViewType(viewType);
        if (delegate == null) {
            throw new NullPointerException("No AdapterDelegate added for ViewType " + viewType);
        }

        RecyclerView.ViewHolder vh = delegate.onCreateViewHolder(parent);
        if (vh == null) {
            throw new NullPointerException("ViewHolder returned from AdapterDelegate "
                    + delegate
                    + " for ViewType ="
                    + viewType
                    + " is null!");
        }
        return vh;
    }
@ NonNull public RecyclerView . ViewHolder onCreateViewHolder ( @ NonNull ViewGroup parent , int viewType ) { AdapterDelegate < T > delegate = getDelegateForViewType ( viewType ) ; if ( delegate == null ) { throw new NullPointerException ( "No AdapterDelegate added for ViewType " + viewType ) ; } RecyclerView . ViewHolder vh = delegate . onCreateViewHolder ( parent ) ; if ( vh == null ) { throw new NullPointerException ( "ViewHolder returned from AdapterDelegate " + delegate + " for ViewType =" + viewType + " is null!" ) ; } return vh ; }
This method must be called in {@link RecyclerView.Adapter#onCreateViewHolder(ViewGroup, int)}

@param parent   the parent
@param viewType the view type
@return The new created ViewHolder
@throws NullPointerException if no AdapterDelegate has been registered for ViewHolders
viewType