rubensousa/gravitysnaphelper

A SnapHelper that snaps a RecyclerView to an edge.

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 5 minutes ago
Type:Library / SDKCategory(s):AndroidMobile & Desktop
Added to GitGenius on September 13th, 2026
Created on August 31st, 2016
Open Issues & Pull Requests: 0 (+0)
GitHub issues: Enabled
Number of forks: 615
Total Stargazers: 4,979 (+0)
Total Subscribers: 97 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 1023.8 days
Mean response time: 1109.7 days
90th percentile: 1941.7 days
Tracked items: 6

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 0
New in 7 days: 0
Closed in 7 days: 0
Avg open age: N/A days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • wontfix (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

GravitySnapHelper is a SnapHelper for Android that snaps a RecyclerView to an edge.

The tool addresses the problem of controlling how RecyclerView items align when scrolling stops. Android's standard SnapHelper implementations offer limited control over snapping behavior and gravity direction. GravitySnapHelper extends SnapHelper to let developers specify which edge items should snap to—start, end, or center—and provides fine-grained control over fling dynamics through maximum fling distance limits and scroll speed adjustments.

Developers building Android apps with horizontally or vertically scrolling lists should consider this tool if they need edge-aligned snapping with directional control. It suits projects using nested RecyclerViews, where standard snapping behavior can cause scroll conflicts. The tool can be integrated either by instantiating GravitySnapHelper directly and attaching it to a RecyclerView, or by using the provided GravitySnapRecyclerView subclass with XML attributes for configuration. Key capabilities include adjustable fling distance via setMaxFlingDistance or setMaxFlingSizeFraction, scroll speed control through setScrollMsPerInch, gravity selection via setGravity, optional snapping to padding, and built-in right-to-left language support.

The project maintains a steady stream of commits addressing edge cases and user-reported issues. Pull requests receive thoughtful review with discussion of implementation trade-offs and compatibility concerns. The maintainer actively engages with users reporting problems, often providing diagnostic guidance and follow-up fixes. Documentation includes supplementary blog posts covering specific scenarios like nested RecyclerView scroll state preservation, indicating attention to real-world usage patterns beyond the basic README.