Recyclerview下拉刷新_Ultimate下拉刷新动画开源框架
2016-11-04 14:57:30  By: dwtedx

分享一个Android的下拉刷新的Demo、注意:这不是一般的下拉刷新效果、是带有很炫酷的动画的刷新效果、Demo是用的Recyclerview做为刷新的内容的承载、当你下拉的时候、Demo中包括一系列添加Item、删除Item等动画效果、还有异步的刷新等功能、非常强大的一个Demo、下面是部分效果图片

recyclerview 下拉刷新


所有动画列表枚举

enum Type {
    FadeIn(new FadeInAnimator(new OvershootInterpolator(1f))),
    FadeInDown(new FadeInDownAnimator(new OvershootInterpolator(1f))),
    FadeInUp(new FadeInUpAnimator(new OvershootInterpolator(1f))),
    FadeInLeft(new FadeInLeftAnimator(new OvershootInterpolator(1f))),
    FadeInRight(new FadeInRightAnimator(new OvershootInterpolator(1f))),
    Landing(new LandingAnimator(new OvershootInterpolator(1f))),
    ScaleIn(new ScaleInAnimator(new OvershootInterpolator(1f))),
    ScaleInTop(new ScaleInTopAnimator(new OvershootInterpolator(1f))),
    ScaleInBottom(new ScaleInBottomAnimator(new OvershootInterpolator(1f))),
    ScaleInLeft(new ScaleInLeftAnimator(new OvershootInterpolator(1f))),
    ScaleInRight(new ScaleInRightAnimator(new OvershootInterpolator(1f))),
    FlipInTopX(new FlipInTopXAnimator(new OvershootInterpolator(1f))),
    FlipInBottomX(new FlipInBottomXAnimator(new OvershootInterpolator(1f))),
    FlipInLeftY(new FlipInLeftYAnimator(new OvershootInterpolator(1f))),
    FlipInRightY(new FlipInRightYAnimator(new OvershootInterpolator(1f))),
    SlideInLeft(new SlideInLeftAnimator(new OvershootInterpolator(1f))),
    SlideInRight(new SlideInRightAnimator(new OvershootInterpolator(1f))),
    SlideInDown(new SlideInDownAnimator(new OvershootInterpolator(1f))),
    SlideInUp(new SlideInUpAnimator(new OvershootInterpolator(1f))),
    OvershootInRight(new OvershootInRightAnimator(1.0f)),
    OvershootInLeft(new OvershootInLeftAnimator(1.0f));

    private BaseItemAnimator mAnimator;

    Type(BaseItemAnimator animator) {
        mAnimator = animator;
    }

    public BaseItemAnimator getAnimator() {
        return mAnimator;
    }
}


xml引用方式

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".loadmoredemo.BasicFunctions">

    <android.support.v7.widget.Toolbar
        android:id="@ id/tool_bar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="#30f2e0"
        app:contentInsetEnd="0dp"
        app:contentInsetLeft="0dp"
        app:contentInsetRight="0dp"
        app:contentInsetStart="0dp">

        <include layout="@layout/toolbar_loadmore" />

    </android.support.v7.widget.Toolbar>

    <com.marshalchen.ultimaterecyclerview.UltimateRecyclerView
        android:id="@ id/ultimate_recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="?attr/actionBarSize"
        app:recyclerviewClipToPadding="true"
        app:recyclerviewDefaultSwipeColor="@array/google_colors"
        app:recyclerviewFloatingActionView="@layout/floating_view"
        app:recyclerviewScrollbars="vertical" />
</FrameLayout>


recyclerview 下拉刷新动画源代码下载链接: recyclerview开源框架 密码: n8tk

若资源对你有帮助、浏览后有很大收获、不妨小额打赏我一下、你的鼓励是维持我不断写博客最大动力

想获取DD博客最新代码、你可以扫描下方的二维码、关注DD博客微信公众号(ddblogs)

或者你也可以关注我的新浪微博、了解DD博客的最新动态:DD博客官方微博(dwtedx的微博)

如对资源有任何疑问或觉得仍然有很大的改善空间、可以对该博文进行评论、希望不吝赐教

为保证及时回复、可以使用博客留言板给我留言: DD博客留言板(dwtedx的留言板)

感谢你的访问、祝你生活愉快、工作顺心、欢迎常来逛逛


快速评论


技术评论

  • 该技术还没有评论、赶快抢沙发吧...
DD记账
top
+