// Path: library/src/main/java/com/freelib/multiitem/adapter/holder/BaseViewHolder.java
// public class BaseViewHolder extends RecyclerView.ViewHolder {
//     public ViewHolderManager viewHolderManager;
//     public Object itemData;
// 
// 
//     public BaseViewHolder(View itemView) {
//         super(itemView);
//     }
// 
// 
//     public Object getItemData() {
//         return itemData;
//     }
// 
//     /**
//      * header和footer的个数也计算在内
//      * {@link #getAdapterPosition()}
//      */
//     public int getItemPosition() {
//         return getAdapterPosition();
//     }
// 
//     public ViewHolderManager getViewHolderManager() {
//         return viewHolderManager;
//     }
// 
// }


import android.view.View;
import com.freelib.multiitem.adapter.holder.BaseViewHolder;
package com.freelib.multiitem.listener;




/**
 * Item长按监听类
 *
 * @author free46000
 */
public abstract class OnItemLongClickListener implements View.OnLongClickListener {

    @Override
    public boolean onLongClick(View v) {
        BaseViewHolder viewHolder = ListenerUtil.getViewHolderByItemView(v);
        if (viewHolder == null) {
            return false;
        }

        onItemLongClick(viewHolder);
        return true;
    }

    /**
     * 点击回调 可以通过viewHolder get到需要的数据
     */
// Path: library/src/main/java/com/freelib/multiitem/adapter/holder/BaseViewHolder.java
// public class BaseViewHolder extends RecyclerView.ViewHolder {
//     public ViewHolderManager viewHolderManager;
//     public Object itemData;
// 
// 
//     public BaseViewHolder(View itemView) {
//         super(itemView);
//     }
// 
// 
//     public Object getItemData() {
//         return itemData;
//     }
// 
//     /**
//      * header和footer的个数也计算在内
//      * {@link #getAdapterPosition()}
//      */
//     public int getItemPosition() {
//         return getAdapterPosition();
//     }
// 
//     public ViewHolderManager getViewHolderManager() {
//         return viewHolderManager;
//     }
// 
// }


// Path: library/src/main/java/com/freelib/multiitem/listener/OnItemLongClickListener.java
import android.view.View;
import com.freelib.multiitem.adapter.holder.BaseViewHolder;

package com.freelib.multiitem.listener;




/**
 * Item长按监听类
 *
 * @author free46000
 */
public abstract class OnItemLongClickListener implements View.OnLongClickListener {

    @Override
    public boolean onLongClick(View v) {
        BaseViewHolder viewHolder = ListenerUtil.getViewHolderByItemView(v);
        if (viewHolder == null) {
            return false;
        }

        onItemLongClick(viewHolder);
        return true;
    }

    /**
     * 点击回调 可以通过viewHolder get到需要的数据
     */
    protected abstract void onItemLongClick(BaseViewHolder viewHolder);