-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Labels
Milestone
Description
Based on specs: https://m3.material.io/components/carousel/overview
The simplest solution is possibly a SpotlightModel + a new MotionController derived from SpotlightSlider that has a sliding window mechanism:
windowSize= 3 or 4 based on design specs, but should be a constructor argleft,rightindices are maintained to bewindowSizeapartleft,rightindices are maintained to be pushed around byscrollX– i.e. if thescrollXvalue would go beyond the values stored inleftorright, both of them move in that direction, maintaining their distance = this way the window can be "pushed around" automatically, but the active element can move around within the window bounds- ui element target picking is done in 2 phases:
- 1st phase:
windowSizeelements are picked from the overall list, with the condition that their index is withinleft,right - 2nd phase: each element in the window is compared against
activeIndexto pick the right TargetUiState (small,medium,large) - all other elements transition towards a TargetUiState
hidden