Add a card carousel to an Android screen where the selected card is centered and adjacent cards are partially visible.
Build a horizontal media picker with animated scale transitions between items.
Create a vertical infinite-scroll selector, like a slot machine or a date picker wheel.
Attach scroll event listeners to sync other UI elements with which card is currently selected.
Add one Gradle dependency, set an adapter, and add the view to your XML layout, no LayoutManager configuration needed.
DiscreteScrollView is an Android library that creates a scrollable list where one item is always centered on screen, and the items to its left or right remain partially visible at the edges. The effect is similar to a horizontal card picker or a media carousel. Think of it like Android's built-in ViewPager, but with more flexibility in how much of the neighboring items shows through. The library is built on top of Android's RecyclerView component, which means setup follows the same pattern developers already know: attach an adapter that supplies your item views, and the library handles the rest. You do not set a LayoutManager because the library provides its own internally. Adding it to a layout takes a few lines of XML, and a working picker requires only setting an adapter in code. Several behaviors can be configured beyond the basics. Items can be animated during transitions using a transformer, which gives each card a custom visual effect as it moves in or out of the center position. A built-in scale transformer makes it easy to shrink non-selected cards without writing any animation code. Orientation can be set to horizontal or vertical. A slide-on-fling option lets users skip past multiple items in one swipe gesture. Infinite scroll wraps the list end-to-end using an adapter wrapper class. Scroll can be locked in specific directions if the UI needs it. The library provides callback interfaces for listening to scroll events, letting you track when a scroll starts and ends, how far through a transition the list is at any given moment, and when the selected item changes. This is an open source Java project. A sample app on Google Play demonstrates the different configuration options. The project accepts contributions and includes guidance in the README on how to report issues effectively.
← yarolegovich on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.