CarouselStrategy

abstract class CarouselStrategy

A class responsible for creating a model used by a carousel to mask and offset views as they move along a scrolling axis.

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
@FloatRange(from = 0.0, to = 1.0)
open fun getChildMaskPercentage(maskedSize: Float, unmaskedSize: Float, childMargins: Float): Float
Helper method to calculate a child's mask percentage given its masked size, unmasked size, and margins.
Link copied to clipboard
Returns the maximum small item size value.
Link copied to clipboard
Returns the minimum small item size value.
Link copied to clipboard
Calculates a keyline arrangement and returns a constructed KeylineState.
Link copied to clipboard
open fun setSmallItemSizeMax(maxSmallItemSize: Float)
Sets the maximum size for the small items.
Link copied to clipboard
open fun setSmallItemSizeMin(minSmallItemSize: Float)
Sets the minimum size for the small items.
Link copied to clipboard
open fun shouldRefreshKeylineState(@NonNull carousel: Carousel, oldItemCount: Int): Boolean
Whether or not the strategy keylines should be refreshed based on the old item count and the carousel's current parameters.