Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin1/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ChadCym committed Apr 29, 2016
2 parents f14ea2b + 2857a15 commit 8563fae
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
30 changes: 29 additions & 1 deletion README-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- **新增分组**
- **自定义item类型**
- **添加setEmptyView方法**
- **新增添加子布局多个控件的点击事件**

![demo](https://github.com/CymChad/BaseRecyclerViewAdapterHelper/blob/master/demo_res/demo.gif)
#如何使用它?
Expand All @@ -31,7 +32,7 @@
然后在dependencies添加:
```
dependencies {
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:v1.5.5'
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:v1.5.7'
}
```

Expand Down Expand Up @@ -164,6 +165,33 @@ public class SectionAdapter extends BaseSectionQuickAdapter<MySection> {
```
mQuickAdapter.setEmptyView(getView());
```
#新增添加子布局多个控件的点击事件
Adapter
```
protected void convert(BaseViewHolder helper, Status item) {
helper.setOnClickListener(R.id.tweetAvatar, new OnItemChildClickListener())
.setOnClickListener(R.id.tweetName, new OnItemChildClickListener());
}
```
Activity
```
mQuickAdapter.setOnRecyclerViewItemChildClickListener(new BaseQuickAdapter.OnRecyclerViewItemChildClickListener() {
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
String content = null;
Status status = (Status) adapter.getItem(position);
switch (view.getId()) {
case R.id.tweetAvatar:
content = "img:" + status.getUserAvatar();
break;
case R.id.tweetName:
content = "name:" + status.getUserName();
break;
}
Toast.makeText(AnimationUseActivity.this, content, Toast.LENGTH_LONG).show();
}
});
```

>**持续更新!,所以推荐Star项目**
Expand Down
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Please feel free to use this.(Love can be a **Star**)
- **easily create section headers**
- **custom item view type**
- **add setEmptyView methods**
- **add item chlid click**

![demo](https://github.com/CymChad/BaseRecyclerViewAdapterHelper/blob/master/demo_res/demo.gif)
# Get it
Expand All @@ -25,7 +26,7 @@ Add it in your root build.gradle at the end of repositories:
Add the dependency
```
dependencies {
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:v1.5.5'
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:v1.5.7'
}
```

Expand Down Expand Up @@ -158,5 +159,33 @@ public class SectionAdapter extends BaseSectionQuickAdapter<MySection> {
```
mQuickAdapter.setEmptyView(getView());
```
#Use it item chlid click
Adapter
```
protected void convert(BaseViewHolder helper, Status item) {
helper.setOnClickListener(R.id.tweetAvatar, new OnItemChildClickListener())
.setOnClickListener(R.id.tweetName, new OnItemChildClickListener());
}
```
Activity
```
mQuickAdapter.setOnRecyclerViewItemChildClickListener(new BaseQuickAdapter.OnRecyclerViewItemChildClickListener() {
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
String content = null;
Status status = (Status) adapter.getItem(position);
switch (view.getId()) {
case R.id.tweetAvatar:
content = "img:" + status.getUserAvatar();
break;
case R.id.tweetName:
content = "name:" + status.getUserName();
break;
}
Toast.makeText(AnimationUseActivity.this, content, Toast.LENGTH_LONG).show();
}
});
```

#Thanks
[JoanZapata / base-adapter-helper](https://github.com/JoanZapata/base-adapter-helper)

0 comments on commit 8563fae

Please sign in to comment.