library/src/main/java/com/alley/rv/base/BaseRVAdapter.java
/**
     * init the baseViewHolder to register mOnItemClickListener and mOnItemLongClickListener
     *
     * @param holder
     */
init the baseViewHolder to register mOnItemClickListener and mOnItemLongClickListener
@param holder
init the baseViewHolder to register mOnItemClickListener and mOnItemLongClickListener @param holder
private void initItemClickListener(final BaseViewHolder holder) {
        if (null != mOnItemClickListener) {
            holder.itemView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    final int position = holder.getAdapterPosition() - getHeaderViewCount() - 1;
                    mOnItemClickListener.onItemClick(view, listBody.get(position), position);
                }
            });
        }
        if (null != mOnItemLongClickListener) {
            holder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
                @Override
                public boolean onLongClick(View v) {
                    final int position = holder.getAdapterPosition() - getHeaderViewCount() - 1;
                    mOnItemLongClickListener.onItemLongClick(v, listBody.get(position), position);
                    return true;
                }
            });
        }
    }
private void initItemClickListener ( final BaseViewHolder holder ) { if ( null != mOnItemClickListener ) { holder . itemView . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { final int position = holder . getAdapterPosition ( ) - getHeaderViewCount ( ) - 1 ; mOnItemClickListener . onItemClick ( view , listBody . get ( position ) , position ) ; } } ) ; } if ( null != mOnItemLongClickListener ) { holder . itemView . setOnLongClickListener ( new View . OnLongClickListener ( ) { @ Override public boolean onLongClick ( View v ) { final int position = holder . getAdapterPosition ( ) - getHeaderViewCount ( ) - 1 ; mOnItemLongClickListener . onItemLongClick ( v , listBody . get ( position ) , position ) ; return true ; } } ) ; } }
init the baseViewHolder to register mOnItemClickListener and mOnItemLongClickListener
 @param holder
init the baseViewHolder to register mOnItemClickListener and mOnItemLongClickListener @param holder