<commit_before># RecyclerViewAdapter

## 简介
一个支持RecyclerView加载更多、添加HeaderView的BaseAdapter

[原理、效果](http://www.jianshu.com/p/66c065874848)

[demo下载](https://fir.im/e5pz)

## 导入

**1. 添加JitPack仓库**

在当前项目根目录下的 `build.gradle` 文件中添加如下内容:
``` gradle
allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}
```
**2. 添加项目依赖**
``` gradle
dependencies {
        compile 'com.github.Othershe:RecyclerViewAdapter:1.2.2'
}
```

## 用法

### 一、创建Adapter
#### 1、创建只有一种ItemView的Adapter
```java
public class CommonRefreshAdapter extends CommonBaseAdapter<T> {

    public CommonRefreshAdapter (Context context, List<T> datas, boolean isLoadMore) {
        super(context, datas, isLoadMore);
    }

    @Override
    protected void convert(ViewHolder holder, T data, int position) {
        //init item
    }

    @Override
    protected int getItemLayoutId() {
        return item_layout;
    }
}
```
#### 2、创建有多种ItemView的Adapter
```java
public class MultiRefreshAdapter extends MultiBaseAdapter<T> {

    public MultiRefreshAdapter(Context context, List<T> datas, boolean isOpenLoadMore) {
        super(context, datas, isOpenLoadMore);<commit_msg>fix version<commit_after># RecyclerViewAdapter

## 简介
一个支持RecyclerView加载更多、添加HeaderView的BaseAdapter

[原理、效果](http://www.jianshu.com/p/66c065874848)

[demo下载](https://fir.im/e5pz)

## 导入

**1. 添加JitPack仓库**

在当前项目根目录下的 `build.gradle` 文件中添加如下内容:
``` gradle
allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}
```
**2. 添加项目依赖**
``` gradle
dependencies {
        implementation 'com.github.Othershe:RecyclerViewAdapter:1.2.4'
}
```

## 用法

### 一、创建Adapter
#### 1、创建只有一种ItemView的Adapter
```java
public class CommonRefreshAdapter extends CommonBaseAdapter<T> {

    public CommonRefreshAdapter (Context context, List<T> datas, boolean isLoadMore) {
        super(context, datas, isLoadMore);
    }

    @Override
    protected void convert(ViewHolder holder, T data, int position) {
        //init item
    }

    @Override
    protected int getItemLayoutId() {
        return item_layout;
    }
}
```
#### 2、创建有多种ItemView的Adapter
```java
public class MultiRefreshAdapter extends MultiBaseAdapter<T> {

    public MultiRefreshAdapter(Context context, List<T> datas, boolean isOpenLoadMore) {
        super(context, datas, isOpenLoadMore);
{'fraction_non_alphanumeric': 0.1303792074989348, 'fraction_numerical': 0.016190881976991905, 'mean_word_length': 3.7918367346938777, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '2154402', 'n_tokens_mistral': 908, 'n_tokens_neox': 885, 'n_words': 156}