优酷5.01 上拉刷新SwipeRefreshLayout
来源:互联网 发布:mac怎么编辑html 编辑:程序博客网 时间:2024/05/02 18:04
原创文章,欢迎转载。转载请注明:http://blog.csdn.net/seven2729/article/details/47979263
最近更新优酷发现好炫的刷新,以为是自定义的,好看又酷,找了半天。原来是系统自带的,碉堡了。有兴趣的瞅瞅吧!
布局与viewpager的有点像,贴点代码
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/but_two_style"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="11dp"
android:text="two_style"/>
<ListView
android:id="@+id/listview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp" />
</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>
定义布局
private SwipeRefreshLayout mSwipeLayout;
在oncreat里面设置监听,太简单就不说了
mSwipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container);
mSwipeLayout.setOnRefreshListener(this);
// 设置下拉时的颜色
mSwipeLayout.setColorSchemeResources(R.color.color_bule,
R.color.color_bule, R.color.color_bule, R.color.color_bule);
/**
* do sth onRefresh
*/
public void onRefresh() {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mSwipeLayout.setRefreshing(false);
}
}, 5000);
}
要是有需要的可以点击 下载源码
另附带之前上传的上拉刷新 资源
原创文章,欢迎转载。转载请注明:http://blog.csdn.net/seven2729/article/details/47979263
- 优酷5.01 上拉刷新SwipeRefreshLayout
- SwipeRefreshLayout 上拉刷新和下拉刷新
- SwipeRefreshLayout 上拉加载与下拉刷新
- SwipeRefreshLayout+RecyclerView实现上拉刷新
- SwipeRefreshLayout实现上拉下拉刷新
- SwipeRefreshLayout下拉刷新和上拉加载
- 继承SwipeRefreshLayout实现上拉刷新
- SwipeRefreshLayout上拉加载 下拉刷新
- swipeRefreshLayout 上拉加载 下拉刷新
- Android swiperefreshlayout 实现上拉刷新 加载
- SwipeRefreshLayout下拉刷新上拉加载详解
- SwipeRefreshLayout + RecyclerView 实现 上拉刷新 和 下拉刷新
- SwipeRefreshLayout + RecyclerView 实现 上拉刷新 和 下拉刷新
- SwipeRefreshLayout + RecyclerView 实现 上拉刷新 和 下拉刷新
- SwipeRefreshLayout + RecyclerView 实现 上拉刷新 和 下拉刷新
- SwipeRefreshLayout + RecyclerView 实现 上拉刷新 和 下拉刷新
- SwipeRefreshLayout + RecyclerView 实现 上拉刷新 和 下拉刷新
- SwipeRefreshLayout + RecyclerView 实现 上拉刷新 和 下拉刷新
- MyBatis学习 之 二、SQL语句映射文件(2)增删改查、参数、缓存
- Android meta-data(未完成)
- cuda之thread,block,gird详解
- 一条建议搞定时间管理
- CODE COMPLETE 2e Chapter 11.1
- 优酷5.01 上拉刷新SwipeRefreshLayout
- 四种强制类型转换的总结(const_cast、static_cast、dynamic_cast、reinterpreter_cast)
- java AES加密解密方法
- Android V7 RecyclerView 使用完全解析
- 【BZOJ2555】SubString
- 数据结构之红黑树——BST的变种2
- Java中各种正则表达式验证[邮箱、密码前后空格、日期合法、IP]
- QObject是QT所有类的基类
- MyBatis学习 之 三、动态SQL语句