Package 

Object PagerDefaults


  • @Deprecated(message = 
    accompanist/pager is deprecated.
    The androidx.compose equivalent of Pager is androidx.compose.foundation.pager.Pager.
    For more migration information, please visit https://google.github.io/accompanist/pager/#migration
    ) 
    public class PagerDefaults
    
                        

    Contains the default values used by HorizontalPager and VerticalPager.

    • Method Summary

      Modifier and Type Method Description
      final FlingBehavior flingBehavior(PagerState state, DecayAnimationSpec<Float> decayAnimationSpec, AnimationSpec<Float> snapAnimationSpec, Function1<SnapperLayoutInfo, Float> maximumFlingDistance, Dp endContentPadding) Remember the default FlingBehavior that represents the scroll curve.
      final FlingBehavior flingBehavior(PagerState state, DecayAnimationSpec<Float> decayAnimationSpec, AnimationSpec<Float> snapAnimationSpec, Dp endContentPadding, Function3<SnapperLayoutInfo, Integer, Integer, Integer> snapIndex) Remember the default FlingBehavior that represents the scroll curve.
      final FlingBehavior flingBehavior(PagerState state, DecayAnimationSpec<Float> decayAnimationSpec, AnimationSpec<Float> snapAnimationSpec, Dp endContentPadding) Remember the default FlingBehavior that represents the scroll curve.
      final Function1<SnapperLayoutInfo, Float> getSinglePageFlingDistance() The default implementation for the maximumFlingDistance parameter of flingBehavior which limits the fling distance to a single page.
      final Function3<SnapperLayoutInfo, Integer, Integer, Integer> getSinglePageSnapIndex() The default implementation for the snapIndex parameter of flingBehavior which limits the fling distance to a single page.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • flingBehavior

         final FlingBehavior flingBehavior(PagerState state, DecayAnimationSpec<Float> decayAnimationSpec, AnimationSpec<Float> snapAnimationSpec, Function1<SnapperLayoutInfo, Float> maximumFlingDistance, Dp endContentPadding)

        Remember the default FlingBehavior that represents the scroll curve.

        Please remember to provide the correct endContentPadding if supplying your own FlingBehavior to VerticalPager or HorizontalPager. See those functions for how they calculate the value.

        Parameters:
        state - The PagerState to update.
        decayAnimationSpec - The decay animation spec to use for decayed flings.
        snapAnimationSpec - The animation spec to use when snapping.
        maximumFlingDistance - Block which returns the maximum fling distance in pixels.
        endContentPadding - The amount of content padding on the end edge of the lazy list in pixels (end/bottom depending on the scrolling direction).
      • flingBehavior

         final FlingBehavior flingBehavior(PagerState state, DecayAnimationSpec<Float> decayAnimationSpec, AnimationSpec<Float> snapAnimationSpec, Dp endContentPadding, Function3<SnapperLayoutInfo, Integer, Integer, Integer> snapIndex)

        Remember the default FlingBehavior that represents the scroll curve.

        Please remember to provide the correct endContentPadding if supplying your own FlingBehavior to VerticalPager or HorizontalPager. See those functions for how they calculate the value.

        Parameters:
        state - The PagerState to update.
        decayAnimationSpec - The decay animation spec to use for decayed flings.
        snapAnimationSpec - The animation spec to use when snapping.
        endContentPadding - The amount of content padding on the end edge of the lazy list in pixels (end/bottom depending on the scrolling direction).
        snapIndex - Block which returns the index to snap to.
      • flingBehavior

         final FlingBehavior flingBehavior(PagerState state, DecayAnimationSpec<Float> decayAnimationSpec, AnimationSpec<Float> snapAnimationSpec, Dp endContentPadding)

        Remember the default FlingBehavior that represents the scroll curve.

        Please remember to provide the correct endContentPadding if supplying your own FlingBehavior to VerticalPager or HorizontalPager. See those functions for how they calculate the value.

        Parameters:
        state - The PagerState to update.
        decayAnimationSpec - The decay animation spec to use for decayed flings.
        snapAnimationSpec - The animation spec to use when snapping.
        endContentPadding - The amount of content padding on the end edge of the lazy list in pixels (end/bottom depending on the scrolling direction).
      • getSinglePageFlingDistance

         final Function1<SnapperLayoutInfo, Float> getSinglePageFlingDistance()

        The default implementation for the maximumFlingDistance parameter of flingBehavior which limits the fling distance to a single page.