Recyclerview

Latest Update Current Stable Release Next Release Candidate Beta Release Alpha Release
December 4, 2019 1.1.0 - - -

Declaring dependencies

To add a dependency on RecyclerView, 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:

dependencies {
    implementation "androidx.recyclerview:recyclerview:1.1.0"
    // For control over item selection of both touch and mouse driven selection
    implementation "androidx.recyclerview:recyclerview-selection:1.1.0-beta01"
}

For more information about dependencies, see Add build dependencies.

Version 1.1.0

Version 1.1.0

November 20, 2019

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

Important changes since 1.0.0

  • PagerSnapHelper and LinearSnapHelper now take padding of RecyclerView into account regardless of the value of clipToPadding (b/139452422, b/139012032, aosp/1103182, aosp/1106715, aosp/1130728)
  • RecyclerView.setLayoutTransition(LayoutTransition) is formally deprecated and will throw an IllegalArgumentException when called with a non null value. Use RecyclerView.setItemAnimator(ItemAnimator) instead. (aosp/839414)
  • aosp/723649: RecyclerView now implements NestedScrollingChild3, enabling it to be informed of when all its nested scrolling parents have stopped consuming nested scrolling distances. If developer code currently overrides RecyclerView.onNestedScroll(View, int, int, int, int, int), it will likely no longer be called and RecyclerView.onNestedScroll(View, int, int, int, int, int, int[]) should be overridden instead.
  • RecyclerView now has a default style attribute: recyclerViewStyle, which allows setting of the default style in your theme
  • ViewCompat accessibility actions API no longer breaks RecyclerView ItemDelegate.
  • LinearLayoutManager.calculateExtraLayoutSpace(RecyclerView.State, int[]) can be overridden to customize how much extra layout space should be added to either side of the associated RecyclerView. (aosp/931259)
  • Added a new overload of smoothScrollBy: RecyclerView#smoothScrollBy(@Px int, @Px int, @Nullable Interpolator, int duration), that allows you to specify a duration in milliseconds for how long the animation should take. (aosp/952807)

Version 1.1.0-rc01

October 23, 2019

androidx.recyclerview:recyclerview:1.1.0-rc01 is released. Version 1.1.0-rc01 contains these commits.

Bug fixes

  • Fixed an "Application Not Responding" when overriding RecyclerViewAccessibilityDelegate.ItemDelegate (aosp/1138057, aosp/1133434)

Version 1.1.0-beta05

October 9, 2019

androidx.recyclerview:recyclerview:1.1.0-beta05 is released. Version 1.1.0-beta05 contains these commits.

API changes

  • Following up on aosp/1106715 and aosp/1103182, now LinearSnapHelper and PagerSnapHelper will return the view that is in the center of the RecyclerView’s bounds, minus padding, despite the value of clipToPadding. (aosp/1130728)

Bug fixes

  • Fixed an issue where RecyclerView was generating duplicate accessibility nodes for children of RecyclerView. (aosp/1130618)
  • Fixed an issue where Virtual Accessibility Hierarchies in RecyclerViews didn't work.
  • Fixed an issue where custom ItemDelegates weren’t used.

Version 1.1.0-beta04

September 5, 2019

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

Bug fixes

  • PagerSnapHelper and LinearSnapHelper now take padding of RecyclerView into account regardless of the value of clipToPadding (b/139452422, b/139012032, aosp/1103182, aosp/1106715)
  • Fixed a bug where RecyclerView was not disallowing touch intercept when nested pre-scrolling caused a NestedScrollingParent to scroll (b/138668210, aosp/1105373). This benefits libraries such as ViewPager2.
  • RecyclerView now consistently goes to SCROLL_STATE_DRAGGING before nested pre scrolls are dispatched (aosp/1105373)
  • Nested pre-scrolling is no longer performed before the gesture exceeds touch slop (b/139530818, aosp/1105373)
  • dx and dy arguments dispatched to nested pre-scrolls are zeroed when RecyclerView can’t scroll in that direction (aosp/1105373)

Version 1.1.0-beta03

August 15, 2019

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

API changes

  • RecyclerView now dispatches scroll distances via View.onScrollChanged(int l, int t, int oldl, int oldt) such that accessibility services are notified about scroll changes accurately. (aosp/1007823)

Bug fixes

  • Fixed a major bug stack overflow bug related to RecyclerView and accessibility. (aosp/1099577)

Version 1.1.0-beta02

August 7, 2019

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

New features

  • RecyclerView now has a default style attribute: recyclerViewStyle, which allows setting of the default style in your theme

Bug fixes

  • Fixed a bug where RecyclerView was not disallowing touch intercept when scrolling it caused a NestedScrollingParent to scroll. (b/131115697, aosp/1055911)

Version 1.1.0-beta01

July 2, 2019

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

New features

  • RecyclerView now participates in nested scrolling when a scroll is initiated via accessibility events. (aosp/973584)

Version 1.1.0-alpha06

June 5, 2019

androidx.recyclerview:recyclerview:1.1.0-alpha06 and androidx.recyclerview:recyclerview-selection:1.1.0-alpha06 are released. The commits included in this version can be found here.

New features

  • Added a new overload of smoothScrollBy: RecyclerView#smoothScrollBy(@Px int, @Px int, @Nullable Interpolator, int duration), that allows you to specify a duration in milliseconds for how long the animation should take. (aosp/952807)

