Swiperefreshlayout

Implement the swipe-to-refresh UI pattern.
Latest Update Stable Release Release Candidate Beta Release Alpha Release
July 22, 2020 1.1.0 - - 1.2.0-alpha01

Declaring dependencies

To add a dependency on SwipeRefreshLayout, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the dependencies for the artifacts you need in the build.gradle file for your app or module:

Groovy

dependencies {
    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
}

Kotlin

dependencies {
    implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
}

For more information about dependencies, see Add build dependencies.

Feedback

Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.

Create a new issue

See the Issue Tracker documentation for more information.

Version 1.2.0

Version 1.2.0-alpha01

July 22, 2020

androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01 is released. Version 1.2.0-alpha01 contains these commits.

Bug Fixes

  • requestDisallowInterceptTouchEvent(boolean) now honors the request like any other ViewGroup. While strongly discouraged, new behavior can be disabled with setLegacyRequestDisallowInterceptTouchEventEnabled. (I968da, b/141855018)

Version 1.1.0

Version 1.1.0

June 24, 2020

androidx.swiperefreshlayout:swiperefreshlayout:1.1.0 is released. Version 1.1.0 contains these commits.

Major changes since 1.0.0

  • SwipeRefreshLayout now implements NestedScrollingChild3 and NestedScrollingParent3.

Version 1.1.0-rc01

April 15, 2020

androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-rc01 is released with no changes since 1.1.0-beta01. Version 1.1.0-rc01 contains these commits.

Version 1.1.0-beta01

March 4, 2020

androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-beta01 is released with no changes since 1.1.0-alpha03. Version 1.1.0-beta01 contains these commits.

Version 1.1.0-alpha03

October 9, 2019

androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha03 is released. Version 1.1.0-alpha03 contains these commits.

New features

  • We have a new style attribute R.styleable.SwipeRefreshLayout_swipeRefreshLayoutProgressSpinnerBackgroundColorto set the background color of the progress indicator. (aosp/931124)

API changes

  • requestDisallowInterceptTouchEvent(boolean) now always propagates up to its parents. While strongly discouraged, new behavior can be disabled with setLegacyRequestDisallowInterceptTouchEventEnabled. (aosp/1108540)

Bug fixes

  • Fixed issue with nested scrolling where SwipeRefreshLayout has a scrollable parent (e.g. ViewPager2) and a scrollable child. (b/138314213)

Version 1.1.0-alpha02

July 2, 2019

androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02 is released. The commits included in this version can be found here.

Bug fixes

  • Implemented saving and restoring of the refreshing state of SwipeRefreshLayout
  • Fixed usability bug when SwipeRefreshLayout is embedded in a RecyclerView

Version 1.1.0-alpha01

December 3, 2018

API changes

  • aosp/737631: SwipeRefreshLayout now implements NestedScrollingChild3 and NestedScrollingParent3, enabling nested scrolling 3 parents and children to pass consumed nested scrolling distance information through SwipeRefreshLayout. If developer code currently overrides SwipeRefreshLayout.onNestedScroll(View, int, int, int, int, int), it will likely no longer be called and SwipeRefreshLayout.onNestedScroll(View, int, int, int, int, int, int[]) should be overridden instead. Likewise, SwipeRefreshLayout.dispatchNestedScroll(int, int, int, int, int[], int) will likely no longer be called and SwipeRefreshLayout.dispatchNestedScroll(int, int, int, int, int[], int, int[]) should be overridden instead.