Skip to content

Commit a217888

Browse files
authored
Merge pull request #14 from AlanCheen/develop
release 0.9.1
2 parents b93d2e0 + ead8156 commit a217888

File tree

6 files changed

+21
-24
lines changed

6 files changed

+21
-24
lines changed

README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Flap
22

3-
[![Download](https://api.bintray.com/packages/alancheen/maven/flap/images/download.svg?version=0.9.0)](https://bintray.com/alancheen/maven/flap/0.9.0/link) [![Build Status](https://travis-ci.org/AlanCheen/Flap.svg?branch=master)](https://travis-ci.org/AlanCheen/Flap) ![RecyclerView](https://img.shields.io/badge/RecyclerView-28.0.0-brightgreen.svg) ![API](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat) [![license](https://img.shields.io/github/license/AlanCheen/Flap.svg)](./LICENSE)
3+
[![Download](https://api.bintray.com/packages/alancheen/maven/flap/images/download.svg?version=0.9.1)](https://bintray.com/alancheen/maven/flap/0.9.1/link) [![Build Status](https://travis-ci.org/AlanCheen/Flap.svg?branch=master)](https://travis-ci.org/AlanCheen/Flap) ![RecyclerView](https://img.shields.io/badge/RecyclerView-28.0.0-brightgreen.svg) ![API](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat) [![license](https://img.shields.io/github/license/AlanCheen/Flap.svg)](./LICENSE) [![Author](https://img.shields.io/badge/%E4%BD%9C%E8%80%85-%E7%A8%8B%E5%BA%8F%E4%BA%A6%E9%9D%9E%E7%8C%BF-blue.svg)](https://github.com/AlanCheen) [![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/AlanCheen/Flap/pulls)
44

55
**[WIP]WARNING: Flap is still under development.**
66

7+
8+
## What is Flap
9+
710
`Flap` is a library that makes `RecyclerView.Adapter` much more easier to use , by keeping you from writing boilerplate codes and providing lots advance features , especially when you have to support lots of different type items.
811

912
Have a try !
@@ -127,25 +130,19 @@ Check [Releases](https://github.com/AlanCheen/Flap/releases) for details.
127130

128131
## Feature List
129132

130-
- [ ] Loadmore feature;
131-
- [ ] Empty and error status;
133+
- [ ] Support load more feature(maybe);
134+
- [ ] Support empty and error status (maybe);
132135
- [ ] Support AsyncListDiffer feature;
133-
- [ ] Support setup global RecycledViewPool;
136+
- [x] Support setup global RecycledViewPool;
134137
- [x] Support Lifecycle for FlapItem;
135138
- [x] Decouple RecyclerView.Adapter and ViewHolder's creating and binding logic.
136139

137140
## Contact Me
138141

139-
Any feedback could be helpful , thanks.
142+
Any feedback would be helpful , feel free to contact me , thanks.
140143

141-
I'm Fitz , an Engineer working at Alibaba living in China .
144+
I'm Fitz , an Engineer working at Alibaba in China .
142145

143146
Follow me on :
144147

145-
- 微信公众号:chengxuyifeiyuan (程序亦非猿的拼音)
146-
- [知乎](https://www.zhihu.com/people/yifeiyuan/activities)
147-
- [新浪微博](https://www.weibo.com/alancheeen)
148-
- [简书](https://www.jianshu.com/u/ec59bd61433a)
149-
- [掘金](https://juejin.im/user/558cc8dae4b0de86abc9cfda)
150-
151-
Feel free to contact me.
148+
- 微信公众号:chengxuyifeiyuan (程序亦非猿的拼音)

app/src/main/java/me/yifeiyuan/flapdev/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private void createAdvanceTestCase(final RecyclerView recyclerView) {
4949
List<Object> models = mockModels();
5050

5151
FlapAdapter adapter = new FlapAdapter();
52-
adapter.setUseGlobalPool(true)
52+
adapter.setUseFlapItemPool(true)
5353
.setLifecycleEnable(true)
5454
.setLifecycleOwner(this)
5555
.setModels(models);

flap/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies {
3333

3434
apply plugin: "guru.stefma.bintrayrelease"
3535

36-
version = "0.9.0"
36+
version = "0.9.1"
3737
group = "me.yifeiyuan.flap"
3838
androidArtifact {
3939
artifactId = "flap"

flap/src/main/java/me/yifeiyuan/flap/FlapAdapter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class FlapAdapter extends RecyclerView.Adapter<FlapItem> {
2727

2828
private boolean lifecycleEnable = true;
2929

30-
private boolean useGlobalPool = true;
30+
private boolean useFlapItemPool = true;
3131

3232
@NonNull
3333
@Override
@@ -74,7 +74,7 @@ public void onAttachedToRecyclerView(@NonNull final RecyclerView recyclerView) {
7474
if (recyclerView.getContext() instanceof LifecycleOwner && lifecycleOwner == null) {
7575
setLifecycleOwner((LifecycleOwner) recyclerView.getContext());
7676
}
77-
if (useGlobalPool) {
77+
if (useFlapItemPool) {
7878
recyclerView.setRecycledViewPool(flap.getFlapItemPool());
7979
}
8080
}
@@ -140,8 +140,8 @@ public List<?> getModels() {
140140
*
141141
* @return this
142142
*/
143-
public FlapAdapter setUseGlobalPool(final boolean enable) {
144-
this.useGlobalPool = enable;
143+
public FlapAdapter setUseFlapItemPool(final boolean enable) {
144+
this.useFlapItemPool = enable;
145145
return this;
146146
}
147147

flap/src/main/java/me/yifeiyuan/flap/FlapItem.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@ protected final <V extends View> V findViewById(@IdRes int viewId) {
4444
}
4545

4646
/**
47-
* @param flapAdapter
47+
* @param flapAdapter The adapter which is using your FlapItem.
4848
*
4949
* @see FlapAdapter#onViewAttachedToWindow(FlapItem)
5050
*/
5151
protected void onViewAttachedToWindow(final FlapAdapter flapAdapter) {
5252
}
5353

5454
/**
55-
* @param flapAdapter
55+
* @param flapAdapter The adapter which is using your FlapItem.
5656
*
5757
* @see FlapAdapter#onViewDetachedFromWindow(FlapItem)
5858
*/
5959
protected void onViewDetachedFromWindow(final FlapAdapter flapAdapter) {
6060
}
6161

6262
/**
63-
* @param flapAdapter
63+
* @param flapAdapter The adapter which is using your FlapItem.
6464
*
6565
* @see FlapAdapter#onViewRecycled(FlapItem)
6666
*/
@@ -69,7 +69,7 @@ protected void onViewRecycled(final FlapAdapter flapAdapter) {
6969
}
7070

7171
/**
72-
* @param flapAdapter
72+
* @param flapAdapter The adapter which is using your FlapItem.
7373
*
7474
* @return
7575
* @see FlapAdapter#onFailedToRecycleView(FlapItem)

flap/src/main/java/me/yifeiyuan/flap/FlapItemPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* A global RecycledViewPool that can be shared among RecyclerViews , which is enabled by default.
99
*
10-
* @see FlapAdapter#setUseGlobalPool(boolean)
10+
* @see FlapAdapter#setUseFlapItemPool(boolean)
1111
*/
1212
public class FlapItemPool extends RecyclerView.RecycledViewPool {
1313

0 commit comments

Comments
 (0)