<commit_before>package com.camnter.mvvm;

import android.content.Context;
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * Description：MVVMViewAdapter
 *
 * Created by：CaMnter
 */

public abstract class MVVMViewAdapter<T> extends RecyclerView.Adapter<MVVMViewHolder> {

    private final Context context;
    private final List<T> list;
    private final LayoutInflater inflater;

    private WeakReference<VHandler> vHandler;


    public MVVMViewAdapter(Context context) {
        this.context = context;
        this.list = new ArrayList<>();
        this.inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }


    public void setVHandler(@NonNull final VHandler vHandler) {
        this.vHandler = new WeakReference<>(vHandler);
    }


    /**
     * Please return RecyclerView loading layout Id array
     * 请返回 RecyclerView 加载的布局 Id 数组<commit_msg>[Add] comments of MVVMViewAdapter in mvvm module<commit_after>package com.camnter.mvvm;

import android.content.Context;
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * Description：MVVMViewAdapter
 *
 * Refer to the
 * {@link "https://github.com/markzhai/DataBindingAdapter/blob/master/adapter/src/main/java/com/github/markzhai/recyclerview/BaseViewAdapter.java"}
 *
 * Created by：CaMnter
 */

public abstract class MVVMViewAdapter<T> extends RecyclerView.Adapter<MVVMViewHolder> {

    private final Context context;
    private final List<T> list;
    private final LayoutInflater inflater;

    private WeakReference<VHandler> vHandler;


    public MVVMViewAdapter(Context context) {
        this.context = context;
        this.list = new ArrayList<>();
        this.inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }


    public void setVHandler(@NonNull final VHandler vHandler) {
        this.vHandler = new WeakReference<>(vHandler);
    }


    /**
     * Please return RecyclerView loading layout Id array
     * 请返回 RecyclerView 加载的布局 Id 数组
{'fraction_non_alphanumeric': 0.09201520912547528, 'fraction_numerical': 0.0007604562737642585, 'mean_word_length': 4.380368098159509, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 1, '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': '6076765', 'n_tokens_mistral': 814, 'n_tokens_neox': 766, 'n_words': 170}