Android Phoenix Pull-to-Refresh炫酷装逼
2017-01-04 23:43
246 查看
For a working implementation, Have a look at the Sample Project - sample
老规矩直接看效果图吧是不是听挺炫酷的!这是官方的一个demo效果!
Include the library as local library project.
添加Gradle
Sync一下ok
Include the PullToRefreshView widget in your layout.
初始化
布局文件
In your onCreate method refer to the View and setup OnRefreshListener.
Customization
To customize drawables you can change:
sun.png - Sun image
sky.png - background image
如果您想在自己的app加一个这样的动画请点击这里Android Phoenix Pull-to-Refresh
老规矩直接看效果图吧是不是听挺炫酷的!这是官方的一个demo效果!
Include the library as local library project.
添加Gradle
compile 'com.yalantis:phoenix:1.2.3'
Sync一下ok
Include the PullToRefreshView widget in your layout.
初始化
PullToRefreshView mPullToRefreshView;
布局文件
<com.yalantis.phoenix.PullToRefreshView android:id="@+id/pull_to_refresh" android:layout_width="match_parent" android:layout_height="match_parent"> <ListView android:id="@+id/list_view" android:divider="@null" android:dividerHeight="0dp" android:layout_width="match_parent" android:layout_height="match_parent" /> </com.yalantis.phoenix.PullToRefreshView>
In your onCreate method refer to the View and setup OnRefreshListener.
mPullToRefreshView = (PullToRefreshView) findViewById(R.id.pull_to_refresh); mPullToRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() { @Override public void onRefresh() { mPullToRefreshView.postDelayed(new Runnable() { @Override public void run() { mPullToRefreshView.setRefreshing(false); } }, 3000);//3秒刷新 } });
Customization
To customize drawables you can change:
sun.png - Sun image
sky.png - background image
如果您想在自己的app加一个这样的动画请点击这里Android Phoenix Pull-to-Refresh
相关文章推荐
- Android ListView自动加载 Android ListView pull up to refresh.
- Android UI开发第二十一篇——下拉刷新列表实现(pull to refresh)
- Android 开发学习手记(三):关于PullToRefresh的setOnTouchListener()无效的问题。
- Android-PullToRefresh 库的使用
- 下拉更新列表Android-PullToRefresh
- Android ListView自动加载 Android ListView pull up to refresh.
- AndroidPullToRefresh拉动效果配置
- Android 开发学习手记(一):更改PullToRefresh的标签
- Android-PullToRefresh(一)
- android 引用 project以及下拉刷新开源类库Android-PullToRefresh 的使用
- Android UI开发第二十一篇——下拉刷新列表实现(pull to refresh)
- android下拉刷新列表实现(pull to refresh)
- chrisbanes / Android-PullToRefresh 控件使用(一)
- Android 开发学习手记(二):PullToRefresh如何滚动到最顶部?以及PullToRefresh的实质。
- Android UI开发第二十一篇——下拉刷新列表实现(pull to refresh)
- Android UI开发第二十一篇——下拉刷新列表实现(pull to refresh)
- Android 下拉刷新控件 推荐之 chrisbanes / Android-PullToRefresh
- android PullToRefreshListView 4.1上 无效果
- Android-PullToRefresh 使用心得
- 开源项目:Android-PullToRefresh