public void swapPositions(List<?> list,int from,int to){
  if (hasHeaderView()) {
    from--;
    to--;
  }
  if (enableLoadMore() && to == getItemCount() - 1)   return;
  if (hasHeaderView() && to == 0)   return;
  if (hasHeaderView() && from == 0)   return;
  if (enableLoadMore() && from == getItemCount() - 1)   return;
  Collections.swap(list,from,to);
}

public void swapPositions ( List < ? > list , int from , int to ) { if ( hasHeaderView ( ) ) { from -- ; to -- ; } if ( enableLoadMore ( ) && to == getItemCount ( ) - 1 ) return ; if ( hasHeaderView ( ) && to == 0 ) return ; if ( hasHeaderView ( ) && from == 0 ) return ; if ( enableLoadMore ( ) && from == getItemCount ( ) - 1 ) return ; Collections . swap ( list , from , to ) ; }
swap the item of list