API changes

  • GridLayoutManager and StaggeredGridLayoutManager no longer automatically label full span items as headers for accessibility purposes (aosp/969703)
  • Preserve order of selection (by creation time) in recyclerview-selection (aosp/937279)

Bug fixes

  • Fixed a bug where RecyclerView was flinging with incorrect velocities while in a nested scrolling situation. (aosp/961642)
  • Added stability improvements to recyclerview-selection (aosp/960213, aosp/926296)

Version 1.1.0-alpha05

May 7, 2019

androidx.recyclerview:recyclerview:1.1.0-alpha05 and androidx.recyclerview:recyclerview-selection:1.1.0-alpha05 are released. The commits included in this version can be found here.

New features

  • LinearLayoutManager.calculateExtraLayoutSpace(RecyclerView.State, int[]) can be overridden to customize how much extra layout space should be added to either size of the associated RecyclerView. (aosp/931259)

API changes

  • Add API to retrieve DividerItemDecoration drawable (aosp/937282)
  • Deprecate LinearLayout.getExtraLayoutSpace(RecyclerVew.State) in favor of a new mechanism that allows to have custom extra layout space on both sides. The new method is LinearLayout.calculateExtraLayoutSpace(RecyclerView.state, int[]) (aosp/931259)

Bug fixes

Version 1.1.0-alpha04

April 3rd, 2019

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

Bug fixes

  • RV OnItemTouchListener's previously couldn’t intercept on ACTION_UP, preventing OnItemTouchListener’s from blocking other code from responding to ACTION_UP. This is now fixed: (aosp/916137)

Version 1.1.0-alpha03

March 13th, 2019

androidx.recyclerview:recyclerview:1.1.0-alpha03 is released. The full list of commits included in this version can be found here.

New features

  • GridLayoutManager: Opt in, higher resolution GridLayoutManager scroll bar dimension estimation (aosp/838836):
    • Uses span information to estimate scroll bar dimensions for a GridLayoutManager.
    • To enable, call GridLayoutManager#setUsingSpansToEstimateScrollbarDimensions(boolean) passing in true.
    • See the documentation on GridLayoutManager#setUsingSpansToEstimateScrollbarDimensions(boolean) for more information.

Bug fixes

  • Accessibility: There was a bug where once a ViewHolder was recycled and then rebound, the ItemDelegate associated with the RecyclerView’s RecyclerViewAccessibilityDelegate was not being associated with the ViewHolder’s itemView, breaking Accessibility. This is now fixed (aosp/917740).

Version 1.1.0-alpha02

January 30, 2019

androidx.recyclerview:recyclerview 1.1.0-alpha02 is released.

API changes

  • RecyclerView.setLayoutFrozen(boolean) and RecyclerView.isLayoutFrozen() are deprecated in favor of RecyclerView.suppressLayout(boolean) and RecyclerView.isLayoutSuppressed(). (aosp/839414)
  • RecyclerView.setLayoutTransition(LayoutTransition) is formally deprecated and will throw an IllegalArgumentException when called with a non null value. (aosp/839414)

Bug fixes

  • Fix bug in RV where SmoothScroller is never stopped (aosp/843741)
  • Bug fixed where SCROLL_STATE_IDLE may not be called at the end of a scrolling animation. (aosp/812576)

Version 1.1.0-alpha01

December 3, 2018

androidx.recyclerview 1.1.0-alpha01 and androidx.recyclerview-selection 1.1.0-alpha01 are released.

androidx.recyclerview 1.1.0-alpha01

API changes

  • aosp/723649: RecyclerView now implements NestedScrollingChild3, enabling it to be informed of when all its nested scrolling parents have stopped consuming nested scrolling distances. If developer code currently overrides RecyclerView.onNestedScroll(View, int, int, int, int, int), it will likely no longer be called and RecyclerView.onNestedScroll(View, int, int, int, int, int, int[]) should be overridden instead.

Bug fixes

  • Fixed crash when using TransitionManager to collapse/expand item in RecyclerView (b/37129527).
  • Fixed bug where RecyclerView.OnItemTouchListener’s behavior was inconsistent with the view system’s onInterceptTouchEvent and onTouchEvent behavior (aosp/721235)
  • Fixed few edge case bugs related to smooth scrolling (aosp/729718, aosp/747168, aosp/812576)
  • Fixed snap strategy in PagerSnapHelper to deal with non-typical child views (aosp/795752)

androidx.recyclerview-selection 1.1.0-alpha01

Bug fixes

  • Fixed ConcurrentModificationException when data set changed with removing selection.

RecyclerView-Selection Version 1.1.0

RecyclerView-Selection Version 1.1.0-beta01

December 4, 2019

androidx.recyclerview:recyclerview-selection:1.1.0-beta01 is released. Version 1.1.0-beta01 contains these commits.

General improvements in stability related to defensive checks and management of internal state.

Bug fixes

API changes

  • Added selection key type parameter to classes and methods where missing.
  • Deprecated methods:
    • SelectionTracker.Builder#withPointerTooltype
    • SelectionTracker.Builder#withGestureTooltype
    • These methods existed with the intent that developers might map pointer or gesture behaviors to tooltypes other than the defaults*. The intent was good, but upon further use it became clear that user expectations around input behavior are very tooltype specific. Also, "passive" styli are FINGER tooltype as far as the Android input system is concerned.
    • Default tooltypes are FINGER for Gesture and MOUSE for Pointer.