Android Phoenix Pull-to-Refresh炫酷装逼

For a working implementation, Have a look at the Sample Project - sample
老规矩直接看效果图吧是不是听挺炫酷的!这是官方的一个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

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值