- Notifications
You must be signed in to change notification settings - Fork0
Pull to loadMore for Android .Support All Views
License
NotificationsYou must be signed in to change notification settings
zhangman523/LoadMoreViewLayout
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
GitHub :https://github.com/zhangman523
Blog :https://zhangman523.cn
这个项目是作为Ultra Pull To Refresh 的上拉加载补充功能。
支持所有的View:
ListView、GridView、RecyclerView、ScrollView、WebView、FrameLayout、RelativeLayout等
- 点击加载更多
- 加载失败 点击重试
Maven 依赖
<dependency> <groupId>zhangman.github.loadmore</groupId> <artifactId>loadmore</artifactId> <version>1.0.1</version> <type>pom</type></dependency>
gradle 配置
compile 'zhangman.github.loadmore:loadmore:1.0.1'有3个参数可配置:
阻尼系数
默认:
1.7f, 越大,感觉上拉越吃力回弹延时
默认:
300,回弹到底部所用的时间上拉加载/点击加载
默认为上拉加载
<zhangman.github.loadmore.LoadMoreViewContainerandroid:id="@+id/load_more_container"android:layout_width="match_parent"android:layout_height="match_parent"app:load_more_auto_load_more="false"app:load_more_resistance="1.7"app:load_more_duration_to_close="300" > <FrameLayoutandroid:id="@+id/frameLayout"android:layout_width="match_parent"android:layout_height="match_parent"android:clickable="true"android:focusable="true" > <TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center"android:text="FameLayout" /> </FrameLayout> </zhangman.github.loadmore.LoadMoreViewContainer>
mLoadMoreViewContainer.setDurationToClose(300);mLoadMoreViewContainer.setAutoLoadMore(true);mLoadMoreViewContainer.setResistance(1.7f);
通过LoadMoreHandler 触发加载更多
publicinterfaceLoadMoreHandler {/** * 需要加载数据时触发 * * @param loadMoreContainer */voidonLoadMore(LoadMoreContainerloadMoreContainer);}
例子:
mLoadMoreViewContainer.useDefaultFooter();//加载数据成功后调用mLoadMoreViewContainer.loadMoreFinish(false,true);mLoadMoreViewContainer.setLoadMoreHandler(newLoadMoreHandler() {@OverridepublicvoidonLoadMore(finalLoadMoreContainerloadMoreContainer) {mLoadMoreViewContainer.postDelayed(newRunnable() {@Overridepublicvoidrun() {loadMoreContainer.loadMoreFinish(false,true); } },1000); } });
自定义View 实现LoadMoreUIHandler 然后调用
mLoadMoreViewContainer.setLoadMoreView(footerView);mLoadMoreViewContainer.setLoadMoreView(footerView);mLoadMoreViewContainer.setLoadMoreUIHandler(footerView);
参考LoadMoreDefaultFooterView
About
Pull to loadMore for Android .Support All Views
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published



