<commit_before>package com.hsj.base.ui.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

import java.util.List;

/**
 * @Company:南京荣之誉信息科技有限公司
 * @Author:HSJ
 * @E-mail:<EMAIL>
 * @Date:2017/12/8/10:33
 * @Version:XBS V2.0
 * @Class:BaseRecyclerViewAdapter
 * @Description:
 */
public abstract class BaseRecyclerViewAdapter<T> extends RecyclerView.Adapter<BaseRecyclerViewAdapter.ViewHolder> {

    private Context context;

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        context = parent.getContext();
        return new ViewHolder(LayoutInflater.from(context).inflate(setItemView(), parent, false));
    }

    @Override
    public int getItemCount() {
        return setData() == null ? 0 : setData().size();
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        final T t = setData().get(position);
        bindItemData(t);
        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                itemViewOnClick(t);
            }
        });
    }

    public class ViewHolder extends RecyclerView.ViewHolder {

        private ViewHolder(View itemView) {
            super(itemView);
            bindItemView(itemView);
        }
    }

    /**
     * 土司
     *
     * @param msg
     */
    public void showToast(@NonNull String msg) {
        Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
    }

    /**
     * item点击
     *
     * @param t
     */
    protected void itemViewOnClick(T t) {

    }

    /**
     * 设置item布局
     *
     * @return
     */
    protected abstract int setItemView();<commit_msg>no message<commit_after>package com.hsj.base.ui.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import java.util.List;

/**
 * @Company:南京荣之誉信息科技有限公司
 * @Author:HSJ
 * @E-mail:<EMAIL>
 * @Date:2017/12/8/10:33
 * @Version:XBS V2.0
 * @Class:BaseRecyclerViewAdapter
 * @Description:
 */
public abstract class BaseRecyclerViewAdapter<T> extends RecyclerView.Adapter<BaseRecyclerViewAdapter.ViewHolder> {

    private Context context;

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        context = parent.getContext();
        return new ViewHolder(LayoutInflater.from(context).inflate(setItemView(), parent, false));
    }

    @Override
    public int getItemCount() {
        return setData() == null ? 0 : setData().size();
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        final T t = setData().get(position);
        bindItemData(t);
        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                itemViewOnClick(t);
            }
        });
    }

    public class ViewHolder extends RecyclerView.ViewHolder {

        private ViewHolder(View itemView) {
            super(itemView);
            bindItemView(itemView);
        }
    }

    /**
     * 土司
     *
     * @param msg
     */
    public void showToast(@NonNull String msg) {
        Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
    }

    /**
     * item点击
     *
     * @param t
     */
    public void itemViewOnClick(T t) {

    }

    /**
     * 设置item布局
     *
     * @return
     */
    protected abstract int setItemView();
{'fraction_non_alphanumeric': 0.11272056887016066, 'fraction_numerical': 0.007900974453515933, 'mean_word_length': 2.606837606837607, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7062975', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1166, 'n_words': 224}