A global random configuration head , drop-down refresh and loadMore library;
- support refresh and loadMore
- support Timeout automatically complete the action
- support nest scroll
- support All the View:ImageView,FrameLayout,ListView, GridView, ScrollView, WebView...
- support Global configuration (HeaderView's configuration is here,so not have xml's property),and Independent changes
- support auto refresh
- support header fixed
- support refresh's Trigger position
- support drop-down's position map(as IResistance)
- support add many childs。because extends FrameLayout(not must be one,because more changeful)
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Step 2. Add the dependency
compile 'com.github.luhaoaimama1:ZRefreshLayout:Latest release'
not anroidX version compile 'com.github.luhaoaimama1:ZRefreshLayout:1.0.19' branch:notAndroidx
Step 3: you need provide
because compileOnly 'androidx.recyclerview:recyclerview:1.0.0'
Config.build()
.setHeader(new MeterialHead())
.setFooter(new MeterialFooter())
.setResistance(new Damping())
.writeLog(true)
.perform();
refresh.setIHeaderView(new SinaRefreshHeader());
refresh.setHeadPin(ZRefreshLayout.HeadPin.PIN)
refresh.autoRefresh(haveAnimate)
refresh complete ,Remember to use:zRefreshLayout.refreshComplete();
refresh.setPullListener(new ZRefreshLayout.PullListener() {
@Override
public void refresh(final ZRefreshLayout zRefreshLayout) {
tv.postDelayed(new Runnable() {
@Override
public void run() {
tv.setText("刷新完毕:" + i++);
zRefreshLayout.refreshComplete();
}
}, 500);
}
});
if not setLoadMoreListener,not have loadMore feature;
loadMore complete ,Remember to use:zRefreshLayout.loadMoreComplete();
refresh.setPullListener(new ZRefreshLayout.PullListener() {
@Override
public void refresh(final ZRefreshLayout zRefreshLayout) {
tv.postDelayed(new Runnable() {
@Override
public void run() {
tv.setText("刷新完毕:" + i++);
zRefreshLayout.refreshComplete();
}
}, 500);
}
});
HeadView and FooterView 's custom and More advanced features,please see Wiki Document;;
https://github.com/lcodecorex/TwinklingRefreshLayout
https://github.com/tuesda/CircleRefreshLayout
https://github.com/android-cjj/Android-MaterialRefreshLayout
https://github.com/desmond1121/Android-Ptr-Comparison
https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh