rememberPagerState

Functions summary

PagerState
@Composable
rememberPagerState(
    initialPage: @IntRange(from = 0) Int,
    initialPageOffsetFraction: @FloatRange(from = -0.5, to = 0.5) Float,
    pageCount: @IntRange(from = 1) () -> Int
)

Creates and remember a PagerState to be used with a Wear Pager

Functions

rememberPagerState

@Composable
fun rememberPagerState(
    initialPage: @IntRange(from = 0) Int = 0,
    initialPageOffsetFraction: @FloatRange(from = -0.5, to = 0.5) Float = 0.0f,
    pageCount: @IntRange(from = 1) () -> Int
): PagerState

Creates and remember a PagerState to be used with a Wear Pager

Parameters
initialPage: @IntRange(from = 0) Int = 0

The page that should be shown first.

initialPageOffsetFraction: @FloatRange(from = -0.5, to = 0.5) Float = 0.0f

The offset of the initial page as a fraction of the page size. This should vary between -0.5 and 0.5 and indicates how to offset the initial page from the snapped position.

pageCount: @IntRange(from = 1) () -> Int

The number of pages this Pager will have.