KeylineStateList

An object that manages a KeylineState and handles shifting the focal keyline range to the left and right of a the carousel container automatically.

This class generates KeylineStates for each discreet step needed to move the focal range from it's default location to the left or right of the carousel container. These state "steps" can then be interpolated between depending on the scroll offset of the carousel to create a smooth shifting of the focal range along the scroll axis while preserving the look and feel of the original KeylineState arrangement.

This class does not need to account for layout direction. CarouselLayoutManager will handle reversing a KeylineState when being laid out right-to-left before constructing a KeylineStateList.

Functions

Link copied to clipboard
open fun getShiftedState(scrollOffset: Float, minScrollOffset: Float, maxScrollOffset: Float): KeylineState
Gets a shifted KeylineState appropriate for a scroll offset.