Package 

Class Pager


  • 
    public final class Pager
    
                        
    • Method Summary

      Modifier and Type Method Description
      final static Unit HorizontalPager(Integer count, Modifier modifier, PagerState state, Boolean reverseLayout, Dp itemSpacing, PaddingValues contentPadding, Alignment.Vertical verticalAlignment, FlingBehavior flingBehavior, Function1<Integer, Object> key, Boolean userScrollEnabled, Function2<PagerScope, Integer, Unit> content) A horizontally scrolling layout that allows users to flip between items to the left and right.
      final static Unit VerticalPager(Integer count, Modifier modifier, PagerState state, Boolean reverseLayout, Dp itemSpacing, PaddingValues contentPadding, Alignment.Horizontal horizontalAlignment, FlingBehavior flingBehavior, Function1<Integer, Object> key, Boolean userScrollEnabled, Function2<PagerScope, Integer, Unit> content) A vertically scrolling layout that allows users to flip between items to the top and bottom.
      final static Float calculateCurrentOffsetForPage(PagerScope $self, Integer page) Calculate the offset for the given page from the current scroll position.
      • Methods inherited from class java.lang.Object

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

      • HorizontalPager

         final static Unit HorizontalPager(Integer count, Modifier modifier, PagerState state, Boolean reverseLayout, Dp itemSpacing, PaddingValues contentPadding, Alignment.Vertical verticalAlignment, FlingBehavior flingBehavior, Function1<Integer, Object> key, Boolean userScrollEnabled, Function2<PagerScope, Integer, Unit> content)

        A horizontally scrolling layout that allows users to flip between items to the left and right.

        Parameters:
        count - the number of pages.
        modifier - the modifier to apply to this layout.
        state - the state object to be used to control or observe the pager's state.
        reverseLayout - reverse the direction of scrolling and layout, when true items will be composed from the end to the start and PagerState.currentPage == 0 will mean the first item is located at the end.
        itemSpacing - horizontal spacing to add between items.
        flingBehavior - logic describing fling behavior.
        key - the scroll position will be maintained based on the key, which means if you add/remove items before the current visible item the item with the given key will be kept as the first visible one.
        userScrollEnabled - whether the scrolling via the user gestures or accessibility actions is allowed.
        content - a block which describes the content.
      • VerticalPager

         final static Unit VerticalPager(Integer count, Modifier modifier, PagerState state, Boolean reverseLayout, Dp itemSpacing, PaddingValues contentPadding, Alignment.Horizontal horizontalAlignment, FlingBehavior flingBehavior, Function1<Integer, Object> key, Boolean userScrollEnabled, Function2<PagerScope, Integer, Unit> content)

        A vertically scrolling layout that allows users to flip between items to the top and bottom.

        Parameters:
        count - the number of pages.
        modifier - the modifier to apply to this layout.
        state - the state object to be used to control or observe the pager's state.
        reverseLayout - reverse the direction of scrolling and layout, when true items will be composed from the bottom to the top and PagerState.currentPage == 0 will mean the first item is located at the bottom.
        itemSpacing - vertical spacing to add between items.
        flingBehavior - logic describing fling behavior.
        key - the scroll position will be maintained based on the key, which means if you add/remove items before the current visible item the item with the given key will be kept as the first visible one.
        userScrollEnabled - whether the scrolling via the user gestures or accessibility actions is allowed.
        content - a block which describes the content.
      • calculateCurrentOffsetForPage

         final static Float calculateCurrentOffsetForPage(PagerScope $self, Integer page)

        Calculate the offset for the given page from the current scroll position. This is useful when using the scroll position to apply effects or animations to items.

        The returned offset can positive or negative, depending on whether which direction the page is compared to the current scroll position.