Buggy code:
private BaseQuickAdapter . OnRecyclerViewItemClickListener onRecyclerViewItemClickListener ; private BaseQuickAdapter . OnRecyclerViewItemLongClickListener onRecyclerViewItemLongClickListener ; private BaseQuickAdapter . RequestLoadMoreListener mRequestLoadMoreListener ; @ BaseQuickAdapter . AnimationType private BaseAnimation mCustomAnimation ; private BaseAnimation mSelectAnimation = new AlphaInAnimation ( ) ; private View mHeaderView ; private View mFooterView ; private int pageSize = - 1 ; private View mContentView ; private View mEmptyView ; protected static final String TAG = BaseQuickAdapter . class . getSimpleName ( ) ; protected Context mContext ; protected int mLayoutResId ; protected LayoutInflater mLayoutInflater ; protected List < T > mData ; protected static final int HEADER_VIEW = 273 ; protected static final int LOADING_VIEW = 546 ; protected static final int FOOTER_VIEW = 819 ; protected static final int EMPTY_VIEW = 1365 ; private View mLoadingView ; @ IntDef ( { BaseQuickAdapter . ALPHAIN , BaseQuickAdapter . SCALEIN , BaseQuickAdapter . SLIDEIN_BOTTOM , BaseQuickAdapter . SLIDEIN_LEFT , BaseQuickAdapter . SLIDEIN_RIGHT } ) @ Retention ( RetentionPolicy . SOURCE ) public @ interface AnimationType { } public static final int ALPHAIN = 1 ; public static final int SCALEIN = 2 ; public static final int SLIDEIN_BOTTOM = 3 ; public static final int SLIDEIN_LEFT = 4 ; public static final int SLIDEIN_RIGHT = 5 ; @ Deprecated public void setOnLoadMoreListener ( int pageSize , BaseQuickAdapter . RequestLoadMoreListener requestLoadMoreListener ) { } public void setOnLoadMoreListener ( BaseQuickAdapter . RequestLoadMoreListener requestLoadMoreListener ) { } public void setDuration ( int duration ) { } public void openLoadMore ( int pageSize , boolean enable ) { } public void openLoadMore ( boolean enable ) { } public void setPageSize ( int pageSize ) { } public int getPageSize ( ) { } public void setOnRecyclerViewItemClickListener ( BaseQuickAdapter . OnRecyclerViewItemClickListener onRecyclerViewItemClickListener ) { } public interface OnRecyclerViewItemClickListener { public void onItemClick ( View view , int position ) { } } public void setOnRecyclerViewItemLongClickListener ( BaseQuickAdapter . OnRecyclerViewItemLongClickListener onRecyclerViewItemLongClickListener ) { } public interface OnRecyclerViewItemLongClickListener { public boolean onItemLongClick ( View view , int position ) { } } private BaseQuickAdapter . OnRecyclerViewItemChildClickListener mChildClickListener ; public void setOnRecyclerViewItemChildClickListener ( BaseQuickAdapter . OnRecyclerViewItemChildClickListener childClickListener ) { } public interface OnRecyclerViewItemChildClickListener { void onItemChildClick ( BaseQuickAdapter adapter , View view , int position ) { } } public class OnItemChildClickListener implements View . OnClickListener { public int position ; @ Override public void onClick ( View v ) { } } public BaseQuickAdapter ( Context context , int layoutResId , List < T > data ) { } public BaseQuickAdapter ( Context context , List < T > data ) { } public BaseQuickAdapter ( Context context , View contentView , List < T > data ) { } public BaseQuickAdapter ( Context context ) { } public void remove ( int position ) { } public void add ( int position , T item ) { } public void setNewData ( List < T > data ) { } public void addData ( List < T > data ) { } public void setLoadingView ( View loadingView ) { } public List getData ( ) { } public T getItem ( int position ) { } public int getHeaderViewsCount ( ) { } public int getFooterViewsCount ( ) { } public int getmEmptyViewCount ( ) { } @ Override public int getItemCount ( ) { } @ Override public int getItemViewType ( int position ) { if ( ( ( mHeaderView ) != null ) && ( position == 0 ) ) { return BaseQuickAdapter . HEADER_VIEW ; } else if ( ( ( ( mEmptyView ) != null ) && ( ( getItemCount ( ) ) == ( mHeadAndEmptyEnable ? 2 : 1 ) ) ) && ( mEmptyEnable ) ) { return BaseQuickAdapter . EMPTY_VIEW ; } else if ( position == ( ( mData . size ( ) ) + ( getHeaderViewsCount ( ) ) ) ) { if ( mNextLoadEnable ) return BaseQuickAdapter . LOADING_VIEW ; else return BaseQuickAdapter . FOOTER_VIEW ; } <START_BUG> return getDefItemViewType ( position ) ; <END_BUG> } protected int getDefItemViewType ( int position ) { } @ Override public BaseViewHolder onCreateViewHolder ( ViewGroup parent , int viewType ) { } private BaseViewHolder getLoadingView ( ViewGroup parent ) { } @ Override public void onViewAttachedToWindow ( RecyclerView . ViewHolder holder ) { } protected void setFullSpan ( RecyclerView . ViewHolder holder ) { } @ Override public void onBindViewHolder ( final RecyclerView . ViewHolder holder , int positions ) { } protected BaseViewHolder onCreateDefViewHolder ( ViewGroup parent , int viewType ) { } protected BaseViewHolder createBaseViewHolder ( ViewGroup parent , int layoutResId ) { } public void addHeaderView ( View header ) { } public void addFooterView ( View footer ) { } public void setEmptyView ( View emptyView ) { } public void setEmptyView ( boolean isHeadAndEmpty , View emptyView ) { } public View getEmptyView ( ) { } @ Deprecated public void isNextLoad ( boolean isNextLoad ) { } public void notifyDataChangedAfterLoadMore ( boolean isNextLoad ) { } public void notifyDataChangedAfterLoadMore ( List < T > data , boolean isNextLoad ) { } private void addLoadMore ( RecyclerView . ViewHolder holder ) { } private void initItemClickListener ( final BaseViewHolder baseViewHolder ) { } private void addAnimation ( RecyclerView . ViewHolder holder ) { } protected void startAnim ( Animator anim , int index ) { } private boolean isLoadMore ( ) { } protected View getItemView ( int layoutResId , ViewGroup parent ) { } @ Deprecated protected void onBindDefViewHolder ( BaseViewHolder holder , T item ) { } public interface RequestLoadMoreListener { void onLoadMoreRequested ( ) { } } public void openLoadAnimation ( @ BaseQuickAdapter . AnimationType int animationType ) { } public void openLoadAnimation ( BaseAnimation animation ) { } public void openLoadAnimation ( ) { } public void isFirstOnly ( boolean firstOnly ) { } protected abstract void convert ( BaseViewHolder helper , T item ) { } @ Override public long getItemId ( int position ) { } }

Fix:
return getDefItemViewType ( ( position - ( getHeaderViewsCount ( ) ) ) ) ;