Changelog¶
Version 1.5.0¶
1.5.0-alpha01¶
2025-06-28
Bug fixes¶
- Fixed scrolling issue when extra layout space is used (#309)
New features¶
- The new
setFocusSearchDebounceMsallows throttling focus searches based on the time elapsed between different key events (#308)
API changes¶
- Deprecated
setSmoothScrollMaxPendingAlignmentsin favor of the newsetFocusSearchDebounceMssince there was an issue with controlling the scroll speed near the edges of the list. - Deprecated
DpadComposeViewHolderin favor ofDpadComposeFocusViewHolderto always hold focus inside Compose. - Removed
RecyclerViewCompositionStrategysince it wasn't needed since a few releases ago due to changes inRecyclerView.
Version 1.4.3¶
2025-05-07
Bug fixes¶
- Fixed grids not aligning to min edge: (#302)
Version 1.4.2¶
2025-03-30
Bug fixes¶
- Fixed -1 being sent to
DpadSpanSizeLookup.getSpanSizewhen views are removed from the adapter: (#298)
Version 1.4.1¶
2025-02-11
Bug fixes¶
- Fixed layout inconsistency when scrolling if
Edge.Minis used for parent alignment. (#291)
API changes¶
- Breaking change: Now DpadRecyclerView is passed in
OnViewHolderSelectedListenerandOnChildLaidOutListenerinstead of plainRecyclerView.
Version 1.4.0¶
1.4.0¶
2024-12-18
- No changes since
1.4.0-rc02
Important changes since 1.3.0¶
- Added
setItemSpacing,setItemEdgeSpacingand other spacing setters toDpadRecyclerView. Documentation available here. - Added
onViewHolderDeselectedtoOnViewHolderSelectedListener - Added
OnFocusLostListenerto observe focus losses ofDpadRecyclerView - Added
DpadRecyclerView.setAlignmentLookupto customize the alignment for individual positions and bypassing the default alignment configurations - Improved
Modifier.dpadClickableto support long clicks - New
DpadScrollableLayoutfor screens that need a scrollable header at the same level as aDpadRecyclerView - Testing: Added
KeyEvents.longClickto trigger long clicks from tests
1.4.0-rc02¶
2024-11-15
Bug fixes¶
- Fixed concurrent modification exception when some listeners remove themselves: (#285)
- Fixed child layout listener not being removed: (#285)
1.4.0-rc01¶
2024-11-11
Bug fixes¶
- Fixed selection being reset if it's requested immediately after updating the adapter: (#283)
1.4.0-beta03¶
2024-10-17
New features¶
- Added
onViewHolderDeselectedtoOnViewHolderSelectedListener(#280)
API changes¶
- Added
addOnChildLaidOutListener,removeOnChildLaidOutListenerandclearOnChildLaidOutListenersto replacesetOnChildLaidOutListener(#280)
Bug fixes¶
- Fixed focus not leaving
DpadRecyclerViewin some cases: (#278)
1.4.0-beta02¶
2024-10-08
Bug fixes¶
- Fixed focus order not being consistent in some cases: (#275)
1.4.0-beta01¶
2024-10-05
Bug fixes¶
- Do not allow scrolling more than the layout size when
AlignmentLookupis used: (#270)
1.4.0-alpha06¶
2024-09-05
New features¶
-
Added
setItemSpacing,setItemEdgeSpacingand other spacing setters toDpadRecyclerView(#263) Documentation available here. -
Added independent min and max edge spacings to
DpadLinearSpacingDecorationandDpadGridSpacingDecoration(#263)
API changes¶
- Now
DpadDragHelperexposesfromUserinonDragStopped, which allows distinguishing between user or programmatic stop requests (#264)
1.4.0-alpha05¶
2024-08-30
Note: This version includes an update to androidx.recyclerview 1.4.0-beta01, which requires compile SDK set to 35
New features¶
- Added
OnFocusLostListenerto observe focus losses ofDpadRecyclerView(#258) - Added
dpadRecyclerView.setAlignmentLookupto customize the alignment for individual positions (#259)
Compose¶
- Improved
Modifier.dpadClickableto support long clicks (#261) - Fix
Modifier.dpadClickablesending FOCUS_ENTER after the click (#261)
Testing¶
- Added
KeyEvents.longClickto trigger long clicks from tests (#261)
Bug fixes¶
- Fix item decorations not being updated whenever the adapter contents change (#260)
1.4.0-alpha04¶
2024-08-21
Bug fixes¶
- Fix header alignment when
DpadScrollableLayouttriggers a new layout (#255)
1.4.0-alpha03¶
2024-08-14
Bug fixes¶
- Fix header not being initially shown sometimes with
DpadScrollableLayout(#253)
1.4.0-alpha02¶
2024-08-14
Bug fixes¶
- Fix issue with header alignment when
DpadScrollableLayoutreceives a layout request during scroll (#251)
1.4.0-alpha01¶
2024-08-12
New features¶
DpadScrollableLayoutfor screens that need a scrollable header at the same level as aDpadRecyclerView(#248)
Bug fixes¶
- Fixed crash when the layout manager name is set via XML (#247)
Version 1.3.0¶
1.3.0¶
2024-08-08
Important changes since 1.2.0¶
- Added
DpadComposeFocusViewHolderthat allows sending the focus state down to Composables - Added
Modifier.dpadClickablefor playing the click sound after clicking on a Composable. - Allow skipping layout requests during scroll with
setLayoutWhileScrollingEnabled(false) - New
addOnViewFocusedListenerto observe focus changes independently from selection changes. - Added
DpadDragHelperfor drag and drop support. Documentation available here. - Now
recyclerView.setFocusableDirection(FocusableDirection.CIRCULAR)can also be used in linear layouts that don't fill the entire space. - Added
DpadStateRegistrythat assists in saving and restoring the scroll state or view state of ViewHolders
1.3.0-rc03¶
2024-07-23
Bug fixes¶
- Fixed layout inconsistency after some predictive animations (#240)
- Fixed rare crash when removing an item due to adapter changes while a scroll action is pending (#240)
1.3.0-rc02¶
2024-07-11
Bug fixes¶
- Fixed
DpadRecyclerViewnot immediately stopping the search for the pivot in some scenarios (#238)
1.3.0-rc01¶
2024-07-08
- Reverted default of
setLayoutWhileScrollingEnabled()back to true.
1.3.0-beta02¶
2024-06-20
Bug fixes¶
- Fixed
OnViewFocusedListenernot working correctly for a parent RecyclerView when a nested RecyclerView doesn't have a listener registered (#229) - Fixed
DpadRecyclerViewlosing focus when adapter is cleared (#232)
1.3.0-beta01¶
2024-06-17
Dependency updates¶
- Updated library to Kotlin 2.0
- Updated Compose ui libraries to
1.7.0-beta03
New Features¶
- Added
DpadDragHelperfor drag and drop support (#216). Documentation available here. - Now
recyclerView.setFocusableDirection(FocusableDirection.CIRCULAR)can also be used in linear layouts that don't fill the entire space. (#225
Improvements¶
- Now
focusOutFrontandfocusOutBackare enabled by default due to feedback from library users (#223) - Improved focus behavior for grids with uneven spans that have incomplete rows (#224)
1.3.0-alpha04¶
2024-06-04
New Features¶
- Added
DpadSelectionSnapHelperto improve selection on touch events. (#215) - Added
isFocusabletoDpadComposeFocusViewHolderto allow disabling focus for some items.
Bug fixes¶
- Fixed initial selection being always at position 0, even when that view is not focusable.
- Fixed some rows not receiving focus in grids using
DpadSpanSizeLookup. (#217) - Fixed fast scrolling not working correctly in some grids using
DpadSpanSizeLookup. (#218)
1.3.0-alpha03¶
2024-05-31
New Features¶
- Added
DpadStateRegistrythat assists in saving and restoring the scroll state or view state of ViewHolders (#45)
Improvements¶
- Disable layout passes during scroll events by default. This is an attempt to fix (#207)
To fallback to the previous behavior, please use
setLayoutWhileScrollingEnabled(true)
Bug fixes¶
- Fixed issue with grid layouts with different spans after item removals. (#210)
- Fixed
DpadRecyclerViewlosing focus in some cases when adapter contents are updated during scroll events. (#206)
1.3.0-alpha02¶
2024-03-23
Bug fixes¶
- Fixed grids not aligning to the keyline for the last row in some cases. (#203)
1.3.0-alpha01¶
2024-03-17
New Features¶
- Added
DpadComposeFocusViewHolderthat allows sending the focus state down to Composables (#193) - Added
Modifier.dpadClickablefor playing the click sound after clicking on a Composable. Fix for: (/b/268268856) - Allow skipping layout requests during scroll with
setLayoutWhileScrollingEnabled(false)(#196) - New
addOnViewFocusedListenerto observe focus changes independently from selection changes. (#197)
API Changes¶
DpadAbstractComposeViewHolderis now removed. Replace it with eitherDpadComposeFocusViewHolderorDpadComposeViewHolder.
Version 1.2.0¶
1.2.0¶
2024-03-13
- No changes since 1.2.0-rc01
Important changes since 1.1.0¶
- Added new
RecyclerViewCompositionStrategy.DisposeOnRecycledfor compose interop to re-use compositions when views are detached and attached from the window again. - Added new
setSelectedSubPositionthat allows passing a callback for the target alignment (#43) - Added support for scrollbars
- Added
DpadScrollerfor scrolling without any alignment. Typical use case is for long text displays (terms & conditions and consent pages).
1.2.0-rc01¶
2024-02-03
Bug fixes¶
- Fixed focus being sent to the wrong item when scrolling with touch events before pressing a key (#188)
1.2.0-beta02¶
2024-01-28
New Features¶
- Added new
RecyclerViewCompositionStrategy.DisposeOnRecycledfor compose interop to re-use compositions when views are detached and attached from the window again.
Bug fixes¶
- Fixed views not being laid out correctly sometimes when
setRecycleChildrenOnDetachis used.
1.2.0-beta01¶
2024-01-17
New Features¶
- Added new
setSelectedSubPositionthat allows passing a callback for the target alignment (#43)
Bug fixes¶
- Fixed navigation sound not being played when searching for pivot (#167)
- Fixed sub selection not being dispatched when used multiple times in a row
1.2.0-alpha03¶
2024-01-10
Bug fixes¶
- Fixed crash when requesting layout after a selection to an index out of bounds (#178)
1.2.0-alpha02¶
2023-12-27
Bug fixes¶
- Fixed layout jumping to the top when the user scrolls with touch events (#171)
- Fixed alignment configuration not being respected for small lists (#172)
1.2.0-alpha01¶
2023-11-25
New Features¶
- Added support for scrollbars
- Added
DpadScrollerfor scrolling without any alignment. Typical use case is for long text displays (terms & conditions and consent pages).
Version 1.1.0¶
1.1.0¶
2023-11-12
- No changes since 1.1.0-rc01
1.1.0-rc01¶
2023-10-18
Dependency updates¶
- Updated
androidx.recyclerviewto version1.3.2to fix sporadic crashes during animations: (/9e69afd) - Updated
androidx.collectionto stable version1.3.0
1.1.0-beta02¶
2023-09-15
Bug fixes¶
- Fixed wrong scrolling behavior when the
app:spanCountattribute is used for grids (#162)
1.1.0-beta01¶
2023-09-10
Bug fixes¶
- Fixed wrong scrolling behavior when the layout isn't completely filled and
Edge.MAXalignment is used: (#160) - Fixed XML attribute
app:dpadRecyclerViewParentAlignmentPreferKeylineOverEdgenot being applied correctly
1.1.0-alpha03¶
2023-08-04
Bug fixes¶
- Fixed grid layout not placing views in the correct spans when scrolling in opposite direction: (#156)
1.1.0-alpha02¶
2023-06-23
Bug fixes¶
- Fixed crash when updating adapter contents too frequently: (#153)
1.1.0-alpha01¶
2023-06-08
New Features¶
- Added support for endless scrolling with looping adapter contents: (#20). Check this for more information.
Version 1.0.0¶
1.0.0¶
2023-05-16
New Features¶
- Added support for API 19 (#146)
- Added missing XML attribute for parent alignment
app:dpadRecyclerViewParentAlignmentPreferKeylineOverEdge(#145)
Bug fixes¶
- Fixed crash when R8 is applied (#122)
1.0.0-rc01¶
2023-05-07
Dependency updates¶
- Removed consumer proguard rules
- Exposed recyclerview dependency to clients
1.0.0-beta03¶
2023-05-03
Dependency updates¶
- Updated compose-ui to version
1.4.2
New Features¶
- Added
getSpanSizeLookup()toDpadRecyclerView - Added
onViewHolderSelectedAndAlignedtoDpadViewHolder
Compose¶
- Added
DpadAbstractComposeViewHolderto allow subclasses to get access to focus changes. Check Compose interoperability for more information.
Testing¶
See the documentation here
- Added
KeyEvents.back()to easily press back key events - Added
DpadRecyclerViewActions.scrollToandDpadRecyclerViewActions.scrollToHolderto scroll to specific ViewHolders using KeyEvents. - Added
DpadViewAssertionsfor asserting focus states:DpadViewAssertions.hasFocus()DpadViewAssertions.doesNotHaveFocus()DpadViewAssertions.isFocused()DpadViewAssertions.isNotFocused()
1.0.0-beta02¶
2023-04-18
Dependency updates¶
- Updated RecyclerView to stable version
1.3.0
New Features¶
Bug fixes¶
- Fixed
DpadRecyclerViewnot measuring itself correctly whenwrap_contentis used. (#123) - Fixed max edge alignment not working correctly when scrolling back. (#124)
1.0.0-beta01¶
2023-04-02
Bug fixes¶
- Fixed crash in grid layout when pivot is updated during pagination. (#114)
1.0.0-alpha05¶
2023-02-21
New Features¶
- New
dpadrecyclerview-composemodule that containsDpadComposeViewHolderfor Compose interoperability. Check Compose interoperability for more information. - Allow setting 0 max pending moves with
setSmoothScrollMaxPendingMoves(0)to fully prevent unwanted scroll events.
API changes¶
offsetRatioinParentAlignment,ChildAlignmentandSubPositionAlignmentwas renamed tofraction.
Bug fixes¶
- Fixed alignment issue when the first item has decoration (#91)
- Fixed alignment issue when
Edge.MINis used and there's a small number of adapter items (#93) - Fixed focus changing to the incorrect span in a grid (#96)
- Fixed focus being lost when scrolling a grid and triggering layout passes at the same time (#102)
- Fixed
DpadRecyclerViewscrolling automatically to the current selected position when there's a touch event (#104) - Fixed pending alignments in opposite direction not being ignored (#106)
Testing¶
- New
KeyEvents.click()to easily dispatch click events in UI tests
1.0.0-alpha04¶
2023-02-13
New Features¶
- Added
DpadLinearSpacingItemDecorationandDpadGridSpacingItemDecorationto easily set spacing between items - Added
setScrollEnabledto enable or disable scroll events - Added
setLayoutEnabledto enable or disable the layout of children - Added support for reverse layout via
setReverseLayout - Restored support for basic touch event scrolling without triggering selection or alignment changes
- Added support for item prefetching for nested RecyclerViews
setSmoothScrollMaxPendingAlignmentsallows limiting the number of scroll changes still not appliedsetSmoothScrollMaxPendingMovesallows remembering DPAD events not yet applied- Improved fast smooth scrolling in grids with different span sizes
- Added
setOnChildLaidOutListenerto observe when each view is laid out setFocusSearchEnabledDuringAnimationsallows enabling or disabling focus changes during item animations.
API Changes¶
ViewHolderAlignmentwas renamed toSubPositionAlignment. NowDpadViewHolderreturns these alignments ingetSubPositionAlignments.
Bug fixes¶
- Fixed
DpadRecyclerViewnot searching for focus if it's currently retaining focus due to a pivot removal. This prevented accumulating pending moves during smooth scrolling. - A nested
DpadRecyclerViewnow won't search for focus if its parentRecyclerViewis still smooth scrolling (#50) - Alignment not being restored correctly for small lists (#71)
- Unnecessary
ItemAnimatoranimations were running when scrolling during item changes (#47) - a11y scroll actions were not triggering scroll events (#66)
- Circular focus not working correctly for the first row (#37)
Testing¶
DisableIdleTimeoutRulewill now wait for idle input after the test is over to avoid dispatching key events to other tests
1.0.0-alpha03¶
2023-01-26
New Features¶
- Added support for findFirstVisibleItemPosition and findLastVisibleItemPosition (#23)
- Added support for recycling children on detach (#17)
API Changes¶
- Replaced
DpadLayoutManagerwith newPivotLayoutManagerfor proper customization of layout logic (#10), (#16)
1.0.0-alpha02¶
2022-12-10
API Changes¶
- Allow extending from
DpadRecyclerView - Removed
RecyclerView.canScrollHorizontallyandRecyclerView.canScrollVerticallysince they're not used and clients can create them themselves
1.0.0-alpha01¶
2022-11-06
- Initial alpha release