PullToRefreshListView
@Override
protected void onRefreshing(final boolean doScroll) {
/**
* If we're not showing the Refreshing view, or the list is empty, the
* the header/footer views won't show so we use the normal method.
*/
/*ListAdapter adapter = mRefreshableView.getAdapter();
if (!mListViewExtrasEnabled || !getShowViewWhileRefreshing() || null == adapter || adapter.isEmpty()) {
super.onRefreshing(doScroll);
return;
}*/
super.onRefreshing(false);
}
}
mPullRefreshListView.setRefreshing();如果adapter是里面的size是null 或者大小是0
这个时候 setRefreshing是不会有效果的.需要将PullToRefreshListView上面代码注释掉
还有如果在下拉到底部的时候如果需要切换下拉的模式
需要 pull_to_ref_listview.onRefreshComplete();
在setData之前,不然会一直加载状态
private void setData(String ids) {
List<Goods> list = getGoods(ids);
if (list != null && list.size() > 0) {
search_layout.setVisibility(View.VISIBLE);
if (page == 1) {
adapter.updateRefrushData(list);
} else {
adapter.updateMoreData(list);
}
int size = list.size();
if (size < PAGE_SIZE) {
pull_to_ref_listview.setMode(Mode.PULL_FROM_START);
} else {
pull_to_ref_listview.setMode(Mode.BOTH);
}
} else if (page == 1) {
mLoadingHolder.showEmpty();
} else {
pull_to_ref_listview.setMode(Mode.PULL_FROM_START);
}
}
PullToRefreshListView的更多相关文章
- PullToRefreshListView的使用
- pullToRefreshListView的简单使用
1.加入library后直接布局 library下载地址:http://pan.baidu.com/s/1dFJu8pF <com.handmark.pulltorefresh.library. ...
- PullToRefreshListView加载更多定位的解决方法
之前项目里,早起用到了PullToRefreshListView,后来一部分用到了RefreshListView,最近在做优化的时候,其中一个问题就是PullToRefreshlistView上拉加载 ...
- RecyclerView和PullToRefreshListView的对比
项目中上拉刷新和下拉加载一直都是比较常见的:以前一般都是重写ListView或直接用PullToRefreshListView的框架:最近尝试用RecyclerView来实现下拉加载上拉刷新也是不错的 ...
- ListView、PullToRefreshListView滑动加载可见item
最近用的了PullToRefreshListView框架,也在listView中加载图片,对于滑动加载可见item,网上找了一些相关文档,但都不太合适,如:http://blog.csdn.net/z ...
- Android PullToRefreshListView上拉刷新和下拉刷新
PullToRefreshListView实现上拉和下拉刷新有两个步骤: 1.设置刷新方式 pullToRefreshView.setMode(PullToRefreshBase.Mode.BOTH) ...
- Android ScrollView+ViewPager+PullToRefreshListView
想达到此界面的风格 然后ViewPage里面第一个Fragment是一个瀑布流 这个瀑布流要有加载跟多 在ScrollView中,嵌套ViewPager,在ViewPager的每页使用Fragment ...
- PullToRefreshListView调用onRefreshComplete方法 无法取消刷新的bug
我们在使用框架: PullToRefreshListView 实现下拉或者上拉加载时候,可能在上拉 完成时候,调用onRefreshComplete方法去 停止 刷新操作,但是,可能无效,测试产生 ...
- 95秀-PullToRefreshListView 示例
正在加载.暂无数据页面 public class RefreshGuideTool { private RelativeLayout rl_loading_guide;//整个View ...
- PullToRefreshListView组件的OnItemClickListener中的position下标问题
/** * Pass-through method for {[url=home.php?mod=space&uid=91636]@link[/url] PullToRefreshBase#g ...
随机推荐
- sessionStorage,localStorage,cookies
1 HTML5的Storage主要分为两种:localStorage与sessionStorage,这两者主要在生命周期上有较明显的差别,localStorage的生命周期较长,原则上要等到透过Jav ...
- MySQL的分页技术总结
利用子查询示例: SELECT * FROM your_table WHERE id <= (SELECT id FROM your_table ORDER BY id desc LIMIT ( ...
- python xml包 xml.etree.ElementTree使用记录
19.7.1 教程 这是一个简短的教程使用xml.etree.ElementTree(简称为et).目标是展示一些构建模块和模块的基本概念 9.7.1.1. XML tree and elements ...
- github 换行符自动转换功能
最近想把自己的一个Qt工程同步到github上,但是当自己把代码从仓库中签出来的时候编译的时候总是出现一些很奇葩的错误,一开始以为是源文件编码的问题,改了编码以后问题还是没有解决,我比较了一下两个工程 ...
- VUE之使用百度地图API
利用vue创建点餐系统,在点餐系统中需要知道商家地址信息,这时就需要借用百度地图API. 步骤一:申请百度地图密钥: 步骤二:在index.html中添加百度地图JavaScript API接口: & ...
- mooon模板的automake、autoconf、m4和libtool版本信息
autoconf --version autoconf (GNU Autoconf) 2.59 automake --version automake (GNU automake) 1.9.6 m4 ...
- hdu1053
#include<iostream> #include<algorithm> using namespace std; bool cmp(int a,int b) { retu ...
- Typography 文字排版
标签的语义 1. 含语义的标签 2. 不含语义, 但是具有样式的class <h1></h1> <p class="h1"></p> ...
- (linux)修改MySQL密码方法
1,在/etc/my.cnf末尾 加入skip-grant-tables,保存,跳过身份验证. 2,重启MySql,使刚才修改的配置生效. 3,终端输入mysql,然后再输入use mysql; 4 ...
- Ruby and gnuplot installation on Ubuntu 16.04
sudo apt install ruby gnuplot