Skip to content

Refresh Animation

In the previous chapter, we introduced the integration of SmartRefreshLayout in BRV to achieve pull-down refresh and pull-up loading. The following demonstrates custom refresh animations.

Disabling Pull-Up Loading Animation

Disabling the animation does not affect the original preloading functionality.

Global Configuration:

SmartRefreshLayout.setDefaultRefreshFooterCreator { context, layout ->
    layout.setFooterHeight(0F)
    val classicsFooter = ClassicsFooter(context)
    classicsFooter.visibility = View.GONE
    classicsFooter
}

Singleton Configuration, modify XML layout, or modify programmatically:

<com.drake.brv.PageRefreshLayout
    android:id="@+id/page"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:srlFooterHeight="0dp">

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/rv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />

    <com.scwang.smart.refresh.footer.ClassicsFooter
        android:layout_width="match_parent"
        android:layout_height="0dp" />

</com.drake.brv.PageRefreshLayout>

Custom Refresh Animations

SmartRefresh comes with 7 animation dependency libraries that can be referenced/modified in the source code or used directly:

implementation  'io.github.scwang90:refresh-header-classics:2.0.5'    // Classic refresh header
implementation  'io.github.scwang90:refresh-header-radar:2.0.5'       // Radar refresh header
implementation  'io.github.scwang90:refresh-header-falsify:2.0.5'     // Falsify refresh header
implementation  'io.github.scwang90:refresh-header-material:2.0.5'    // Google refresh header
implementation  'io.github.scwang90:refresh-header-two-level:2.0.5'   // Two-level refresh header
implementation  'io.github.scwang90:refresh-footer-ball:2.0.5'        // Ball pulse loading
implementation  'io.github.scwang90:refresh-footer-classics:2.0.5'    // Classic loading

For more information, please refer to the SmartRefreshLayout homepage.

Personal Homepage Weibo List
Food and Dining Personal Center
Delivery DropBox
Refresh-your-delivery [Dropbox-

Refresh](https://dribbble.com/shots/3470499-DropBox-Refresh) |

BezierRadar BezierCircle
Pull To Refresh Pull Down To Refresh
FlyRefresh Classics
FlyRefresh ClassicsHeader
Phoenix Taurus
Yalantis/Phoenix Yalantis/Taurus
BattleCity HitBlock
FunGame/BattleCity FunGame/HitBlock
WaveSwipe Material
WaveSwipeRefreshLayout MaterialHeader
StoreHouse WaterDrop
CRefreshLayout WaterDrop