Skip to content

Commit 92afdfa

Browse files
committed
Create README.md
添加使用说明
1 parent 318ae31 commit 92afdfa

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

‎README.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# PullToRefreshLibrary
2+
支持瀑布流的下拉刷新和滑到底部加载更多
3+
基于com.handmark.pulltorefresh 和 com.etsy.android.grid.StaggeredGridView 完美实现了上拉加载更多或滑动到底部自动加载两种方式。
4+
该库引用了https://github.com/etsy/AndroidStaggeredGrid/tree/master/library 请自己下载导入。
5+
6+
#使用须知
7+
1.默认方式是上拉加载更多
8+
2.滑动到底部自动加载只需简单的两步:
9+
设置滑动监听
10+
mPullToRefreshStaggeredGridView.setOnScrollListener(this);(this 是activity 或 fragment)
11+
重写onScroll方法
12+
@Override
13+
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount){
14+
boolean lastItemVisible = (totalItemCount > 0) && (firstVisibleItem +
15+
visibleItemCount >= totalItemCount - 1);
16+
if (lastItemVisible){
17+
mPullToRefreshStaggeredGridView.setPullUpToRefreshing(mPullToRefreshStaggeredGridView);
18+
}
19+
}

0 commit comments

Comments
(0)