Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Notifications You must be signed in to change notification settings

cdmunoz/SnapHelperExample

Open more actions menu

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.