Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 954 Bytes

README.md

File metadata and controls

15 lines (11 loc) · 954 Bytes

SnapHelperExample

This project shows how to use a SnapHelper to snap the contents of a recycler view to the start, center or end.

In this way, based on LinearSnapHelper class which always snaps to the center, two additional classes were created in order to support snapping both to start and to end. These classes are located in /data/common package and override calculateDistanceToFinalSnap and findSnapView to define the snapping behavior. On each class the method distanceToStart and distanceToEnd were created as well respectively.

The master branch is in Java. kotlin-version in Kotlin.

How this would like

The first list snaps the list to the start, the second to the center and the third to the end

Horizontal Snap Vertical Snap