This library is contained by CUBE-SDK
: https://github.com/etao-open-source/cube-sdk. The Demo is HERE: https://github.com/liaohuqiu/android-cube-app .
<dependency>
<groupId>in.srain.cube</groupId>
<artifactId>grid-view-with-header-footer</artifactId>
<type>jar</type>
<version>1.0.9</version>
</dependency>
compile 'in.srain.cube:grid-view-with-header-footer:1.0.9'
GridViewWithHeaderAndFooter gridView = (GridViewWithHeaderAndFooter) v.findViewById(R.id.ly_image_list_grid);
LayoutInflater layoutInflater = LayoutInflater.from(this);
View headerView = layoutInflater.inflate(R.layout.test_header_view, null);
View footerView = layoutInflater.inflate(R.layout.test_footer_view, null);
gridView.addHeaderView(headerView);
gridView.addFooterView(footerView);
since 1.0.4
public void tryToScrollToBottomSmoothly();
public void tryToScrollToBottomSmoothly(int duration);
When scroll to the bottom, you may need to show the footer view when loading data from server.
mFooterView.setVisibility(View.VISIBLE);
mGridView.post(new Runnable() {
@Override
public void run() {
mGridView.tryToScrollToBottomSmoothly(100);
}
});
mGridView.postDelay(new Runnable() {
@Override
public void run() {
// load more data
}
}, 150);
Apache 2
Please fell free to contact me if there is any problem when using the library.
- [email protected]
- twitter: https://twitter.com/liaohuqiu
- weibo: http://weibo.com/liaohuqiu
- QQ tribe: 271918140